-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathsfdx_commands_ref.txt
1666 lines (1120 loc) · 80.1 KB
/
sfdx_commands_ref.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
=== force:limits:api:display
Usage: sfdx force:limits:api:display [-u <string>] [--json] [--loglevel <string>]
display current org’s limits
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
When you execute this command in a project, it provides limit information for your default scratch org.
Examples:
$ sfdx force:limits:api:display
$ sfdx force:limits:api:display -u me@my.org
=== force:lightning:app:create
Usage: sfdx force:lightning:app:create -n <string> [-t <string>] [-d <string>] [-a <string>] [--json] [--loglevel <string>]
create a lightning app
-a, --apiversion APIVERSION # api version number (40.0*,39.0)
-n, --appname APPNAME # name of the generated lightning app
-d, --outputdir OUTPUTDIR # folder for saving the created files
-t, --template TEMPLATE # template to use for file creation (DefaultLightningApp*)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If not supplied, the apiversion, template, and outputdir use default values.
The outputdir can be an absolute path or relative to the current working directory.
Examples:
$ sfdx force:lightning:app:create -n myapp
$ sfdx force:lightning:app:create -n myapp -d lightning
=== force:data:bulk:delete
Usage: sfdx force:data:bulk:delete -s <string> -f <file> [-w <minutes>] [-u <string>] [--json] [--loglevel <string>]
bulk delete records from a csv file
-f, --csvfile CSVFILE # the path to the csv file containing the ids of the records to delete
-s, --sobjecttype SOBJECTTYPE # the sobject type of the records you’re deleting
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-w, --wait WAIT # the number of minutes to wait for the command to complete before displaying the results
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
The file must be a CSV file with only one column: "Id".
One job can contain many batches, depending on the length of the CSV file.
Returns a job ID and a batch ID. Use these IDs to check job status with data:bulk:status.
Examples:
$ sfdx force:data:bulk:delete -s Account -f ./path/to/file.csv
$ sfdx force:data:bulk:delete -s MyObject__c -f ./path/to/file.csv
=== force:data:bulk:status
Usage: sfdx force:data:bulk:status -i <id> [-b <id>] [-u <string>] [--json] [--loglevel <string>]
view the status of a bulk data load job or batch
-b, --batchid BATCHID # the id of the batch whose status you want to view
-i, --jobid JOBID # the id of the job you want to view or of the job whose batch you want to view
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Examples:
$ sfdx force:data:bulk:status -i 750xx000000005sAAA
$ sfdx force:data:bulk:status -i 750xx000000005sAAA -b 751xx000000005nAAA
=== force:data:bulk:upsert
Usage: sfdx force:data:bulk:upsert -s <string> -f <file> [-i <id>] [-w <minutes>] [-u <string>] [--json] [--loglevel <string>]
bulk upsert records from a csv file
-f, --csvfile CSVFILE # the path to the csv file that defines the records to upsert
-i, --externalid EXTERNALID # the column name of the external id; if not provided, an arbitrary id is used
-s, --sobjecttype SOBJECTTYPE # the sobject type of the records you want to upsert
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-w, --wait WAIT # the number of minutes to wait for the command to complete before displaying the results
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Inserts or updates records from a CSV file.
One job can contain many batches, depending on the length of the CSV file.
Returns a job ID and a batch ID. Use these IDs to check job status with data:bulk:status.
For information about formatting your CSV file, see "Prepare CSV Files" in the Bulk API Developer Guide.
Examples:
$ sfdx force:data:bulk:upsert -s MyObject__c -f ./path/to/file.csv -i MyField__c
$ sfdx force:data:bulk:upsert -s MyObject__c -f ./path/to/file.csv -i Id -w 2
=== force:apex:class:create
Usage: sfdx force:apex:class:create -n <string> [-t <string>] [-d <string>] [-a <string>] [--json] [--loglevel <string>]
create an apex class
-a, --apiversion APIVERSION # api version number (40.0*,39.0)
-n, --classname CLASSNAME # name of the generated apex class
-d, --outputdir OUTPUTDIR # folder for saving the created files
-t, --template TEMPLATE # template to use for file creation (DefaultApexClass*,ApexException,ApexUnitTest,InboundEmailService)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If not supplied, the apiversion, template, and outputdir use default values.
The outputdir can be an absolute path or relative to the current working directory.
Examples:
$ sfdx force:apex:class:create -n MyClass
$ sfdx force:apex:class:create -n MyClass -d classes
=== force:doc:commands:display
Usage: sfdx force:doc:commands:display [--json] [--loglevel <string>]
display help for force commands
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Displays help for force commands.
=== force:doc:commands:list
Usage: sfdx force:doc:commands:list [--json] [--loglevel <string>]
list the force commands
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Displays a list of force commands and their descriptions.
=== force:visualforce:component:create
Usage: sfdx force:visualforce:component:create -n <string> -l <string> [-t <string>] [-d <string>] [-a <string>] [--json] [--loglevel <string>]
create a visualforce component
-a, --apiversion APIVERSION # api version number (40.0*,39.0)
-n, --componentname COMPONENTNAME # name of the generated visualforce component
-l, --label LABEL # visualforce component label
-d, --outputdir OUTPUTDIR # folder for saving the created files
-t, --template TEMPLATE # template to use for file creation (DefaultVFComponent*)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If not supplied, the apiversion, template, and outputdir use default values.
The outputdir can be an absolute path or relative to the current working directory.
Name and label are required.
Examples:
$ sfdx force:visualforce:component:create -n mycomponent -l mylabel
$ sfdx force:visualforce:component:create -n mycomponent -l mylabel -d components
=== force:lightning:component:create
Usage: sfdx force:lightning:component:create -n <string> [-t <string>] [-d <string>] [-a <string>] [--json] [--loglevel <string>]
create a lightning component
-a, --apiversion APIVERSION # api version number (40.0*,39.0)
-n, --componentname COMPONENTNAME # name of the generated lightning component
-d, --outputdir OUTPUTDIR # folder for saving the created files
-t, --template TEMPLATE # template to use for file creation (DefaultLightningCmp*)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If not supplied, the apiversion, template, and outputdir use default values.
The outputdir can be an absolute path or relative to the current working directory.
Examples:
$ sfdx force:lightning:component:create -n mycomponent
$ sfdx force:lightning:component:create -n mycomponent -d lightning
=== force:mdapi:convert
Usage: sfdx force:mdapi:convert -r <directory> [-d <directory>] [--json] [--loglevel <string>]
convert metadata api source into the sfdx source format
-d, --outputdir OUTPUTDIR # the output directory to store the sfdx source
-r, --rootdir ROOTDIR # the root directory containing the metadata api source
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
To work with source that you retrieved via Metadata API using the Salesforce DX tools, convert the source to the Salesforce DX format using "sfdx force:mdapi:convert".
To convert the source back to the Metadata API format, so that you can deploy it using "sfdx force:mdapi:deploy", run "sfdx force:source:convert".
Examples:
$ sfdx force:mdapi:convert -r <path to source>
$ sfdx force:mdapi:convert -r <path to source> -d <path to outputdir>
=== force:source:convert
Usage: sfdx force:source:convert [-r <directory>] [-d <directory>] [-n <string>] [--json] [--loglevel <string>]
convert sfdx source into the metadata api source format
-d, --outputdir OUTPUTDIR # the output directory to export the metadata api source to
-n, --packagename PACKAGENAME # the name of the package to associate with the metadata api source
-r, --rootdir ROOTDIR # the source directory for the source to be converted
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
To convert Salesforce DX–formatted source into a format that you can deploy using Metadata API, run "sfdx force:source:convert". Then deploy the source using "sfdx force:mdapi:deploy".
To convert Metadata API–formatted source into the Salesforce DX format, run "sfdx force:mdapi:convert".
Examples:
$ sfdx force:source:convert -r <path to source>
$ sfdx force:source:convert -r <path to source> -d <path to output dir>
=== force:org:create
Usage: sfdx force:org:create name=value... [-f <filepath>] [-n] [-i <string>] [-s] [-a <string>] [-w <minutes>] [-v <string>] [--json] [--loglevel <string>]
create a scratch org
-i, --clientid CLIENTID # connected app consumer key
-f, --definitionfile DEFINITIONFILE # path to a scratch org definition file
-n, --nonamespace # creates the scratch org with no namespace
-a, --setalias SETALIAS # set an alias for for the created scratch org
-s, --setdefaultusername # set the created org as the default username
-v, --targetdevhubusername TARGETDEVHUBUSERNAME # username for the dev hub org; overrides default dev hub org
-w, --wait WAIT # the streaming client socket timeout (in minutes) (default:6, min:2)
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
To set up a connected app for your new scratch org, specify the value that was returned when you created a connected app in your Dev Hub org as --clientid.
Examples:
$ sfdx force:org:create -f config/enterprise-scratch-def.json -a TestOrg1
$ sfdx force:org:create -a MyDevOrg -s -v me@myhub.org edition=Developer
$ sfdx force:org:create -f config/enterprise-scratch-def.json -a OrgWithOverrides username=testuser1@mycompany.org
=== force:package2:create
Usage: sfdx force:package2:create -n <string> [-d <string>] [-s <string>] [-v <string>] [--json] [--loglevel <string>]
create a package2
-d, --description DESCRIPTION # package2 description
-n, --name NAME # package2 name
-s, --namespace NAMESPACE # the package2 global namespace
-v, --targetdevhubusername TARGETDEVHUBUSERNAME # username for the dev hub org; overrides default dev hub org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
First, use this command to create a package2. Then create a package2 version.
Examples:
$ sfdx force:package2:create --name PackageName --namespace MyNamespace --description 'My New Package'
Run 'sfdx force:package2:list' to list all package2 packages in the dev hub org.
=== force:project:create
Usage: sfdx force:project:create -n <string> [-t <string>] [-d <string>] [-s <string>] [-p <string>] [--json] [--loglevel <string>]
create a new SFDX project
-p, --defaultpackagedir DEFAULTPACKAGEDIR # default package directory name (force-app*)
-s, --namespace NAMESPACE # project associated namespace
-d, --outputdir OUTPUTDIR # folder for saving the created files
-n, --projectname PROJECTNAME # name of the generated project
-t, --template TEMPLATE # template to use for file creation (Defaultsfdx-project.json*)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Default values are used if the template, namespace, defaultpackagedir, and outputdir aren’t supplied.
The outputdir can be an absolute path or relative to the current working directory.
Examples:
$ sfdx force:project:create --projectname mywork
$ sfdx force:project:create --projectname mywork --defaultpackagedir myapp
=== force:org:delete
Usage: sfdx force:org:delete -u <string> [-p] [--json] [--loglevel <string>]
mark a scratch org for deletion
-p, --noprompt # no prompt to confirm deletion
-u, --targetusername TARGETUSERNAME # username for the target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
To mark the org for deletion without being prompted to confirm, specify --noprompt.
Examples:
$ sfdx force:org:delete -u me@my.org
$ sfdx force:org:delete -u MyOrgAlias -p
=== force:mdapi:deploy
Usage: sfdx force:mdapi:deploy (-c | -i <id>) (-d <directory> | -f <filepath>) [-w <minutes>] [-l <string>] [-r <string>...] [-e <boolean>] [-u <string>] [--json] [--loglevel <string>] [--verbose]
deploys metadata to an org using metadata api
-c, --checkonly # validate deploy but don’t save to org (default: false)
-d, --deploydir DEPLOYDIR # root of directory tree of files to deploy
-i, --jobid JOBID # job ID of the deployment you want to check
-e, --rollbackonerror ROLLBACKONERROR # roll back deployment on any failure (default: true) (default:true)
-r, --runtests RUNTESTS # tests to run if --testlevel RunSpecifiedTests
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-l, --testlevel TESTLEVEL # deployment testing level (NoTestRun,RunSpecifiedTests,RunLocalTests,RunAllTestsInOrg)
-w, --wait WAIT # wait time for command to finish in minutes (default: 0)
-f, --zipfile ZIPFILE # path to .zip file of metadata to deploy
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
--verbose # verbose output of deploy results
Specify the location of the files to deploy as a .zip file or by the root of the directory tree containing the files. To check the status of a deployment, specify its job ID.
The default value of --rollbackonerror is true, but the corresponding parameter in the Metadata API deploy() call defaults to false.
=== force:org:display
Usage: sfdx force:org:display [-u <string>] [--json] [--loglevel <string>] [--verbose]
get org description
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
--verbose # emit additional command output to stdout
Output includes your access token, client ID, connected status, org ID, instance URL, username, and alias, if applicable. Use --verbose to include the SFDX auth URL.
Examples:
$ sfdx force:org:display
$ sfdx force:org:display -u me@my.org
$ sfdx force:org:display -u TestOrg1 --json
$ sfdx force:org:display -u TestOrg1 --json > tmp/MyOrgDesc.json
=== force:lightning:event:create
Usage: sfdx force:lightning:event:create -n <string> [-t <string>] [-d <string>] [-a <string>] [--json] [--loglevel <string>]
create a lightning event
-a, --apiversion APIVERSION # api version number (40.0*,39.0)
-n, --eventname EVENTNAME # name of the generated lightning event
-d, --outputdir OUTPUTDIR # folder for saving the created files
-t, --template TEMPLATE # template to use for file creation (DefaultLightningEvt*)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If not supplied, the apiversion, template, and outputdir use default values.
The outputdir can be an absolute path or relative to the current working directory.
Examples:
$ sfdx force:lightning:event:create -n myevent
$ sfdx force:lightning:event:create -n myevent -d lightning
=== force:apex:execute
Usage: sfdx force:apex:execute [-f <file>] [-u <string>] [--json] [--loglevel <string>]
execute anonymous apex code
-f, --apexcodefile APEXCODEFILE # path to a local file containing apex code
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Executes one or more lines of Apex code, or executes the code in a local file.
Before you enter code, run this command with no parameters to get a prompt.
From the prompt, all commands are executed in a single execute anonymous request.
For more information, see "Anonymous Blocks" in the Apex Developer Guide.
Examples:
$ sfdx force:apex:execute -f ~/test.apex
$ sfdx force:apex:execute
>> Start typing Apex code. Press the Enter key after each line,
>> then press CTRL+D when finished.
=== force:config:get
Usage: sfdx force:config:get name=value... [--json] [--loglevel <string>] [--verbose]
get config var value(s) for given name(s)
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
--verbose # emit additional command output to stdout
To see your default scratch org username, include "defaultusername".
To see your default Dev Hub, include "defaultdevhubusername".
To see your default instance URL, include "instanceUrl".
To see the locations where your values are set, include the --verbose flag.
Examples:
$ sfdx force:config:get defaultusername
$ sfdx force:config:get defaultusername defaultdevhubusername instanceUrl
$ sfdx force:config:get defaultusername defaultdevhubusername --verbose
=== force:package:install
Usage: sfdx force:package:install -i <id> [-w <minutes>] [-k <string>] [-u <string>] [--json] [--loglevel <string>]
install a package in the target org
-i, --id ID # id of the package to install (starts with 04t)
-k, --installationkey INSTALLATIONKEY # installation key for key-protected package (default: null)
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-w, --wait WAIT # number of minutes to wait for installation status
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Supply the ID of the package you want to install. Installs to the default username org unless you supply the username for a different target org.
Examples:
$ sfdx force:package:install -i 04t6A0000004eytQAA
$ sfdx force:package:install -i 04t6A0000004eytQAA -u me@my.org
=== force:package:install:get
Usage: sfdx force:package:install:get -i <id> [-u <string>] [--json] [--loglevel <string>]
retrieve status of package install request
-i, --requestid REQUESTID # packageinstallrequest id
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Displays the status of a package install request.
=== force:package2:installed:list
Usage: sfdx force:package2:installed:list [-u <string>] [--json] [--loglevel <string>]
list the org’s installed subscriber package2 versions
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Lists all subscriber package2 versions installed in the target org.
=== force:lightning:interface:create
Usage: sfdx force:lightning:interface:create -n <string> [-t <string>] [-d <string>] [-a <string>] [--json] [--loglevel <string>]
create a lightning interface
-a, --apiversion APIVERSION # api version number (40.0*,39.0)
-n, --interfacename INTERFACENAME # name of the generated lightning interface
-d, --outputdir OUTPUTDIR # folder for saving the created files
-t, --template TEMPLATE # template to use for file creation (DefaultLightningIntf*)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If not supplied, the apiversion, template, and outputdir use default values.
The outputdir can be an absolute path or relative to the current working directory.
Examples:
$ sfdx force:lightning:interface:create -n myinterface
$ sfdx force:lightning:interface:create -n myinterface -d lightning
=== force:auth:jwt:grant
Usage: sfdx force:auth:jwt:grant -u <string> -f <filepath> -i <string> [-r <url>] [-d] [-s] [-a <string>] [--json] [--loglevel <string>]
authorize an org using the jwt flow
-i, --clientid CLIENTID # oauth client id (sometimes called the consumer key)
-r, --instanceurl INSTANCEURL # the login url of the instance the org lives on
-f, --jwtkeyfile JWTKEYFILE # path to a file containing the private key
-a, --setalias SETALIAS # set an alias for for the authenticated org
-d, --setdefaultdevhubusername # set the authenticated org as the default dev hub org for scratch org creation
-s, --setdefaultusername # set the authenticated org as the default username that all commands run against
-u, --username USERNAME # authentication username
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Authorizes a Salesforce org using a private key file that has been uploaded to a personal connected app.
Examples:
$ sfdx force:auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <oauth client id>
$ sfdx force:auth:jwt:grant -u me@my.org -f <path to jwt key file> -i <oauth client id> -s -a MyDefaultOrg
=== force:alias:list
Usage: sfdx force:alias:list [--json] [--loglevel <string>]
list username aliases for sfdx
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Example:
$ sfdx force:alias:list
=== force:config:list
Usage: sfdx force:config:list [--json] [--loglevel <string>]
list config vars for sfdx
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Lists the config variables that the Salesforce CLI uses for various commands and tasks.
=== force:org:list
Usage: sfdx force:org:list [--all] [--clean] [-p] [--json] [--loglevel <string>]
list all active orgs you’ve created or authenticated to
-p, --noprompt # do not prompt for confirmation
--all # include expired, deleted, and unknown-status scratch orgs
--clean # remove all local org authorizations for non-active orgs
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Examples:
$ sfdx force:org:list
$ sfdx force:org:list --verbose --json
$ sfdx force:org:list --verbose --json > tmp/MyOrgList.json
=== force:package2:list
Usage: sfdx force:package2:list [-v <string>] [--json] [--loglevel <string>]
list all package2 packages in the dev hub org
-v, --targetdevhubusername TARGETDEVHUBUSERNAME # username for the dev hub org; overrides default dev hub org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
You can view the namespace, ID, and subscriber package2 ID for each package2.
=== force:apex:log:get
Usage: sfdx force:apex:log:get -i <id> [-u <string>] [--json] [--loglevel <string>]
fetch a debug log
-i, --logid LOGID # id of the log to display
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
When you execute this command in a project, it fetches the specified log from your default scratch org.To get the IDs for your debug logs, run "sfdx force:apex:log:list".
Examples:
$ sfdx force:apex:log:get -i <log id>
$ sfdx force:apex:log:get -i <log id> -u me@my.org
=== force:apex:log:list
Usage: sfdx force:apex:log:list [-u <string>] [--json] [--loglevel <string>]
list debug logs
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
When you execute this command in a project, it lists the log IDs for your default scratch org.
Examples:
$ sfdx force:apex:log:list
$ sfdx force:apex:log:list -u me@my.org
=== force:package2:manifest:create
Usage: sfdx force:package2:manifest:create -d <directory> [-v <string>] [--json] [--loglevel <string>]
create a manifest for the package2 from the specified directory
-d, --directory DIRECTORY # directory that contains package2 contents to include in the manifest
-v, --targetdevhubusername TARGETDEVHUBUSERNAME # username for the dev hub org; overrides default dev hub org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
The manifest must be in the directory specified when you create a package2 version.
=== force:package2:members:list
Usage: sfdx force:package2:members:list [-u <string>] [--json] [--loglevel <string>]
list all subscriber package2 members in the org
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Lists the history of each package2 member: the package2 version when a member was first added (minimum), the latest package version that contains the member (current), and the latest version that contained any deleted members (maximum). The Subject Manageable State shows the state of the object referenced by the package2 member: beta, deleted, deprecated, installed, released, or unmanaged.
=== force:org:open
Usage: sfdx force:org:open [-p <string>] [-r] [-u <string>] [--json] [--loglevel <string>]
open an org in your browser
-p, --path PATH # navigation url path
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-r, --urlonly # display navigation url, but don’t launch browser
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Opens your default scratch org, or another org that you specify.
To open a specific page, specify the portion of the URL after "yourInstance.salesforce.com/" as --path.
For example, specify "--path one/one.app" to open Lightning Experience, or specify "--path /apex/YourPage" to open a Visualforce page.
To generate a URL but not launch your browser, specify --urlonly.
Examples:
$ sfdx force:org:open
$ sfdx force:org:open -u me@my.org
$ sfdx force:org:open -u MyTestOrg1
$ sfdx force:org:open -r -p one/one.app
=== force:source:open
Usage: sfdx force:source:open -f <file> [-r] [-u <string>] [--json] [--loglevel <string>]
edit a lightning page with lightning app builder
-f, --sourcefile SOURCEFILE # file to edit
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-r, --urlonly # generate a navigation url; don’t launch the editor
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If Force.com IDE 2 is installed, the file opens in an embedded browser within the IDE. If Force.com IDE 2 isn’t installed, the file opens in your default browser.
If no browser-based editor is available for the selected file, this command opens your org’s home page.
To generate a URL for the browser-based editor but not open the editor, use --urlonly.
Examples:
$ sfdx force:source:open -f Property_Record_Page.flexipage-meta.xml
$ sfdx force:source:open -f Property_Record_Page.flexipage-meta.xml -r
=== force:visualforce:page:create
Usage: sfdx force:visualforce:page:create -n <string> -l <string> [-t <string>] [-d <string>] [-a <string>] [--json] [--loglevel <string>]
create a visualforce page
-a, --apiversion APIVERSION # api version number (40.0*,39.0)
-l, --label LABEL # visualforce page label
-d, --outputdir OUTPUTDIR # folder for saving the created files
-n, --pagename PAGENAME # name of the generated visualforce page
-t, --template TEMPLATE # template to use for file creation (DefaultVFPage*)
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If not supplied, the apiversion, template, and outputdir use default values.
The outputdir can be an absolute path or relative to the current working directory.
Name and label are required.
Examples:
$ sfdx force:visualforce:page:create -n mypage -l mylabel
$ sfdx force:visualforce:page:create -n mypage -l mylabel -d pages
=== force:user:password:generate
Usage: sfdx force:user:password:generate [-u <string>] [-v <string>] [--json] [--loglevel <string>]
generate a password for a scratch org
-v, --targetdevhubusername TARGETDEVHUBUSERNAME # username for the dev hub org; overrides default dev hub org
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Generates a random password and sets it for the user of a scratch org.
If you haven’t set a default Dev Hub, or if your scratch org isn’t associated with your default Dev Hub, --targetdevhubusername is required.
To see a password that was previously generated, run "sfdx force:org:display".
=== force:user:permset:assign
Usage: sfdx force:user:permset:assign -n <string> [-u <string>] [--json] [--loglevel <string>]
assign a permission set to the admin user of an org
-n, --permsetname PERMSETNAME # the name of the permission set to assign
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Examples:
$ sfdx force:user:permset:assign -n DreamHouse
$ sfdx force:user:permset:assign -n DreamHouse -u me@my.org
$ sfdx force:user:permset:assign -n DreamHouse -u TestOrg1
=== force:source:pull
Usage: sfdx force:source:pull [-w <minutes>] [-f] [-u <string>] [--json] [--loglevel <string>]
pull source from the scratch org to the project
-f, --forceoverwrite # ignore conflict warnings and overwrite changes to the project
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-w, --wait WAIT # wait time for command to finish in minutes (default: 33) (default:33, min:1)
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If the command detects a conflict, it displays the conflicts but does not complete the process. After reviewing the conflict, rerun the command with the --forceoverwrite parameter.
=== force:source:push
Usage: sfdx force:source:push [-w <minutes>] [-g] [-f] [-u <string>] [--json] [--loglevel <string>]
push source to an org from the project
-f, --forceoverwrite # ignore conflict warnings and overwrite changes to scratch org
-g, --ignorewarnings # deploy changes even if warnings are generated
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-w, --wait WAIT # wait time for command to finish in minutes (default: 33) (default:33, min:1)
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
If the command detects a conflict, it displays the conflicts but does not complete the process. After reviewing the conflict, rerun the command with the --forceoverwrite parameter.
=== force:data:record:create
Usage: sfdx force:data:record:create -s <string> -v <string> [-u <string>] [--json] [--loglevel <string>]
create a record
-s, --sobjecttype SOBJECTTYPE # the type of the record you’re creating
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-v, --values VALUES # the <fieldName>=<value> pairs you’re creating
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
The format of a field-value pair is <fieldName>=<value>.
Enclose all field-value pairs in one set of double quotation marks.
Enclose values that contain spaces in single quotes.
Examples:
$ sfdx force:data:record:create -s Account -v "Name=Acme"
$ sfdx force:data:record:create -s Account -v "Name='Universal Containers'"
$ sfdx force:data:record:create -s Account -v "Name='Universal Containers' Website=www.example.com"
=== force:data:record:delete
Usage: sfdx force:data:record:delete -s <string> [-i <id>] [-w <string>] [-u <string>] [--json] [--loglevel <string>]
delete a record
-i, --sobjectid SOBJECTID # the id of the record you’re deleting
-s, --sobjecttype SOBJECTTYPE # the type of the record you’re deleting
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-w, --where WHERE # a list of <fieldName>=<value> pairs to search for
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Specify an sObject type and either an ID or a list of <fieldName>=<value> pairs.
The format of a field-value pair is <fieldName>=<value>.
Enclose all field-value pairs in one set of double quotation marks.
Enclose values that contain spaces in single quotes.
Examples:
$ sfdx force:data:record:delete -s Account -i 001D000000Kv3dl
$ sfdx force:data:record:delete -s Account -w "Name=Acme"
$ sfdx force:data:record:delete -s Account -w "Name='Universal Containers'"
$ sfdx force:data:record:delete -s Account -w "Name='Universal Containers' Phone='(123) 456-7890'"
=== force:data:record:get
Usage: sfdx force:data:record:get -s <string> [-i <id>] [-w <string>] [-u <string>] [--json] [--loglevel <string>]
view a record
-i, --sobjectid SOBJECTID # the id of the record you’re retrieving
-s, --sobjecttype SOBJECTTYPE # the type of the record you’re retrieving
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-w, --where WHERE # a list of <fieldName>=<value> pairs to search for
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Specify an sObject type and either an ID or a list of <fieldName>=<value> pairs.
The format of a field-value pair is <fieldName>=<value>.
Enclose all field-value pairs in one set of double quotation marks.
Enclose values that contain spaces in single quotes.
Examples:
$ sfdx force:data:record:get -s Account -i 001D000000Kv3dl
$ sfdx force:data:record:get -s Account -w "Name=Acme"
$ sfdx force:data:record:get -s Account -w "Name='Universal Containers'"
$ sfdx force:data:record:get -s Account -w "Name='Universal Containers' Phone='(123) 456-7890'"
=== force:data:record:update
Usage: sfdx force:data:record:update -s <string> -v <string> [-i <id>] [-w <string>] [-u <string>] [--json] [--loglevel <string>]
update a record
-i, --sobjectid SOBJECTID # the id of the record you’re updating
-s, --sobjecttype SOBJECTTYPE # the type of the record you’re updating
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-v, --values VALUES # the <fieldName>=<value> pairs you’re updating
-w, --where WHERE # a list of <fieldName>=<value> pairs to search for
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
The format of a field-value pair is <fieldName>=<value>.
Enclose all field-value pairs in one set of double quotation marks.
Enclose values that contain spaces in single quotes.
Examples:
$ sfdx force:data:record:update -s Account -i 001D000000Kv3dl -v "Name=NewAcme"
$ sfdx force:data:record:update -s Account -w "Name='Old Acme'" -v "Name='New Acme'"
$ sfdx force:data:record:update -s Account -i 001D000000Kv3dl -v "Name='Acme III' Website=www.example.com"
=== force:mdapi:retrieve
Usage: sfdx force:mdapi:retrieve -r <directory> [-a <number>] [-w <minutes>] [-k <filepath>] [-d <directory>] [-p <string>...] [-s] [-i <id>] [-u <string>] [--json] [--loglevel <string>] [--verbose]
retrieves metadata from an org using metadata api
-a, --apiversion APIVERSION # target api version for the retrieve (default 40.0)
-i, --jobid JOBID # job ID of the retrieve you want to check
-p, --packagenames PACKAGENAMES # a comma-separated list of packages to retrieve
-r, --retrievetargetdir RETRIEVETARGETDIR # directory root for the retrieved files
-s, --singlepackage # a single-package retrieve (default: false)
-d, --sourcedir SOURCEDIR # source dir to use instead of default manifest sfdx-project.xml
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-k, --unpackaged UNPACKAGED # file path of manifest of components to retrieve
-w, --wait WAIT # wait time for command to finish in minutes (default: -1 (no limit))
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
--verbose # verbose output of retrieve result
The default target username is the admin user for the default scratch org. You can retrieve and deploy up to 10,000 files or 400 MB (39 MB compressed) at one time.
=== force:alias:set
Usage: sfdx force:alias:set name=value... [--json] [--loglevel <string>]
set username aliases for sfdx
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
You can associate an alias with only one username at a time. If you’ve set an alias multiple times, the alias points to the most recent username.
To delete an alias, run "sfdx force:alias:set" with no username.
Examples:
$ sfdx force:alias:set DefaultOrg=me@my.org
$ sfdx force:alias:set DefaultOrg=me@my.org DevHubOrg=me@myhub.org
$ sfdx force:alias:set AliasToDelete=
=== force:config:set
Usage: sfdx force:config:set name=value... [-g] [--json] [--loglevel <string>]
set config vars for sfdx
-g, --global # set config var globally (to be used from any directory)
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Sets the configuration variables that the Salesforce CLI uses for various commands and tasks. Local variables apply only to your current project. Global variables apply in any directory.
Examples:
$ sfdx force:config:set defaultusername=me@my.org defaultdevhubusername=me@myhub.org
$ sfdx force:config:set defaultdevhubusername=me@myhub.org -g
=== force:auth:sfdxurl:store
Usage: sfdx force:auth:sfdxurl:store -f <filepath> [-d] [-s] [-a <string>] [--json] [--loglevel <string>]
authorize an org using an sfdx auth url
-a, --setalias SETALIAS # set an alias for for the authenticated org
-d, --setdefaultdevhubusername # set the authenticated org as the default dev hub org for scratch org creation
-s, --setdefaultusername # set the authenticated org as the default username that all commands run against
-f, --sfdxurlfile SFDXURLFILE # path to a file containing the sfdx url
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Authorize a Salesforce org using an SFDX auth URL stored within a file.
The file must have use format "force://(<clientId>:<clientSecret>:)?<refreshToken>@<instanceUrl>", where "?" denotes an option value.
The file must contain only the URL or be a JSON file that has a top-level property named sfdxAuthUrl.
Examples:
$ sfdx force:auth:sfdxurl:store -f <path to sfdxAuthUrl file>
$ sfdx force:auth:sfdxurl:store -f <path to sfdxAuthUrl file> -s -a MyDefaultOrg
=== force:schema:sobject:describe
Usage: sfdx force:schema:sobject:describe [-s <string>] [-u <string>] [--json] [--loglevel <string>]
describe an object
-s, --sobjecttype SOBJECTTYPE # the api name of the object to describe
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Examples:
$ sfdx force:schema:sobject:describe -s Account
$ sfdx force:schema:sobject:describe -s MyObject__c
=== force:schema:sobject:list
Usage: sfdx force:schema:sobject:list -c <string> [-u <string>] [--json] [--loglevel <string>]
list all objects of a type
-c, --sobjecttypecategory SOBJECTTYPECATEGORY # the type of objects to list (all|custom|standard)
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Examples:
$ sfdx force:schema:sobject:list -c all
$ sfdx force:schema:sobject:list -c custom
$ sfdx force:schema:sobject:list -c standard
=== force:data:soql:query
Usage: sfdx force:data:soql:query -q <string> [-t] [-u <string>] [--json] [--loglevel <string>]
execute a soql query
-q, --query QUERY # soql query to execute
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-t, --usetoolingapi # execute query with tooling api
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
When you execute this command in a project, it executes the query against the data in your default scratch org.
Examples:
$ sfdx force:data:soql:query -q "SELECT Id, Name, Account.Name FROM Contact"
$ sfdx force:data:soql:query -q "SELECT Id, Name FROM Account WHERE ShippingState IN ('CA', 'NY')"
$ sfdx force:data:soql:query -q "SELECT Name FROM ApexTrigger" -t
=== force:source:status
Usage: sfdx force:source:status [-a] [-l] [-r] [-u <string>] [--json] [--loglevel <string>]
list local changes and/or changes in a scratch org
-a, --all # list all the changes that have been made
-l, --local # list the changes that have been made locally
-r, --remote # list the changes that have been made in the scratch org
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
Examples:
$ sfdx force:source:status -l
$ sfdx force:source:status -r
$ sfdx force:source:status -a
$ sfdx force:source:status -a -u me@my.org --json
=== force:lightning:test:create
Usage: sfdx force:lightning:test:create -n <string> [-t <string>] [-d <string>] [--json] [--loglevel <string>]
create a lightning test
-d, --outputdir OUTPUTDIR # folder for saving the created files
-t, --template TEMPLATE # template to use for file creation (DefaultLightningTest*)
-n, --testname TESTNAME # name of the generated lightning test
--json # json output
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
The outputdir can be an absolute path or relative to the current working directory.
Examples:
$ sfdx force:lightning:test:create -n MyLightningTest
$ sfdx force:lightning:test:create -n MyLightningTest -d lightningTests
=== force:apex:test:report
Usage: sfdx force:apex:test:report -i <id> [-c] [-d <directory>] [-r <string>] [-w <minutes>] [-u <string>] [--json] [--loglevel <string>] [--verbose]
display test results
-c, --codecoverage # retrieve code coverage results
-d, --outputdir OUTPUTDIR # directory to store test run files
-r, --resultformat RESULTFORMAT # test result format emitted to stdout; --json flag overrides this parameter (human*,tap,junit,json)
-u, --targetusername TARGETUSERNAME # username for the target org; overrides default target org
-i, --testrunid TESTRUNID # id of test run
-w, --wait WAIT # the streaming client socket timeout (in minutes) (default:6, min:2)
--json # format output as json
--loglevel LOGLEVEL # logging level for this command invocation (error*,trace,debug,info,warn,fatal)
--verbose # display apex test processing details