forcedotcom/sf-skills / plugins/builder/salesforce-development/skills/platform-metadata-retrieve
platform-metadata-retrieve
VerifiedALWAYS USE THIS SKILL to retrieve metadata from an org to your local project with sf project retrieve start. Supports retrieval by all changes, source directory, metadata type (wildcards), manifest (package.xml), or package name, in source or metadata (ZIP) format. Use when the user asks to retrieve, pull, sync, or download metadata, Apex classes, or custom objects. DO NOT TRIGGER for deploying metadata (use platform-metadata-deploy), listing metadata, or generating a package.xml (use platform-manifest-generate). NEVER use MCP tools.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.9 KB |
| examples/error_output.json | config | 318 B |
| examples/success_output.json | config | 674 B |
| references/cli_flags.md | markdown | 4.1 KB |
| references/retrieval_modes.md | markdown | 5.2 KB |
references/cli_flags.md
View on GitHub# CLI Flags Reference
Complete reference for `sf project retrieve start` command flags.
## Target Org Flag (Optional When Default Is Set)
**Note:** `--target-org` is omitted when a default org is set via `sf config set target-org`. Only include this flag when the user specifies a non-default org or no default is configured.
| Flag | Alias | Description | Example |
|------|-------|-------------|---------|
| `--target-org` | `-o` | Username or alias of target org (omit if using default) | `--target-org my-org` |
## Retrieval Mode Flags (Mutually Exclusive Groups)
| Flag | Alias | Description | Example |
|------|-------|-------------|---------|
| `--source-dir` | `-d` | File paths to retrieve from org | `--source-dir force-app` |
| `--metadata` | `-m` | Metadata component names (wildcards supported) | `--metadata ApexClass:MyClass*` |
| `--manifest` | `-x` | Path to manifest (package.xml) file | `--manifest config/package.xml` |
| `--package-name` | `-n` | Package names to retrieve (reference only) | `--package-name MyPackage` |
**Note:** Cannot combine `--manifest` with `--metadata` or `--source-dir`. Choose one retrieval mode.
## Optional Flags
| Flag | Alias | Description | Example |
|------|-------|-------------|---------|
| `--api-version` | `-a` | Target API version for retrieve | `--api-version 66.0` |
| `--ignore-conflicts` | `-c` | Ignore conflicts and overwrite local files | `--ignore-conflicts` |
| `--output-dir` | `-r` | Directory root for retrieved source files | `--output-dir retrieved` |
| `--wait` | `-w` | Minutes to wait for completion (default: 33) | `--wait 60` |
## Metadata API Format Flags
| Flag | Description | Example |
|------|-------------|---------|
| `--target-metadata-dir` | Directory for metadata format files or ZIP | `--target-metadata-dir output` |
| `--unzip` | Extract files from retrieved ZIP | `--unzip` |
| `--single-package` | ZIP points to single package directory | `--single-package` |
| `--zip-file-name` | Filename for retrieved ZIP | `--zip-file-name metadata.zip` |
## Usage Patterns
### Basic Retrieve All Changes
```bash
sf project retrieve start --json
```
### Retrieve by Source Directory
```bash
sf project retrieve start --source-dir force-app --target-org my-org --json
```
### Retrieve Multiple Directories
```bash
sf project retrieve start --source-dir force-app/main/default/classes --source-dir force-app/main/default/objects --json
```
### Retrieve by Metadata Type
```bash
sf project retrieve start --metadata ApexClass --target-org my-org --json
```
### Retrieve Specific Component
```bash
sf project retrieve start --metadata ApexClass:AccountService --target-org my-org --json
```
### Retrieve with Wildcard
```bash
sf project retrieve start --metadata 'ApexClass:Account*' --target-org my-org --json
```
### Retrieve Multiple Metadata Types
```bash
sf project retrieve start --metadata CustomObject --metadata ApexClass --target-org my-org --json
```
### Retrieve by Manifest
```bash
sf project retrieve start --manifest config/package.xml --target-org my-org --json
```
### Retrieve by Package Name
```bash
sf project retrieve start --package-name MyPackage --target-org my-org --json
```
### Retrieve Multiple Packages
```bash
sf project retrieve start --package-name Package1 --package-name "Package With Spaces" --target-org my-org --json
```
### Retrieve to Metadata Format
```bash
sf project retrieve start --source-dir force-app --target-metadata-dir output --target-org my-org --json
```
### Retrieve and Extract ZIP
```bash
sf project retrieve start --source-dir force-app --target-metadata-dir output --unzip --target-org my-org --json
```
### Ignore Conflicts
```bash
sf project retrieve start --source-dir force-app --ignore-conflicts --target-org my-org --json
```
### Custom Output Directory
```bash
sf project retrieve start --source-dir force-app --output-dir retrieved --target-org my-org --json
```
### Override Wait Time
```bash
sf project retrieve start --manifest config/package.xml --wait 60 --target-org my-org --json
```
### Override API Version
```bash
sf project retrieve start --source-dir force-app --api-version 66.0 --target-org my-org --json
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |