UNPKG

3.71 kBJavaScriptView Raw
1module.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.
5To take advantage of change tracking with scratch orgs, use "sfdx force:source:pull".
6To retrieve metadata that’s in metadata format, use "sfdx force:mdapi:retrieve".
7
8The 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
10If 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.
11
12Examples:
13
14To retrieve the source files in a directory:
15 $ sfdx force:source:retrieve -p path/to/source
16To 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"
18To 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
21To retrieve all Apex classes:
22 $ sfdx force:source:retrieve -m ApexClass
23To retrieve a specific Apex class:
24 $ sfdx force:source:retrieve -m ApexClass:MyApexClass
25To retrieve all custom objects and Apex classes:
26 $ sfdx force:source:retrieve -m "CustomObject,ApexClass"
27To 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
30To retrieve all metadata components listed in a manifest:
31 $ sfdx force:source:retrieve -x path/to/package.xml
32
33To 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
37To 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:
43 'A comma-separated list of file paths for source to retrieve from the org. ' +
44 'The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder ' +
45 '(in which case the operation is applied to all source files in the directory and its sub-directories).',
46 manifestParamDescription: 'file path for manifest (package.xml) of components to retrieve',
47 manifestParamLongDescription:
48 'The complete path for the manifest (package.xml) file that specifies the components to retrieve.' +
49 '\nIf you specify this parameter, don’t specify --metadata or --sourcepath.',
50 metadataParamDescription: 'comma-separated list of metadata component names',
51 metadataParamLongDescription: 'A comma-separated list of names of metadata components to retrieve from the org.',
52 metadataNotFoundWarning:
53 'WARNING: The following metadata isn’t in your org. If it’s not new, someone deleted it from the org.',
54 retrievedSourceHeader: 'Retrieved Source',
55 SourceRetrieveError: 'Could not retrieve files in the sourcepath%s',
56 NoResultsFound: 'No results found'
57};