1 | module.exports = {
|
2 | description: 'retrieve source from an org',
|
3 | longDescription: 'Retrieves metadata in source format from an org to your local Salesforce DX project.',
|
4 | help: `Use this command to retrieve source (metadata that’s in source format) from an org.
|
5 | To take advantage of change tracking with scratch orgs, use "sfdx force:source:pull".
|
6 | To retrieve metadata that’s in metadata format, use "sfdx force:mdapi:retrieve".
|
7 |
|
8 | 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.
|
9 |
|
10 | If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes.
|
11 |
|
12 | Examples:
|
13 |
|
14 | To retrieve the source files in a directory:
|
15 | $ sfdx force:source:retrieve -p path/to/source
|
16 | To retrieve a specific Apex class and the objects whose source is in a directory:
|
17 | $ sfdx force:source:retrieve -p path/to/apex/classes/MyClass.cls,path/to/source/objects
|
18 | To retrieve source files in a comma-separated list that contains spaces:
|
19 | $ sfdx force:source:retrieve -p "path/to/objects/MyCustomObject/fields/MyField.field-meta.xml, path/to/apex/classes"
|
20 |
|
21 | To retrieve all Apex classes:
|
22 | $ sfdx force:source:retrieve -m ApexClass
|
23 | To retrieve a specific Apex class:
|
24 | $ sfdx force:source:retrieve -m ApexClass:MyApexClass
|
25 | To retrieve all custom objects and Apex classes:
|
26 | $ sfdx force:source:retrieve -m CustomObject,ApexClass
|
27 | To retrieve all Apex classes and two specific profiles (one of which has a space in its name):
|
28 | $ sfdx force:source:retrieve -m "ApexClass, Profile:My Profile, Profile: AnotherProfile"
|
29 |
|
30 | To retrieve all metadata components listed in a manifest:
|
31 | $ sfdx force:source:retrieve -x path/to/package.xml
|
32 |
|
33 | To retrieve metadata from a package or multiple packages:
|
34 | $ sfdx force:source:retrieve -n MyPackageName
|
35 | $ sfdx force:source:retrieve -n "Package1, PackageName With Spaces, Package3"
|
36 |
|
37 | 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:
|
38 | $ sfdx force:source:retrieve -n MyPackageName -p path/to/apex/classes
|
39 | $ sfdx force:source:retrieve -n MyPackageName -m ApexClass:MyApexClass
|
40 | $ sfdx force:source:retrieve -n MyPackageName -x path/to/package.xml`,
|
41 | sourcePathParamDescription: 'comma-separated list of source file paths to retrieve',
|
42 | sourcePathParamLongDescription: 'A comma-separated list of file paths for source to retrieve from the org. ' +
|
43 | 'The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder ' +
|
44 | '(in which case the operation is applied to all source files in the directory and its sub-directories).',
|
45 | manifestParamDescription: 'file path for manifest (package.xml) of components to retrieve',
|
46 | manifestParamLongDescription: 'The complete path for the manifest (package.xml) file that specifies the components to retrieve.' +
|
47 | '\nIf you specify this parameter, don’t specify --metadata or --sourcepath.',
|
48 | metadataParamDescription: 'comma-separated list of metadata component names',
|
49 | metadataParamLongDescription: 'A comma-separated list of names of metadata components to retrieve from the org.',
|
50 | metadataNotFoundWarning: 'WARNING: The following metadata isn’t in your org. If it’s not new, someone deleted it from the org.',
|
51 | retrievedSourceHeader: 'Retrieved Source',
|
52 | SourceRetrieveError: 'Could not retrieve files in the sourcepath%s',
|
53 | NoResultsFound: 'No results found'
|
54 | };
|