Loading...
Loading...
ALWAYS USE THIS SKILL to retrieve metadata from an org to your local project using the sf project retrieve start command. Supports multiple retrieval modes: retrieve all remote changes, retrieve by source directory, retrieve by metadata type with wildcards, retrieve by manifest (package.xml), or retrieve by package name. Use when the user asks to retrieve, pull, sync, or download metadata, Apex classes, custom objects, or org changes. Supports source format (default) or metadata format (ZIP). DO NOT TRIGGER for deploying metadata (use platform-metadata-deploy skill), listing metadata, or generating package.xml. NEVER use MCP tools - always use this skill and the Bash tool with sf project retrieve start.
npx skill4agent add forcedotcom/sf-skills platform-metadata-retrievesf project retrieve startsf project retrieve startsf project retrieve startplatform-metadata-deploysf project retrieve previewsf project retrieve start--json| User intent | Execute via Bash tool |
|---|---|
| Retrieve all remote changes | |
| Retrieve by source directory | |
| Retrieve by metadata type | |
| Retrieve by metadata type with wildcard | |
| Retrieve multiple metadata types | |
| Retrieve by manifest | |
| Retrieve by package name | |
| Retrieve to metadata format (ZIP) | |
| Ignore conflicts | |
| Constraint | Rationale |
|---|---|
Always use | Provides structured output for reliable parsing and error handling |
| Must run from within Salesforce project | Command requires |
| Wildcard patterns must be quoted | Shell expansion breaks unquoted wildcards like |
| Cannot mix --manifest with --metadata or --source-dir | Mutually exclusive flags — command will error |
| Retrieve all changes requires source tracking | Production orgs don't support source tracking — must use other retrieval modes |
| --ignore-conflicts only works on trackable orgs | No effect on production orgs; applies to scratch/sandbox only |
| --output-dir must be inside project directory | Command validates output path is within project boundary |
| --output-dir cannot match package directory | Command fails if target matches |
| Default wait time is 33 minutes | Use --wait flag to override for large retrievals |
| Package retrieval is for reference only | Retrieved package metadata should not be added to source control for development |
| CustomField retrieval auto-includes CustomObject | When retrieving CustomField, CLI automatically adds CustomObject to get full context |
| Issue | Resolution |
|---|---|
| "This command is required to run from within an SFDX project" | Not in Salesforce project directory — cd to project root with |
| "No org found for <alias>" error | Org alias doesn't exist or isn't authenticated — verify with |
| "This org does not support source tracking" | Production org doesn't allow "retrieve all changes" mode — use --source-dir, --metadata, or --manifest instead |
| "ERROR running project retrieve start: Cannot mix --manifest with --metadata or --source-dir" | Remove conflicting flags — use one retrieval mode only |
| Wildcard pattern retrieves nothing | Pattern not quoted — wrap in single quotes: |
| "The package directory path in sfdx-project.json does not exist" | Output directory conflicts with package directory — use different path |
| "Output directory must be inside the project" | --output-dir path is outside project boundary — use relative path inside project |
| Retrieve times out | Increase wait time with |
| Retrieved files overwrite local changes | Use |
| SourceConflictError with conflict table | Conflicts detected between local and remote on trackable org (scratch/sandbox) — resolve conflicts manually or use --ignore-conflicts to force overwrite |
examples/success_output.jsonexamples/error_output.json| Need | Delegate to |
|---|---|
| Deploy metadata to org | |
| Preview retrieve without executing | Execute |
| List available metadata types | Execute |
| File | When to read |
|---|---|
| To understand successful retrieve response structure |
| To handle common error scenarios |
| For detailed explanation of all retrieval modes and when to use each |
| For complete flag reference with usage patterns |