salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
58 lines (49 loc) • 3.71 kB
JavaScript
module.exports = {
description: 'retrieve source from an org',
longDescription: 'Retrieves metadata in source format from an org to your local Salesforce DX project.',
help: `Use this command to retrieve source (metadata that’s in source format) from an org.
To take advantage of change tracking with scratch orgs, use "sfdx force:source:pull".
To retrieve metadata that’s in metadata format, use "sfdx force:mdapi:retrieve".
The source you retrieve overwrites the corresponding source files in your local project. This command does not attempt to merge the source from your org with your local source files.
If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose it in one set of double quotes.
Examples:
To retrieve the source files in a directory:
$ sfdx force:source:retrieve -p path/to/source
To retrieve a specific Apex class and the objects whose source is in a directory:
$ sfdx force:source:retrieve -p "path/to/apex/classes/MyClass.cls,path/to/source/objects"
To retrieve source files in a comma-separated list that contains spaces:
$ sfdx force:source:retrieve -p "path/to/objects/MyCustomObject/fields/MyField.field-meta.xml, path/to/apex/classes"
To retrieve all Apex classes:
$ sfdx force:source:retrieve -m ApexClass
To retrieve a specific Apex class:
$ sfdx force:source:retrieve -m ApexClass:MyApexClass
To retrieve all custom objects and Apex classes:
$ sfdx force:source:retrieve -m "CustomObject,ApexClass"
To retrieve all Apex classes and two specific profiles (one of which has a space in its name):
$ sfdx force:source:retrieve -m "ApexClass, Profile:My Profile, Profile: AnotherProfile"
To retrieve all metadata components listed in a manifest:
$ sfdx force:source:retrieve -x path/to/package.xml
To retrieve metadata from a package or multiple packages:
$ sfdx force:source:retrieve -n MyPackageName
$ sfdx force:source:retrieve -n "Package1, PackageName With Spaces, Package3"
To retrieve all metadata from a package and specific components that aren’t in the package, specify both -n | --packagenames and one other scoping parameter:
$ sfdx force:source:retrieve -n MyPackageName -p path/to/apex/classes
$ sfdx force:source:retrieve -n MyPackageName -m ApexClass:MyApexClass
$ sfdx force:source:retrieve -n MyPackageName -x path/to/package.xml`,
sourcePathParamDescription: 'comma-separated list of source file paths to retrieve',
sourcePathParamLongDescription:
'A comma-separated list of file paths for source to retrieve from the org. ' +
'The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder ' +
'(in which case the operation is applied to all source files in the directory and its sub-directories).',
manifestParamDescription: 'file path for manifest (package.xml) of components to retrieve',
manifestParamLongDescription:
'The complete path for the manifest (package.xml) file that specifies the components to retrieve.' +
'\nIf you specify this parameter, don’t specify --metadata or --sourcepath.',
metadataParamDescription: 'comma-separated list of metadata component names',
metadataParamLongDescription: 'A comma-separated list of names of metadata components to retrieve from the org.',
metadataNotFoundWarning:
'WARNING: The following metadata isn’t in your org. If it’s not new, someone deleted it from the org.',
retrievedSourceHeader: 'Retrieved Source',
SourceRetrieveError: 'Could not retrieve files in the sourcepath%s',
NoResultsFound: 'No results found'
};