@salesforce/plugin-deploy-retrieve 3.2.35 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,1516 +62,8 @@ sf plugins
62
62
 
63
63
  <!-- commands -->
64
64
 
65
- - [`sf project convert mdapi`](#sf-project-convert-mdapi)
66
- - [`sf project convert source`](#sf-project-convert-source)
67
- - [`sf project delete source`](#sf-project-delete-source)
68
- - [`sf project delete tracking`](#sf-project-delete-tracking)
69
- - [`sf project deploy cancel`](#sf-project-deploy-cancel)
70
- - [`sf project deploy preview`](#sf-project-deploy-preview)
71
- - [`sf project deploy quick`](#sf-project-deploy-quick)
72
- - [`sf project deploy report`](#sf-project-deploy-report)
73
- - [`sf project deploy resume`](#sf-project-deploy-resume)
74
- - [`sf project deploy start`](#sf-project-deploy-start)
75
- - [`sf project deploy validate`](#sf-project-deploy-validate)
76
- - [`sf project generate manifest`](#sf-project-generate-manifest)
77
- - [`sf project list ignored`](#sf-project-list-ignored)
78
- - [`sf project reset tracking`](#sf-project-reset-tracking)
79
- - [`sf project retrieve preview`](#sf-project-retrieve-preview)
80
- - [`sf project retrieve start`](#sf-project-retrieve-start)
65
+ # Command Topics
81
66
 
82
- ## `sf project convert mdapi`
83
-
84
- Convert metadata retrieved via Metadata API into the source format used in Salesforce DX projects.
85
-
86
- ```
87
- USAGE
88
- $ sf project convert mdapi -r <value> [--json] [--api-version <value>] [-d <value>] [-p <value> | -x <value> | -m
89
- <value>]
90
-
91
- FLAGS
92
- -d, --output-dir=<value> Directory to store your files in after they’re converted to source format; can be an
93
- absolute or relative path.
94
- -m, --metadata=<value>... Metadata component names to convert.
95
- -p, --metadata-dir=<value>... Root of directory or zip file of metadata formatted files to convert.
96
- -r, --root-dir=<value> (required) Root directory that contains the Metadata API–formatted metadata.
97
- -x, --manifest=<value> File path to manifest (package.xml) of metadata types to convert.
98
- --api-version=<value> Override the api version used for api requests made by this command
99
-
100
- GLOBAL FLAGS
101
- --json Format output as json.
102
-
103
- DESCRIPTION
104
- Convert metadata retrieved via Metadata API into the source format used in Salesforce DX projects.
105
-
106
- To use Salesforce CLI to work with components that you retrieved via Metadata API, first convert your files from the
107
- metadata format to the source format using this command.
108
-
109
- To convert files from the source format back to the metadata format, run "sf project convert source".
110
-
111
- To convert multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
112
- multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
113
- applies to --manifest and --source-dir.
114
-
115
- ALIASES
116
- $ sf force mdapi convert
117
-
118
- EXAMPLES
119
- Convert metadata formatted files in the specified directory into source formatted files; writes converted files to
120
- your default package directory:
121
-
122
- $ sf project convert mdapi --root-dir path/to/metadata
123
-
124
- Similar to previous example, but writes converted files to the specified output directory:
125
-
126
- $ sf project convert mdapi --root-dir path/to/metadata --output-dir path/to/outputdir
127
-
128
- FLAG DESCRIPTIONS
129
- -p, --metadata-dir=<value>... Root of directory or zip file of metadata formatted files to convert.
130
-
131
- The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder
132
- (in which case the operation is applied to all metadata types in the directory and its sub-directories).
133
-
134
- If you specify this flag, don’t specify --manifest or --metadata. If the comma-separated list you’re supplying
135
- contains spaces, enclose the entire comma-separated list in one set of double quotes.
136
-
137
- -x, --manifest=<value> File path to manifest (package.xml) of metadata types to convert.
138
-
139
- If you specify this parameter, don’t specify --metadata or --source-dir.
140
- ```
141
-
142
- _See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/convert/mdapi.ts)_
143
-
144
- ## `sf project convert source`
145
-
146
- Convert source-formatted files into metadata that you can deploy using Metadata API.
147
-
148
- ```
149
- USAGE
150
- $ sf project convert source [--json] [--api-version <value>] [-r <value>] [-d <value>] [-n <value>] [-p <value> | -x
151
- <value> | -m <value>]
152
-
153
- FLAGS
154
- -d, --output-dir=<value> [default: metadataPackage_1710885594477] Output directory to store the Metadata
155
- API–formatted files in.
156
- -m, --metadata=<value>... Metadata component names to convert.
157
- -n, --package-name=<value> Name of the package to associate with the metadata-formatted files.
158
- -p, --source-dir=<value>... Paths to the local source files to convert.
159
- -r, --root-dir=<value> Source directory other than the default package to convert.
160
- -x, --manifest=<value> Path to the manifest (package.xml) file that specifies the metadata types to convert.
161
- --api-version=<value> API Version to use in the generated project's manifest. By default, will use the version
162
- from sfdx-project.json
163
-
164
- GLOBAL FLAGS
165
- --json Format output as json.
166
-
167
- DESCRIPTION
168
- Convert source-formatted files into metadata that you can deploy using Metadata API.
169
-
170
- To convert source-formatted files into the metadata format, so that you can deploy them using Metadata API, run this
171
- command. Then deploy the metadata using "sf project deploy".
172
-
173
- To convert Metadata API–formatted files into the source format, run "sf project convert mdapi".
174
-
175
- To specify a package name that includes spaces, enclose the name in single quotes.
176
-
177
- To convert multiple components, either set multiple --metadata <name> flags or a single --metadata flag with multiple
178
- names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax applies to
179
- --manifest and --source-dir.
180
-
181
- ALIASES
182
- $ sf force source convert
183
-
184
- EXAMPLES
185
- Convert source-formatted files in the specified directory into metadata-formatted files; writes converted files into
186
- a new directory:
187
-
188
- $ sf project convert source --root-dir path/to/source
189
-
190
- Similar to previous example, but writes converted files to the specified output directory and associates the files
191
- with the specified package:
192
-
193
- $ sf project convert source --root-dir path/to/source --output-dir path/to/outputdir --package-name 'My Package'
194
-
195
- FLAG DESCRIPTIONS
196
- -p, --source-dir=<value>... Paths to the local source files to convert.
197
-
198
- The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder
199
- (in which case the operation is applied to all metadata types in the directory and its sub-directories).
200
-
201
- If you specify this parameter, don’t specify --manifest or --metadata.
202
-
203
- -x, --manifest=<value> Path to the manifest (package.xml) file that specifies the metadata types to convert.
204
-
205
- If you specify this parameter, don’t specify --metadata or --source-dir.
206
-
207
- --api-version=<value>
208
-
209
- API Version to use in the generated project's manifest. By default, will use the version from sfdx-project.json
210
-
211
- Override the api version used for api requests made by this command
212
- ```
213
-
214
- _See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/convert/source.ts)_
215
-
216
- ## `sf project delete source`
217
-
218
- Delete source from your project and from a non-source-tracked org.
219
-
220
- ```
221
- USAGE
222
- $ sf project delete source -o <value> [--json] [--api-version <value>] [-w <value>] [--tests <value>] [-l
223
- NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg] [-r] [-m <value>] [-p <value>] [-f [-t | -c]]
224
- [--verbose]
225
-
226
- FLAGS
227
- -c, --check-only Validate delete command but don't delete anything from the org or the local project.
228
- -f, --force-overwrite Ignore conflict warnings and overwrite changes to the org.
229
- -m, --metadata=<value>... Metadata components to delete.
230
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
231
- configuration variable is already set.
232
- -p, --source-dir=<value>... Source file paths to delete.
233
- -r, --no-prompt Don't prompt for delete confirmation.
234
- -t, --track-source If the delete succeeds, update the source tracking information.
235
- -w, --wait=<value> [default: 33 minutes] Number of minutes to wait for the command to finish.
236
- --api-version=<value> Override the api version used for api requests made by this command
237
- --verbose Verbose output of the delete result.
238
-
239
- TEST FLAGS
240
- -l, --test-level=<option> Deployment Apex testing level.
241
- <options: NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg>
242
- --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
243
-
244
- GLOBAL FLAGS
245
- --json Format output as json.
246
-
247
- DESCRIPTION
248
- Delete source from your project and from a non-source-tracked org.
249
-
250
- Use this command to delete components from orgs that don’t have source tracking. To remove deleted items from orgs
251
- that have source tracking enabled, "sf project deploy start".
252
-
253
- When you run this command, both the local source file and the metadata component in the org are deleted.
254
-
255
- To delete multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
256
- multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
257
- applies to --manifest and --source-dir.
258
-
259
- ALIASES
260
- $ sf force source delete
261
-
262
- EXAMPLES
263
- Delete all local Apex source files and all Apex classes from the org with alias "my-scratch":
264
-
265
- $ sf project delete source --metadata ApexClass --target-org my-scratch
266
-
267
- Delete a specific Apex class and a Profile that has a space in it from your default org; don't prompt for
268
- confirmation:
269
-
270
- $ sf project delete source --metadata ApexClass:MyFabulousApexClass --metadata "Profile: My Profile" --no-prompt
271
-
272
- Run the tests that aren’t in any managed packages as part of the deletion; if the delete succeeds, and the org has
273
- source-tracking enabled, update the source tracking information:
274
-
275
- $ sf project delete source --metadata ApexClass --test-level RunLocalTests --track-source
276
-
277
- Delete the Apex source files in a directory and the corresponding components from your default org:
278
-
279
- $ sf project delete source --source-dir force-app/main/default/classes
280
-
281
- FLAG DESCRIPTIONS
282
- -c, --check-only Validate delete command but don't delete anything from the org or the local project.
283
-
284
- IMPORTANT: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained
285
- certain terms to avoid any effect on customer implementations.
286
-
287
- Validates the deleted metadata and runs all Apex tests, but prevents the deletion from being saved to the org.
288
-
289
- If you change a field type from Master-Detail to Lookup or vice versa, that change isn’t supported when using the
290
- --chec-konly parameter to test a deletion (validation). This kind of change isn’t supported for test deletions to
291
- avoid the risk of data loss or corruption. If a change that isn’t supported for test deletions is included in a
292
- deletion package, the test deletion fails and issues an error.
293
-
294
- If your deletion package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the
295
- changes prior to deploying to Production by performing a full deletion to another test Sandbox. A full deletion
296
- includes a validation of the changes as part of the deletion process.
297
-
298
- Note: A Metadata API deletion that includes Master-Detail relationships deletes all detail records in the Recycle
299
- Bin in the following cases.
300
-
301
- 1. For a deletion with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before
302
- proceeding to delete the Master-Detail field, or the deletion fails. During the deletion, detail records are
303
- permanently deleted from the Recycle Bin and cannot be recovered.
304
-
305
- 2. For a deletion that converts a Lookup field relationship to a Master-Detail relationship, detail records must
306
- reference a master record or be soft-deleted (sent to the Recycle Bin) for the deletion to succeed. However, a
307
- successful deletion permanently deletes any detail records in the Recycle Bin.
308
-
309
- -l, --test-level=NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg Deployment Apex testing level.
310
-
311
- Valid values are:
312
-
313
- - NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as
314
- sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.
315
-
316
- - RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ
317
- from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75%
318
- code coverage for each class and trigger in the deployment package. This coverage is computed for each class and
319
- trigger individually and is different than the overall coverage percentage.
320
-
321
- - RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
322
- packages. This test level is the default for production deployments that include Apex classes or triggers.
323
-
324
- - RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
325
-
326
- If you don’t specify a test level, the default behavior depends on the contents of your deployment package and
327
- target org. For more information, see “Running Tests in a Deployment” in the Metadata API Developer Guide.
328
-
329
- -m, --metadata=<value>... Metadata components to delete.
330
-
331
- If you specify this parameter, don’t specify --source-dir.
332
-
333
- -p, --source-dir=<value>... Source file paths to delete.
334
-
335
- The supplied paths can be a single file (in which case the operation is applied to only one file) or a folder (in
336
- which case the operation is applied to all metadata types in the directory and its sub-directories).
337
-
338
- If you specify this parameter, don’t specify --metadata.
339
-
340
- -w, --wait=<value> Number of minutes to wait for the command to finish.
341
-
342
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
343
-
344
- --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
345
-
346
- If a test name contains a space, enclose it in double quotes.
347
- For multiple test names, use one of the following formats:
348
-
349
- - Repeat the flag for multiple test names: --tests Test1 --tests Test2 --tests "Test With Space"
350
- - Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
351
- ```
352
-
353
- _See code: [src/commands/project/delete/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/delete/source.ts)_
354
-
355
- ## `sf project delete tracking`
356
-
357
- Delete all local source tracking information.
358
-
359
- ```
360
- USAGE
361
- $ sf project delete tracking -o <value> [--json] [--api-version <value>] [-p]
362
-
363
- FLAGS
364
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
365
- configuration variable is already set.
366
- -p, --no-prompt Don't prompt for source tracking override confirmation.
367
- --api-version=<value> Override the api version used for api requests made by this command
368
-
369
- GLOBAL FLAGS
370
- --json Format output as json.
371
-
372
- DESCRIPTION
373
- Delete all local source tracking information.
374
-
375
- WARNING: This command deletes or overwrites all existing source tracking files. Use with extreme caution.
376
-
377
- Deletes all local source tracking information. When you next run 'project deploy preview', Salesforce CLI displays all
378
- local and remote files as changed, and any files with the same name are listed as conflicts.
379
-
380
- ALIASES
381
- $ sf force source tracking clear
382
-
383
- EXAMPLES
384
- Delete local source tracking for the org with alias "my-scratch":
385
-
386
- $ sf project delete tracking --target-org my-scratch
387
- ```
388
-
389
- _See code: [src/commands/project/delete/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/delete/tracking.ts)_
390
-
391
- ## `sf project deploy cancel`
392
-
393
- Cancel a deploy operation.
394
-
395
- ```
396
- USAGE
397
- $ sf project deploy cancel [--json] [--async | -w <value>] [-i <value>] [-r]
398
-
399
- FLAGS
400
- -i, --job-id=<value> Job ID of the deploy operation you want to cancel.
401
- -r, --use-most-recent Use the job ID of the most recent deploy operation.
402
- -w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
403
- --async Run the command asynchronously.
404
-
405
- GLOBAL FLAGS
406
- --json Format output as json.
407
-
408
- DESCRIPTION
409
- Cancel a deploy operation.
410
-
411
- Use this command to cancel a deploy operation that hasn't yet completed in the org. Deploy operations include standard
412
- deploys, quick deploys, deploy validations, and deploy cancellations.
413
-
414
- Run this command by either passing it a job ID or specifying the --use-most-recent flag to use the job ID of the most
415
- recent deploy operation.
416
-
417
- ALIASES
418
- $ sf deploy metadata cancel
419
-
420
- EXAMPLES
421
- Cancel a deploy operation using a job ID:
422
-
423
- $ sf project deploy cancel --job-id 0Af0x000017yLUFCA2
424
-
425
- Cancel the most recent deploy operation:
426
-
427
- $ sf project deploy cancel --use-most-recent
428
-
429
- FLAG DESCRIPTIONS
430
- -i, --job-id=<value> Job ID of the deploy operation you want to cancel.
431
-
432
- These commands return a job ID if they time out or you specified the --async flag:
433
-
434
- - sf project deploy start
435
- - sf project deploy validate
436
- - sf project deploy quick
437
- - sf project deploy cancel
438
-
439
- The job ID is valid for 10 days from when you started the deploy operation.
440
-
441
- -r, --use-most-recent Use the job ID of the most recent deploy operation.
442
-
443
- For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less.
444
- If your most recent deploy operations was more than 3 days ago, this flag won't find a job ID.
445
-
446
- -w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
447
-
448
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
449
- resume watching the cancellation, run "sf project deploy resume". To check the status of the cancellation, run "sf
450
- project deploy report".
451
-
452
- --async Run the command asynchronously.
453
-
454
- The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To
455
- resume watching the cancellation, run "sf project deploy resume". To check the status of the cancellation, run "sf
456
- project deploy report".
457
- ```
458
-
459
- _See code: [src/commands/project/deploy/cancel.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/deploy/cancel.ts)_
460
-
461
- ## `sf project deploy preview`
462
-
463
- Preview a deployment to see what will deploy to the org, the potential conflicts, and the ignored files.
464
-
465
- ```
466
- USAGE
467
- $ sf project deploy preview -o <value> [--json] [-c] [-x <value> | -d <value> | -m <value>] [--concise]
468
-
469
- FLAGS
470
- -c, --ignore-conflicts Don't display conflicts in preview of the deployment.
471
- -d, --source-dir=<value>... Path to the local source files to preview.
472
- -m, --metadata=<value>... Metadata component names to preview.
473
- -o, --target-org=<value> (required) Login username or alias for the target org.
474
- -x, --manifest=<value> Full file path for manifest (package.xml) of components to preview.
475
- --concise Show only the changes that will be deployed; omits files that are forceignored.
476
-
477
- GLOBAL FLAGS
478
- --json Format output as json.
479
-
480
- DESCRIPTION
481
- Preview a deployment to see what will deploy to the org, the potential conflicts, and the ignored files.
482
-
483
- You must run this command from within a project.
484
-
485
- The command outputs a table that describes what will happen if you run the "sf project deploy start" command. The
486
- table lists the metadata components that will be deployed and deleted. The table also lists the current conflicts
487
- between files in your local project and components in the org. Finally, the table lists the files that won't be
488
- deployed because they're included in your .forceignore file.
489
-
490
- If your org allows source tracking, then this command displays potential conflicts between the org and your local
491
- project. Some orgs, such as production org, never allow source tracking. Source tracking is enabled by default on
492
- scratch and sandbox orgs; you can disable source tracking when you create the orgs by specifying the --no-track-source
493
- flag on the "sf org create scratch|sandbox" commands.
494
-
495
- To preview the deployment of multiple metadata components, either set multiple --metadata <name> flags or a single
496
- --metadata flag with multiple names separated by spaces. Enclose names that contain spaces in one set of double
497
- quotes. The same syntax applies to --manifest and --source-dir.
498
-
499
- ALIASES
500
- $ sf deploy metadata preview
501
-
502
- EXAMPLES
503
- NOTE: The commands to preview a deployment and actually deploy it use similar flags. We provide a few preview examples here, but see the help for "sf project deploy start" for more examples that you can adapt for previewing.
504
-
505
- Preview the deployment of source files in a directory, such as force-app, to your default org:
506
-
507
- $ sf project deploy preview --source-dir force-app
508
-
509
- Preview the deployment of all Apex classes to an org with alias "my-scratch":
510
-
511
- $ sf project deploy preview --metadata ApexClass --target-org my-scratch
512
-
513
- Preview deployment of a specific Apex class:
514
-
515
- $ sf project deploy preview --metadata ApexClass:MyApexClass
516
-
517
- Preview deployment of all components listed in a manifest:
518
-
519
- $ sf project deploy preview --manifest path/to/package.xml
520
-
521
- FLAG DESCRIPTIONS
522
- -c, --ignore-conflicts Don't display conflicts in preview of the deployment.
523
-
524
- This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
525
- production orgs.
526
-
527
- -d, --source-dir=<value>... Path to the local source files to preview.
528
-
529
- The supplied path can be to a single file (in which case the operation is applied to only one file) or to a folder
530
- (in which case the operation is applied to all metadata types in the directory and its subdirectories).
531
-
532
- If you specify this flag, don’t specify --metadata or --manifest.
533
-
534
- -o, --target-org=<value> Login username or alias for the target org.
535
-
536
- Overrides your default org.
537
-
538
- -x, --manifest=<value> Full file path for manifest (package.xml) of components to preview.
539
-
540
- All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
541
- ```
542
-
543
- _See code: [src/commands/project/deploy/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/deploy/preview.ts)_
544
-
545
- ## `sf project deploy quick`
546
-
547
- Quickly deploy a validated deployment to an org.
548
-
549
- ```
550
- USAGE
551
- $ sf project deploy quick [--json] [--async | -w <value>] [--concise | --verbose] [-i <value>] [-o <value>] [-r] [-a
552
- <value>]
553
-
554
- FLAGS
555
- -a, --api-version=<value> Target API version for the deploy.
556
- -i, --job-id=<value> Job ID of the deployment you want to quick deploy.
557
- -o, --target-org=<value> Login username or alias for the target org.
558
- -r, --use-most-recent Use the job ID of the most recently validated deployment.
559
- -w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for the command to complete and display
560
- results.
561
- --async Run the command asynchronously.
562
- --concise Show concise output of the deploy result.
563
- --verbose Show verbose output of the deploy result.
564
-
565
- GLOBAL FLAGS
566
- --json Format output as json.
567
-
568
- DESCRIPTION
569
- Quickly deploy a validated deployment to an org.
570
-
571
- Before you run this command, first create a validated deployment with the "sf project deploy validate" command, which
572
- returns a job ID. Validated deployments haven't been deployed to the org yet; you deploy them with this command.
573
- Either pass the job ID to this command or use the --use-most-recent flag to use the job ID of the most recently
574
- validated deployment. For the quick deploy to succeed, the associated validated deployment must also have succeeded.
575
-
576
- Executing this quick deploy command takes less time than a standard deploy because it skips running Apex tests. These
577
- tests were previously run as part of the validation. Validating first and then running a quick deploy is useful if the
578
- deployment to your production org take several hours and you don’t want to risk a failed deploy.
579
-
580
- This command doesn't support source-tracking. The source you deploy overwrites the corresponding metadata in your org.
581
- This command doesn’t attempt to merge your source with the versions in your org.
582
-
583
- Note: Don't use this command on sandboxes; the command is intended to be used on production orgs. By default,
584
- sandboxes don't run tests during a deploy. Use `sf project deploy start` instead.
585
-
586
- ALIASES
587
- $ sf deploy metadata quick
588
-
589
- EXAMPLES
590
- Run a quick deploy to your default org using a job ID:
591
-
592
- $ sf project deploy quick --job-id 0Af0x000017yLUFCA2
593
-
594
- Asynchronously run a quick deploy of the most recently validated deployment to an org with alias "my-prod-org":
595
-
596
- $ sf project deploy quick --async --use-most-recent --target-org my-prod-org
597
-
598
- FLAG DESCRIPTIONS
599
- -a, --api-version=<value> Target API version for the deploy.
600
-
601
- Use this flag to override the default API version with the API version of your package.xml file. The default API
602
- version is the latest version supported by the CLI.
603
-
604
- -i, --job-id=<value> Job ID of the deployment you want to quick deploy.
605
-
606
- The job ID is valid for 10 days from when you started the validation.
607
-
608
- -o, --target-org=<value> Login username or alias for the target org.
609
-
610
- Overrides your default org.
611
-
612
- -r, --use-most-recent Use the job ID of the most recently validated deployment.
613
-
614
- For performance reasons, this flag uses only job IDs that were validated in the past 3 days or less. If your most
615
- recent deployment validation was more than 3 days ago, this flag won't find a job ID.
616
-
617
- -w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
618
-
619
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
620
- resume watching the deploy, run "sf project deploy resume". To check the status of the deploy, run "sf project
621
- deploy report".
622
-
623
- --async Run the command asynchronously.
624
-
625
- The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To
626
- resume watching the deploy, run "sf project deploy resume". To check the status of the deploy, run "sf project
627
- deploy report".
628
- ```
629
-
630
- _See code: [src/commands/project/deploy/quick.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/deploy/quick.ts)_
631
-
632
- ## `sf project deploy report`
633
-
634
- Check or poll for the status of a deploy operation.
635
-
636
- ```
637
- USAGE
638
- $ sf project deploy report [--json] [-o <value>] [-i <value>] [-r] [--coverage-formatters
639
- clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
640
- <value>] [-w <value>]
641
-
642
- FLAGS
643
- -i, --job-id=<value> Job ID of the deploy operation you want to check the status of.
644
- -o, --target-org=<value> Login username or alias for the target org.
645
- -r, --use-most-recent Use the job ID of the most recent deploy operation.
646
- -w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
647
-
648
- TEST FLAGS
649
- --coverage-formatters=<option>... Format of the code coverage results.
650
- <options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|t
651
- ext|text-summary>
652
- --junit Output JUnit test results.
653
- --results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy ID.
654
-
655
- GLOBAL FLAGS
656
- --json Format output as json.
657
-
658
- DESCRIPTION
659
- Check or poll for the status of a deploy operation.
660
-
661
- Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations.
662
-
663
- Run this command by either passing it a job ID or specifying the --use-most-recent flag to use the job ID of the most
664
- recent deploy operation. If you specify the --wait flag, the command polls for the status every second until the
665
- timeout of --wait minutes. If you don't specify the --wait flag, the command simply checks and displays the status of
666
- the deploy; the command doesn't poll for the status.
667
-
668
- You typically don't specify the --target-org flag because the cached job already references the org to which you
669
- deployed. But if you run this command on a computer different than the one from which you deployed, then you must
670
- specify the --target-org and it must point to the same org.
671
-
672
- This command doesn't update source tracking information.
673
-
674
- ALIASES
675
- $ sf deploy metadata report
676
-
677
- EXAMPLES
678
- Check the status using a job ID:
679
-
680
- $ sf project deploy report --job-id 0Af0x000017yLUFCA2
681
-
682
- Check the status of the most recent deploy operation:
683
-
684
- $ sf project deploy report --use-most-recent
685
-
686
- Poll for the status using a job ID and target org:
687
-
688
- $ sf project deploy report --job-id 0Af0x000017yLUFCA2 --target-org me@my.org --wait 30
689
-
690
- FLAG DESCRIPTIONS
691
- -i, --job-id=<value> Job ID of the deploy operation you want to check the status of.
692
-
693
- These commands return a job ID if they time out or you specified the --async flag:
694
-
695
- - sf project deploy start
696
- - sf project deploy validate
697
- - sf project deploy quick
698
- - sf project deploy cancel
699
-
700
- The job ID is valid for 10 days from when you started the deploy operation.
701
-
702
- -o, --target-org=<value> Login username or alias for the target org.
703
-
704
- Overrides your default org.
705
-
706
- -r, --use-most-recent Use the job ID of the most recent deploy operation.
707
-
708
- For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less.
709
- If your most recent operation was more than 3 days ago, this flag won't find a job ID.
710
-
711
- -w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
712
-
713
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
714
- returns the job ID. To resume the deployment, run "sf project deploy resume". To check the status of the deployment,
715
- run "sf project deploy report".
716
-
717
- --coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
718
-
719
- Format of the code coverage results.
720
-
721
- For multiple formatters, repeat the flag for each formatter.
722
- --coverage-formatters lcov --coverage-formatters clover
723
- ```
724
-
725
- _See code: [src/commands/project/deploy/report.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/deploy/report.ts)_
726
-
727
- ## `sf project deploy resume`
728
-
729
- Resume watching a deploy operation and update source tracking when the deploy completes.
730
-
731
- ```
732
- USAGE
733
- $ sf project deploy resume [--json] [--concise | --verbose] [-i <value>] [-r] [-w <value>] [--coverage-formatters
734
- clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
735
- <value>]
736
-
737
- FLAGS
738
- -i, --job-id=<value> Job ID of the deploy operation you want to resume.
739
- -r, --use-most-recent Use the job ID of the most recent deploy operation.
740
- -w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
741
- --concise Show concise output of the deploy operation result.
742
- --verbose Show verbose output of the deploy operation result.
743
-
744
- TEST FLAGS
745
- --coverage-formatters=<option>... Format of the code coverage results.
746
- <options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|t
747
- ext|text-summary>
748
- --junit Output JUnit test results.
749
- --results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy ID.
750
-
751
- GLOBAL FLAGS
752
- --json Format output as json.
753
-
754
- DESCRIPTION
755
- Resume watching a deploy operation and update source tracking when the deploy completes.
756
-
757
- Use this command to resume watching a deploy operation if the original command times out or you specified the --async
758
- flag. Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations. This
759
- command doesn't resume the original operation itself, because the operation always continues after you've started it,
760
- regardless of whether you're watching it or not. When the deploy completes, source tracking information is updated as
761
- needed.
762
-
763
- Run this command by either passing it a job ID or specifying the --use-most-recent flag to use the job ID of the most
764
- recent deploy operation.
765
-
766
- ALIASES
767
- $ sf deploy metadata resume
768
-
769
- EXAMPLES
770
- Resume watching a deploy operation using a job ID:
771
-
772
- $ sf project deploy resume --job-id 0Af0x000017yLUFCA2
773
-
774
- Resume watching the most recent deploy operation:
775
-
776
- $ sf project deploy resume --use-most-recent
777
-
778
- FLAG DESCRIPTIONS
779
- -i, --job-id=<value> Job ID of the deploy operation you want to resume.
780
-
781
- These commands return a job ID if they time out or you specified the --async flag:
782
-
783
- - sf project deploy start
784
- - sf project deploy validate
785
- - sf project deploy quick
786
- - sf project deploy cancel
787
-
788
- The job ID is valid for 10 days from when you started the deploy operation.
789
-
790
- -r, --use-most-recent Use the job ID of the most recent deploy operation.
791
-
792
- For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less.
793
- If your most recent operation was more than 3 days ago, this flag won't find a job ID.
794
-
795
- -w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
796
-
797
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
798
- resume watching the deploy operation, run this command again. To check the status of the deploy operation, run "sf
799
- project deploy report".
800
-
801
- --coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
802
-
803
- Format of the code coverage results.
804
-
805
- For multiple formatters, repeat the flag for each formatter.
806
- --coverage-formatters lcov --coverage-formatters clover
807
- ```
808
-
809
- _See code: [src/commands/project/deploy/resume.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/deploy/resume.ts)_
810
-
811
- ## `sf project deploy start`
812
-
813
- Deploy metadata to an org from your local project.
814
-
815
- ```
816
- USAGE
817
- $ sf project deploy start -o <value> [--json] [-a <value>] [--async | -w <value>] [--concise | --verbose] [--dry-run]
818
- [-c] [-r] [-g] [--single-package ] [-t <value>] [-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg]
819
- [--purge-on-delete [-x <value> | -d <value> | -m <value> | --metadata-dir <value>]] [--pre-destructive-changes
820
- <value> ] [--post-destructive-changes <value> ] [--coverage-formatters
821
- clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
822
- <value>]
823
-
824
- FLAGS
825
- -a, --api-version=<value> Target API version for the deploy.
826
- -c, --ignore-conflicts Ignore conflicts and deploy local files, even if they overwrite changes in the org.
827
- -g, --ignore-warnings Ignore warnings and allow a deployment to complete successfully.
828
- -o, --target-org=<value> (required) Login username or alias for the target org.
829
- -r, --ignore-errors Ignore any errors and don’t roll back deployment.
830
- -w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for command to complete and display
831
- results.
832
- --async Run the command asynchronously.
833
- --concise Show concise output of the deploy result.
834
- --dry-run Validate deploy and run Apex tests but don’t save to the org.
835
- --verbose Show verbose output of the deploy result.
836
-
837
- SOURCE FORMAT FLAGS
838
- -d, --source-dir=<value>... Path to the local source files to deploy.
839
- -m, --metadata=<value>... Metadata component names to deploy. Wildcards (`*` ) supported as long as you use quotes,
840
- such as `ApexClass:MyClass*`.
841
- -x, --manifest=<value> Full file path for manifest (package.xml) of components to deploy.
842
-
843
- TEST FLAGS
844
- -l, --test-level=<option> Deployment Apex testing level.
845
- <options: NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg>
846
- -t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
847
- --coverage-formatters=<option>... Format of the code coverage results.
848
- <options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamci
849
- ty|text|text-summary>
850
- --junit Output JUnit test results.
851
- --results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy
852
- ID.
853
-
854
- GLOBAL FLAGS
855
- --json Format output as json.
856
-
857
- METADATA API FORMAT FLAGS
858
- --metadata-dir=<value> Root of directory or zip file of metadata formatted files to deploy.
859
- --single-package Indicates that the metadata zip file points to a directory structure for a single package.
860
-
861
- DELETE FLAGS
862
- --post-destructive-changes=<value> File path for a manifest (destructiveChangesPost.xml) of components to delete
863
- after the deploy.
864
- --pre-destructive-changes=<value> File path for a manifest (destructiveChangesPre.xml) of components to delete
865
- before the deploy.
866
- --purge-on-delete Specify that deleted components in the destructive changes manifest file are
867
- immediately eligible for deletion rather than being stored in the Recycle Bin.
868
-
869
- DESCRIPTION
870
- Deploy metadata to an org from your local project.
871
-
872
- You must run this command from within a project.
873
-
874
- Metadata components are deployed in source format by default. Deploy them in metadata format by specifying the
875
- --metadata-dir flag, which specifies the root directory or ZIP file that contains the metadata formatted files you
876
- want to deploy.
877
-
878
- If your org allows source tracking, then this command tracks the changes in your source. Some orgs, such as production
879
- orgs, never allow source tracking. Source tracking is enabled by default on scratch and sandbox orgs; you can disable
880
- source tracking when you create the orgs by specifying the --no-track-source flag on the "sf org create
881
- scratch|sandbox" commands.
882
-
883
- To deploy multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
884
- multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
885
- applies to --manifest and --source-dir.
886
-
887
- ALIASES
888
- $ sf deploy metadata
889
-
890
- EXAMPLES
891
- Deploy local changes not in the org; uses your default org:
892
-
893
- $ sf project deploy start
894
-
895
- Deploy all source files in the "force-app" directory to an org with alias "my-scratch"; show only concise output, in
896
- other words don't print a list of all the source that was deployed:
897
-
898
- $ sf project deploy start --source-dir force-app --target-org my-scratch --concise
899
-
900
- Deploy all the Apex classes and custom objects that are in the "force-app" directory. The list views, layouts, etc,
901
- that are associated with the custom objects are also deployed. Both examples are equivalent:
902
-
903
- $ sf project deploy start --source-dir force-app/main/default/classes force-app/main/default/objects
904
- $ sf project deploy start --source-dir force-app/main/default/classes --source-dir \
905
- force-app/main/default/objects
906
-
907
- Deploy all Apex classes that are in all package directories defined in the "sfdx-project.json" file:
908
-
909
- $ sf project deploy start --metadata ApexClass
910
-
911
- Deploy a specific Apex class; ignore any conflicts between the local project and org (be careful with this flag,
912
- because it will overwrite the Apex class in the org if there are conflicts!):
913
-
914
- $ sf project deploy start --metadata ApexClass:MyApexClass --ignore-conflicts
915
-
916
- Deploy specific Apex classes that match a pattern; in this example, deploy Apex classes whose names contain the
917
- string "MyApex". Also ignore any deployment warnings (again, be careful with this flag! You typically want to see
918
- the warnings):
919
-
920
- $ sf project deploy start --metadata 'ApexClass:MyApex*' --ignore-warnings
921
-
922
- Deploy all custom objects and Apex classes found in all defined package directories (both examples are equivalent):
923
-
924
- $ sf project deploy start --metadata CustomObject ApexClass
925
- $ sf project deploy start --metadata CustomObject --metadata ApexClass
926
-
927
- Deploy all Apex classes and a profile that has a space in its name:
928
-
929
- $ sf project deploy start --metadata ApexClass --metadata "Profile:My Profile"
930
-
931
- Deploy all components listed in a manifest:
932
-
933
- $ sf project deploy start --manifest path/to/package.xml
934
-
935
- Run the tests that aren’t in any managed packages as part of a deployment:
936
-
937
- $ sf project deploy start --metadata ApexClass --test-level RunLocalTests
938
-
939
- FLAG DESCRIPTIONS
940
- -a, --api-version=<value> Target API version for the deploy.
941
-
942
- Use this flag to override the default API version with the API version of your package.xml file. The default API
943
- version is the latest version supported by the CLI.
944
-
945
- -c, --ignore-conflicts Ignore conflicts and deploy local files, even if they overwrite changes in the org.
946
-
947
- This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
948
- production orgs.
949
-
950
- -d, --source-dir=<value>... Path to the local source files to deploy.
951
-
952
- The supplied path can be to a single file (in which case the operation is applied to only one file) or to a folder
953
- (in which case the operation is applied to all metadata types in the directory and its subdirectories).
954
-
955
- If you specify this flag, don’t specify --metadata or --manifest.
956
-
957
- -g, --ignore-warnings Ignore warnings and allow a deployment to complete successfully.
958
-
959
- If you specify this flag, and a warning occurs, the success status of the deployment is set to true. If you don't
960
- specify this flag, and a warning occurs, then the success status is set to false, and the warning is treated like an
961
- error.
962
-
963
- This flag is useful in a CI environment and your deployment includes destructive changes; if you try to delete a
964
- component that doesn't exist in the org, you get a warning. In this case, to ensure that the command returns a
965
- success value of true, specify this flag.
966
-
967
- -l, --test-level=NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg Deployment Apex testing level.
968
-
969
- Valid values are:
970
-
971
- - NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as
972
- sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.
973
-
974
- - RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ
975
- from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75%
976
- code coverage for each class and trigger in the deployment package. This coverage is computed for each class and
977
- trigger individually and is different than the overall coverage percentage.
978
-
979
- - RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
980
- packages. This test level is the default for production deployments that include Apex classes or triggers.
981
-
982
- - RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
983
-
984
- If you don’t specify a test level, the default behavior depends on the contents of your deployment package and
985
- target org. For more information, see [Running Tests in a
986
- Deployment](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm)
987
- in the "Metadata API Developer Guide".
988
-
989
- -o, --target-org=<value> Login username or alias for the target org.
990
-
991
- Overrides your default org.
992
-
993
- -r, --ignore-errors Ignore any errors and don’t roll back deployment.
994
-
995
- Never use this flag when deploying to a production org. If you specify it, components without errors are deployed
996
- and components with errors are skipped, and could result in an inconsistent production org.
997
-
998
- -t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
999
-
1000
- If a test name contains a space, enclose it in double quotes.
1001
- For multiple test names, use one of the following formats:
1002
-
1003
- - Repeat the flag for multiple test names: --tests Test1 --tests Test2 --tests "Test With Space"
1004
- - Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
1005
-
1006
- -w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
1007
-
1008
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
1009
- returns the job ID. To resume the deployment, run "sf project deploy resume". To check the status of the deployment,
1010
- run "sf project deploy report".
1011
-
1012
- -x, --manifest=<value> Full file path for manifest (package.xml) of components to deploy.
1013
-
1014
- All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
1015
-
1016
- --async Run the command asynchronously.
1017
-
1018
- The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the
1019
- CLI. To resume the deployment, run "sf project deploy resume". To check the status of the deployment, run "sf
1020
- project deploy report".
1021
-
1022
- --coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
1023
-
1024
- Format of the code coverage results.
1025
-
1026
- For multiple formatters, repeat the flag for each formatter.
1027
- --coverage-formatters lcov --coverage-formatters clover
1028
- ```
1029
-
1030
- _See code: [src/commands/project/deploy/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/deploy/start.ts)_
1031
-
1032
- ## `sf project deploy validate`
1033
-
1034
- Validate a metadata deployment without actually executing it.
1035
-
1036
- ```
1037
- USAGE
1038
- $ sf project deploy validate -o <value> [--json] [-a <value>] [--async] [--concise | --verbose] [-m <value>] [-d <value>]
1039
- [--single-package --metadata-dir <value>] [-t <value>] [-l RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests] [-w
1040
- <value>] [-g] [--coverage-formatters
1041
- clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
1042
- <value>] [--purge-on-delete -x <value>] [--pre-destructive-changes <value> ] [--post-destructive-changes <value> ]
1043
-
1044
- FLAGS
1045
- -a, --api-version=<value> Target API version for the validation.
1046
- -g, --ignore-warnings Ignore warnings and allow a deployment to complete successfully.
1047
- -o, --target-org=<value> (required) Login username or alias for the target org.
1048
- -w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for the command to complete and display
1049
- results.
1050
- --async Run the command asynchronously.
1051
- --concise Show concise output of the validation result.
1052
- --verbose Show verbose output of the validation result.
1053
-
1054
- SOURCE FORMAT FLAGS
1055
- -d, --source-dir=<value>... Path to the local source files to validate for deployment.
1056
- -m, --metadata=<value>... Metadata component names to validate for deployment.
1057
- -x, --manifest=<value> Full file path for manifest (package.xml) of components to validate for deployment.
1058
-
1059
- TEST FLAGS
1060
- -l, --test-level=<option> [default: RunLocalTests] Deployment Apex testing level.
1061
- <options: RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests>
1062
- -t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
1063
- --coverage-formatters=<option>... Format of the code coverage results.
1064
- <options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamci
1065
- ty|text|text-summary>
1066
- --junit Output JUnit test results.
1067
- --results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy
1068
- ID.
1069
-
1070
- GLOBAL FLAGS
1071
- --json Format output as json.
1072
-
1073
- METADATA API FORMAT FLAGS
1074
- --metadata-dir=<value> Root of directory or zip file of metadata formatted files to deploy.
1075
- --single-package Indicates that the metadata zip file points to a directory structure for a single package.
1076
-
1077
- DELETE FLAGS
1078
- --post-destructive-changes=<value> File path for a manifest (destructiveChangesPost.xml) of components to delete
1079
- after the deploy.
1080
- --pre-destructive-changes=<value> File path for a manifest (destructiveChangesPre.xml) of components to delete
1081
- before the deploy
1082
- --purge-on-delete Specify that deleted components in the destructive changes manifest file are
1083
- immediately eligible for deletion rather than being stored in the Recycle Bin.
1084
-
1085
- DESCRIPTION
1086
- Validate a metadata deployment without actually executing it.
1087
-
1088
- Use this command to verify whether a deployment will succeed without actually deploying the metadata to your org. This
1089
- command is similar to "sf project deploy start", except you're required to run Apex tests, and the command returns a
1090
- job ID rather than executing the deployment. If the validation succeeds, then you pass this job ID to the "sf project
1091
- deploy quick" command to actually deploy the metadata. This quick deploy takes less time because it skips running Apex
1092
- tests. The job ID is valid for 10 days from when you started the validation. Validating first is useful if the
1093
- deployment to your production org take several hours and you don’t want to risk a failed deploy.
1094
-
1095
- You must run this command from within a project.
1096
-
1097
- This command doesn't support source-tracking. When you quick deploy with the resulting job ID, the source you deploy
1098
- overwrites the corresponding metadata in your org.
1099
-
1100
- To validate the deployment of multiple metadata components, either set multiple --metadata <name> flags or a single
1101
- --metadata flag with multiple names separated by spaces. Enclose names that contain spaces in one set of double
1102
- quotes. The same syntax applies to --manifest and --source-dir.
1103
-
1104
- Note: Don't use this command on sandboxes; the command is intended to be used on production orgs. By default,
1105
- sandboxes don't run tests during a deploy. If you want to validate a deployment with tests on a sandbox, use "sf
1106
- project deploy start --dry-run --test-level RunLocalTests" instead.
1107
-
1108
- ALIASES
1109
- $ sf deploy metadata validate
1110
-
1111
- EXAMPLES
1112
- NOTE: These examples focus on validating large deployments. See the help for "sf project deploy start" for examples of deploying smaller sets of metadata which you can also use to validate.
1113
-
1114
- Validate the deployment of all source files in the "force-app" directory to the default org:
1115
-
1116
- $ sf project deploy validate --source-dir force-app
1117
-
1118
- Validate the deployment of all source files in two directories: "force-app" and "force-app-utils":
1119
-
1120
- $ sf project deploy validate --source-dir force-app --source-dir force-app-utils
1121
-
1122
- Asynchronously validate the deployment and run all tests in the org with alias "my-prod-org"; command immediately
1123
- returns the job ID:
1124
-
1125
- $ sf project deploy validate --source-dir force-app --async --test-level RunAllTestsInOrg --target-org \
1126
- my-prod-org
1127
-
1128
- Validate the deployment of all components listed in a manifest:
1129
-
1130
- $ sf project deploy validate --manifest path/to/package.xml
1131
-
1132
- FLAG DESCRIPTIONS
1133
- -a, --api-version=<value> Target API version for the validation.
1134
-
1135
- Use this flag to override the default API version with the API version of your package.xml file. The default API
1136
- version is the latest version supported by the CLI.
1137
-
1138
- -d, --source-dir=<value>... Path to the local source files to validate for deployment.
1139
-
1140
- The supplied path can be to a single file (in which case the operation is applied to only one file) or to a folder
1141
- (in which case the operation is applied to all metadata types in the directory and its subdirectories).
1142
-
1143
- If you specify this flag, don’t specify --metadata or --manifest.
1144
-
1145
- -g, --ignore-warnings Ignore warnings and allow a deployment to complete successfully.
1146
-
1147
- If you specify this flag, and a warning occurs, the success status of the deployment is set to true. If you don't
1148
- specify this flag, and a warning occurs, then the success status is set to false, and the warning is treated like an
1149
- error.
1150
-
1151
- This flag is useful in a CI environment and your deployment includes destructive changes; if you try to delete a
1152
- component that doesn't exist in the org, you get a warning. In this case, to ensure that the command returns a
1153
- success value of true, specify this flag.
1154
-
1155
- -l, --test-level=RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests Deployment Apex testing level.
1156
-
1157
- Valid values are:
1158
-
1159
- - RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ
1160
- from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75%
1161
- code coverage for each class and trigger in the deployment package. This coverage is computed for each class and
1162
- trigger individually and is different than the overall coverage percentage.
1163
-
1164
- - RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
1165
- packages. This test level is the default.
1166
-
1167
- - RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
1168
-
1169
- -o, --target-org=<value> Login username or alias for the target org.
1170
-
1171
- Overrides your default org.
1172
-
1173
- -t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
1174
-
1175
- If a test name contains a space, enclose it in double quotes.
1176
- For multiple test names, use one of the following formats:
1177
-
1178
- - Repeat the flag for multiple test names: --tests Test1 --tests Test2 --tests "Test With Space"
1179
- - Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
1180
-
1181
- -w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
1182
-
1183
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
1184
- returns the job ID. To resume watching the validation, run "sf project deploy resume". To check the status of the
1185
- validation, run "sf project deploy report".
1186
-
1187
- -x, --manifest=<value> Full file path for manifest (package.xml) of components to validate for deployment.
1188
-
1189
- All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
1190
-
1191
- --async Run the command asynchronously.
1192
-
1193
- The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the
1194
- CLI. To resume watching the validation, run "sf project deploy resume". To check the status of the validation, run
1195
- "sf project deploy report".
1196
-
1197
- --coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
1198
-
1199
- Format of the code coverage results.
1200
-
1201
- For multiple formatters, repeat the flag for each formatter.
1202
- --coverage-formatters lcov --coverage-formatters clover
1203
- ```
1204
-
1205
- _See code: [src/commands/project/deploy/validate.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/deploy/validate.ts)_
1206
-
1207
- ## `sf project generate manifest`
1208
-
1209
- Create a project manifest that lists the metadata components you want to deploy or retrieve.
1210
-
1211
- ```
1212
- USAGE
1213
- $ sf project generate manifest [--json] [--api-version <value>] [-m <value>] [-p <value>] [-n <value> | -t
1214
- pre|post|destroy|package] [-c managed|unlocked --from-org <value>] [-d <value>]
1215
-
1216
- FLAGS
1217
- -c, --include-packages=<option>... Package types (managed, unlocked) whose metadata is included in the manifest; by
1218
- default, metadata in packages is ignored.
1219
- <options: managed|unlocked>
1220
- -d, --output-dir=<value> Directory to save the created manifest.
1221
- -m, --metadata=<value>... Names of metadata components to include in the manifest.
1222
- -n, --name=<value> Name of a custom manifest file to create.
1223
- -p, --source-dir=<value>... Paths to the local source files to include in the manifest.
1224
- -t, --type=<option> Type of manifest to create; the type determines the name of the created file.
1225
- <options: pre|post|destroy|package>
1226
- --api-version=<value> Override the api version used for api requests made by this command
1227
- --from-org=<value> Username or alias of the org that contains the metadata components from which to
1228
- build a manifest.
1229
-
1230
- GLOBAL FLAGS
1231
- --json Format output as json.
1232
-
1233
- DESCRIPTION
1234
- Create a project manifest that lists the metadata components you want to deploy or retrieve.
1235
-
1236
- Create a manifest from a list of metadata components (--metadata) or from one or more local directories that contain
1237
- source files (--source-dir). You can specify either of these parameters, not both.
1238
-
1239
- Use --type to specify the type of manifest you want to create. The resulting manifest files have specific names, such
1240
- as the standard package.xml or destructiveChanges.xml to delete metadata. Valid values for this parameter, and their
1241
- respective file names, are:
1242
-
1243
- * package : package.xml (default)
1244
- * pre : destructiveChangesPre.xml
1245
- * post : destructiveChangesPost.xml
1246
- * destroy : destructiveChanges.xml
1247
-
1248
- See https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_deleting_files.htm for
1249
- information about these destructive manifest files.
1250
-
1251
- Use --name to specify a custom name for the generated manifest if the pre-defined ones don’t suit your needs. You can
1252
- specify either --type or --name, but not both.
1253
-
1254
- To include multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
1255
- multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
1256
- applies to --include-packages and --source-dir.
1257
-
1258
- ALIASES
1259
- $ sf force source manifest create
1260
-
1261
- EXAMPLES
1262
- Create a manifest for deploying or retrieving all Apex classes and custom objects:
1263
-
1264
- $ sf project generate manifest --metadata ApexClass --metadata CustomObject
1265
-
1266
- Create a manifest for deleting the specified Apex class:
1267
-
1268
- $ sf project generate manifest --metadata ApexClass:MyApexClass --type destroy
1269
-
1270
- Create a manifest for deploying or retrieving all the metadata components in the specified local directory; name the
1271
- file myNewManifest.xml:
1272
-
1273
- $ sf project generate manifest --source-dir force-app --name myNewManifest
1274
-
1275
- Create a manifest from the metadata components in the specified org and include metadata in any unlocked packages:
1276
-
1277
- $ sf project generate manifest --from-org test@myorg.com --include-packages unlocked
1278
- ```
1279
-
1280
- _See code: [src/commands/project/generate/manifest.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/generate/manifest.ts)_
1281
-
1282
- ## `sf project list ignored`
1283
-
1284
- Check your local project package directories for forceignored files.
1285
-
1286
- ```
1287
- USAGE
1288
- $ sf project list ignored [--json] [-p <value>]
1289
-
1290
- FLAGS
1291
- -p, --source-dir=<value> File or directory of files that the command checks for foreceignored files.
1292
-
1293
- GLOBAL FLAGS
1294
- --json Format output as json.
1295
-
1296
- DESCRIPTION
1297
- Check your local project package directories for forceignored files.
1298
-
1299
- When deploying or retrieving metadata between your local project and an org, you can specify the source files you want
1300
- to exclude with a .forceignore file. The .forceignore file structure mimics the .gitignore structure. Each line in
1301
- .forceignore specifies a pattern that corresponds to one or more files. The files typically represent metadata
1302
- components, but can be any files you want to exclude, such as LWC configuration JSON files or tests.
1303
-
1304
- ALIASES
1305
- $ sf force source ignored list
1306
-
1307
- EXAMPLES
1308
- List all the files in all package directories that are ignored:
1309
-
1310
- $ sf project list ignored
1311
-
1312
- List all the files in a specific directory that are ignored:
1313
-
1314
- $ sf project list ignored --source-dir force-app
1315
-
1316
- Check if a particular file is ignored:
1317
-
1318
- $ sf project list ignored --source-dir package.xml
1319
- ```
1320
-
1321
- _See code: [src/commands/project/list/ignored.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/list/ignored.ts)_
1322
-
1323
- ## `sf project reset tracking`
1324
-
1325
- Reset local and remote source tracking.
1326
-
1327
- ```
1328
- USAGE
1329
- $ sf project reset tracking -o <value> [--json] [--api-version <value>] [-r <value>] [-p]
1330
-
1331
- FLAGS
1332
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
1333
- configuration variable is already set.
1334
- -p, --no-prompt Don't prompt for source tracking override confirmation.
1335
- -r, --revision=<value> SourceMember revision counter number to reset to.
1336
- --api-version=<value> Override the api version used for api requests made by this command
1337
-
1338
- GLOBAL FLAGS
1339
- --json Format output as json.
1340
-
1341
- DESCRIPTION
1342
- Reset local and remote source tracking.
1343
-
1344
- WARNING: This command deletes or overwrites all existing source tracking files. Use with extreme caution.
1345
-
1346
- Resets local and remote source tracking so that Salesforce CLI no longer registers differences between your local
1347
- files and those in the org. When you next run 'project deploy preview', Salesforce CLI returns no results, even though
1348
- conflicts might actually exist. Salesforce CLI then resumes tracking new source changes as usual.
1349
-
1350
- Use the --revision parameter to reset source tracking to a specific revision number of an org source member. To get
1351
- the revision number, query the SourceMember Tooling API object with the 'data soql' command. For example:
1352
-
1353
- sf data query --query "SELECT MemberName, MemberType, RevisionCounter FROM SourceMember" --use-tooling-api
1354
- --target-org my-scratch
1355
-
1356
- ALIASES
1357
- $ sf force source tracking reset
1358
-
1359
- EXAMPLES
1360
- Reset source tracking for the org with alias "my-scratch":
1361
-
1362
- $ sf project reset tracking --target-org my-scratch
1363
-
1364
- Reset source tracking to revision number 30 for your default org:
1365
-
1366
- $ sf project reset tracking --revision 30
1367
- ```
1368
-
1369
- _See code: [src/commands/project/reset/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/reset/tracking.ts)_
1370
-
1371
- ## `sf project retrieve preview`
1372
-
1373
- Preview a retrieval to see what will be retrieved from the org, the potential conflicts, and the ignored files.
1374
-
1375
- ```
1376
- USAGE
1377
- $ sf project retrieve preview -o <value> [--json] [-c] [--concise]
1378
-
1379
- FLAGS
1380
- -c, --ignore-conflicts Don't display conflicts in the preview of the retrieval.
1381
- -o, --target-org=<value> (required) Login username or alias for the target org.
1382
- --concise Show only the changes that will be retrieved; omits files that are forceignored.
1383
-
1384
- GLOBAL FLAGS
1385
- --json Format output as json.
1386
-
1387
- DESCRIPTION
1388
- Preview a retrieval to see what will be retrieved from the org, the potential conflicts, and the ignored files.
1389
-
1390
- You must run this command from within a project.
1391
-
1392
- The command outputs a table that describes what will happen if you run the "sf project retrieve start" command. The
1393
- table lists the metadata components that will be retrieved and deleted. The table also lists the current conflicts
1394
- between files in your local project and components in the org. Finally, the table lists the files that won't be
1395
- retrieved because they're included in your .forceignore file.
1396
-
1397
- If your org allows source tracking, then this command displays potential conflicts between the org and your local
1398
- project. Some orgs, such as production org, never allow source tracking. Source tracking is enabled by default on
1399
- scratch and sandbox orgs; you can disable source tracking when you create the orgs by specifying the --no-track-source
1400
- flag on the "sf org create scratch|sandbox" commands.
1401
-
1402
- ALIASES
1403
- $ sf retrieve metadata preview
1404
-
1405
- EXAMPLES
1406
- Preview the retrieve of all changes from your default org:
1407
-
1408
- $ sf project retrieve preview
1409
-
1410
- Preview the retrieve when ignoring any conflicts from an org with alias "my-scratch":
1411
-
1412
- $ sf project retrieve preview --ignore-conflicts --target-org my-scratch
1413
-
1414
- FLAG DESCRIPTIONS
1415
- -c, --ignore-conflicts Don't display conflicts in the preview of the retrieval.
1416
-
1417
- This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
1418
- production orgs.
1419
-
1420
- -o, --target-org=<value> Login username or alias for the target org.
1421
-
1422
- Overrides your default org.
1423
- ```
1424
-
1425
- _See code: [src/commands/project/retrieve/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/retrieve/preview.ts)_
1426
-
1427
- ## `sf project retrieve start`
1428
-
1429
- Retrieve metadata from an org to your local project.
1430
-
1431
- ```
1432
- USAGE
1433
- $ sf project retrieve start -o <value> [--json] [-a <value>] [-c] [-x <value> | -m <value> | -d <value>] [-r <value> | -n
1434
- <value> | ] [--single-package -t <value>] [-w <value>] [-z ] [--zip-file-name <value> ]
1435
-
1436
- FLAGS
1437
- -a, --api-version=<value> Target API version for the retrieve.
1438
- -c, --ignore-conflicts Ignore conflicts and retrieve and save files to your local filesystem, even if they
1439
- overwrite your local changes.
1440
- -d, --source-dir=<value>... File paths for source to retrieve from the org.
1441
- -m, --metadata=<value>... Metadata component names to retrieve. Wildcards (`*`) supported as long as you use
1442
- quotes, such as `ApexClass:MyClass*`.
1443
- -n, --package-name=<value>... Package names to retrieve.
1444
- -o, --target-org=<value> (required) Login username or alias for the target org.
1445
- -r, --output-dir=<value> Directory root for the retrieved source files.
1446
- -w, --wait=<value> [default: 33 minutes] Number of minutes to wait for the command to complete and display
1447
- results to the terminal window.
1448
- -x, --manifest=<value> File path for the manifest (package.xml) that specifies the components to retrieve.
1449
-
1450
- METADATA API FORMAT FLAGS
1451
- -t, --target-metadata-dir=<value> Directory that will contain the retrieved metadata format files or ZIP.
1452
- -z, --unzip Extract all files from the retrieved zip file.
1453
- --single-package Indicates that the zip file points to a directory structure for a single package.
1454
- --zip-file-name=<value> File name to use for the retrieved zip file.
1455
-
1456
- GLOBAL FLAGS
1457
- --json Format output as json.
1458
-
1459
- DESCRIPTION
1460
- Retrieve metadata from an org to your local project.
1461
-
1462
- You must run this command from within a project.
1463
-
1464
- Metadata components are retrieved in source format by default. Retrieve them in metadata format by specifying the
1465
- --target-metadata-dir flag, which retrieves the components into a ZIP file in the specified directory.
1466
-
1467
- If your org allows source tracking, then this command tracks the changes in your source. Some orgs, such as production
1468
- orgs, never allow source tracking. Source tracking is enabled by default on scratch and sandbox orgs; you can disable
1469
- source tracking when you create the orgs by specifying the --no-track-source flag on the "sf org create
1470
- scratch|sandbox" commands.
1471
-
1472
- To retrieve multiple metadata components, either use multiple --metadata <name> flags or use a single --metadata flag
1473
- with multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same
1474
- syntax applies to --manifest and --source-dir.
1475
-
1476
- ALIASES
1477
- $ sf retrieve metadata
1478
-
1479
- EXAMPLES
1480
- Retrieve all remote changes from your default org:
1481
-
1482
- $ sf project retrieve start
1483
-
1484
- Retrieve the source files in the "force-app" directory from an org with alias "my-scratch":
1485
-
1486
- $ sf project retrieve start --source-dir force-app --target-org my-scratch
1487
-
1488
- Retrieve all the Apex classes and custom objects whose source is in the "force-app" directory. The list views,
1489
- layouts, etc, that are associated with the custom objects are also retrieved. Both examples are equivalent:
1490
-
1491
- $ sf project retrieve start --source-dir force-app/main/default/classes force-app/main/default/objects
1492
- $ sf project retrieve start --source-dir force-app/main/default/classes --source-dir \
1493
- force-app/main/default/objects
1494
-
1495
- Retrieve all Apex classes that are in all package directories defined in the "sfdx-project.json" file:
1496
-
1497
- $ sf project retrieve start --metadata ApexClass
1498
-
1499
- Retrieve a specific Apex class; ignore any conflicts between the local project and org (be careful with this flag,
1500
- because it will overwrite the Apex class source files in your local project if there are conflicts!):
1501
-
1502
- $ sf project retrieve start --metadata ApexClass:MyApexClass --ignore-conflicts
1503
-
1504
- Retrieve specific Apex classes that match a pattern; in this example, retrieve Apex classes whose names contain the
1505
- string "MyApex":
1506
-
1507
- $ sf project retrieve start --metadata 'ApexClass:MyApex*'
1508
-
1509
- Retrieve all custom objects and Apex classes found in all defined package directories (both examples are
1510
- equivalent):
1511
-
1512
- $ sf project retrieve start --metadata CustomObject ApexClass
1513
- $ sf project retrieve start --metadata CustomObject --metadata ApexClass
1514
-
1515
- Retrieve all metadata components listed in a manifest:
1516
-
1517
- $ sf project retrieve start --manifest path/to/package.xml
1518
-
1519
- Retrieve metadata from a package:
1520
-
1521
- $ sf project retrieve start --package-name MyPackageName
1522
-
1523
- Retrieve metadata from multiple packages, one of which has a space in its name (both examples are equivalent):
1524
-
1525
- $ sf project retrieve start --package-name Package1 "PackageName With Spaces" Package3
1526
- $ sf project retrieve start --package-name Package1 --package-name "PackageName With Spaces" --package-name \
1527
- Package3
1528
-
1529
- Retrieve the metadata components listed in the force-app directory, but retrieve them in metadata format into a ZIP
1530
- file in the "output" directory:
1531
-
1532
- $ sf project retrieve start --source-dir force-app --target-metadata-dir output
1533
-
1534
- Retrieve in metadata format and automatically extract the contents into the "output" directory:
1535
-
1536
- $ sf project retrieve start --source-dir force-app --target-metadata-dir output --unzip
1537
-
1538
- FLAG DESCRIPTIONS
1539
- -a, --api-version=<value> Target API version for the retrieve.
1540
-
1541
- Use this flag to override the default API version, which is the latest version supported the CLI, with the API
1542
- version in your package.xml file.
1543
-
1544
- -c, --ignore-conflicts
1545
-
1546
- Ignore conflicts and retrieve and save files to your local filesystem, even if they overwrite your local changes.
1547
-
1548
- This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
1549
- production orgs.
1550
-
1551
- -d, --source-dir=<value>... File paths for source to retrieve from the org.
1552
-
1553
- The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder
1554
- (in which case the operation is applied to all source files in the directory and its subdirectories).
1555
-
1556
- -o, --target-org=<value> Login username or alias for the target org.
1557
-
1558
- Overrides your default org.
1559
-
1560
- -r, --output-dir=<value> Directory root for the retrieved source files.
1561
-
1562
- The root of the directory structure into which the source files are retrieved.
1563
- If the target directory matches one of the package directories in your sfdx-project.json file, the command fails.
1564
- Running the command multiple times with the same target adds new files and overwrites existing files.
1565
-
1566
- -w, --wait=<value> Number of minutes to wait for the command to complete and display results to the terminal window.
1567
-
1568
- If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
1569
-
1570
- -x, --manifest=<value> File path for the manifest (package.xml) that specifies the components to retrieve.
1571
-
1572
- If you specify this parameter, don’t specify --metadata or --source-dir.
1573
- ```
1574
-
1575
- _See code: [src/commands/project/retrieve/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/3.2.35/src/commands/project/retrieve/start.ts)_
67
+ - [`sf project`](docs/project.md)
1576
68
 
1577
69
  <!-- commandsstop -->