-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path_circleci
1847 lines (1753 loc) · 60.9 KB
/
_circleci
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
#compdef circleci
# -----------------------------------------------------------------------------
# The BSD-3-Clause License
#
# Copyright (c) 2018, The zsh-completions Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of que nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# github.com/CircleCI-Public/circleci-cli
#
# -----------------------------------------------------------------------------
function _circleci_all_orbs() {
if ( (( $+_zsh_circleci_all_orbs )) && ! _cache_invalid circleci_all_orbs ) \
|| _retrieve_cache circleci_all_orbs; then
return
fi
typeset -a -g _zsh_circleci_all_orbs
typeset -a new_circleci_all_orbs
new_circleci_all_orbs+=($(circleci --skip-update-check orb list -u | sed 's| (|@|g' | cut -d')' -f1 | awk 'NF<3 {print}'))
if [[ $new_circleci_all_orbs ]]; then
_zsh_circleci_all_orbs=($new_circleci_all_orbs)
_store_cache circleci_all_orbs _zsh_circleci_all_orbs
_message "Cached all public orbs."
else
_message "Could not update package cache."
fi
}
function _circleci_all_namespaces() {
if ( (( $+_zsh_circleci_all_namespaces )) && ! _cache_invalid circleci_all_namespaces ) \
|| _retrieve_cache circleci_all_namespaces; then
return
fi
typeset -a -g _zsh_circleci_all_namespaces
typeset -a new_circleci_all_namespaces
new_circleci_all_namespaces+=($(circleci --skip-update-check orb list -u | cut -d'/' -f1 | awk 'NF<3 {print}' | uniq))
if [[ $new_circleci_all_namespaces ]]; then
_zsh_circleci_all_namespaces=($new_circleci_all_namespaces)
_store_cache circleci_all_namespaces _zsh_circleci_all_namespaces
_message "Cached all public orb namespaces."
else
_message "Could not update package cache."
fi
}
function _circleci_orbs_caching_policy() {
if [[ ${1:t} == circleci_all_orbs ]]; then
local -a oldp
oldp=( "$1"(Nm+1) )
(( $#oldp ))
fi
}
function _circleci_namespaces_caching_policy() {
if [[ ${1:t} == circleci_all_namespaces ]]; then
local -a oldp
oldp=( "$1"(Nm+1) )
(( $#oldp ))
fi
}
function _circleci_set_cache_policy() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy _circleci_orbs_caching_policy
zstyle ":completion:${curcontext}:" cache-policy _circleci_namespaces_caching_policy
fi
}
function _circleci() {
local context curcontext=$curcontext state line ret=1
declare -A opt_args
_circleci_orbs_caching_policy
_circleci_namespaces_caching_policy
local -a commands
commands=(
'admin:Administrative operations for a CircleCI Server installation.'
'build:Run a job in a container on the local machine'
'config:Operate on build config files'
'context:Contexts provide a mechanism for securing and sharing environment variables across projects.'
'diagnostic:Check the status of your CircleCI CLI.'
'follow:Attempt to follow the project for the current git repository.'
'help:Help about any command'
'local:Debug jobs on the local machine'
'namespace:Operate on namespaces'
'open:Open the current project in the browser.'
'orb:Operate on orbs'
'query:Query the CircleCI GraphQL API.'
'runner:Operate on runners'
'setup:Setup the CLI with your credentials'
'step:Execute steps'
'switch'
'tests:Collect and split tests so they may be run in parallel.'
'update:Update the tool to the latest version'
'usage:Generate usage documentation in markdown for the CLI.'
'version:Display version information'
)
local -a _global_flags
_global_flags=(
"--token[your token for using CircleCI]:token"
"--host[URL to your CircleCI host (default: \"https://circleci.com\")]:host"
"--skip-update-check[Skip the check for updates check run before every command]"
)
_arguments -C \
$_global_flags \
"--debug[Enable debug logging. (hidden flag)]" \
"--endpoint[URI to your CircleCI GraphQL API endpoint (default: https://circleci.com/graphql-unstable) )(hidden flag)]:GraphQL API endpoint" \
"--github-api[Change the default endpoint to GitHub API for retrieving updates (default: https://api.github.com/) (hidden flag)]:GitHub API endpoint" \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'circleci command' commands}" \
'*:: :->args' \
&& ret=0
case $state in
args)
case $words[1] in
admin)
local -a admin_cmds
admin_cmds=(
"delete-namespace-alias:Delete a namespace alias"
"import-orb:Import an orb version from circleci.com into a CircleCI Server installation"
"rename-namespace:Rename a namespace"
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'admin command' admin_cmds}" \
'*:: :->args' \
&& ret=0
case $state in
args)
case $words[1] in
(delete-namespace-alias)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"--no-prompt[Disable prompt to bypass interactive UI.]" \
'*:name:'
;;
(import-ord)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"--no-prompt[Disable prompt to bypass interactive UI.]" \
'*:<namespace>[/<orb>[@<version>]]'
;;
(rename-namespace)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"--no-prompt[Disable prompt to bypass interactive UI.]" \
'1:old name' \
'2:new name'
;;
esac
;;
esac
;;
build)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'--branch[Git branch]:branch' \
"--checkout-key[Git Checkout key (default \"~/.ssh/id_rsa\")]:checkout key:_files" \
{-c,--config}"[config file (default \".circleci/config.yml\")]:config file:_files'" \
{-e,--env}"[Set environment variables, e.g. \-e VAR=VAL]:VAR=VAL" \
"--index[node index of parallelism]:num index" \
"--job[job to be executed (default \"build\")]:job name" \
"--node-total[total number of parallel nodes (default 1)]:parallel size" \
"--repo-url[Git Url]:Git URL" \
"--revision[Git Revision]:Git revision" \
"--skip-checkout[use local path as-is]" \
{-v,--volume}"[Volume bind-mounting]:mount volume path:_directories"
;;
config)
local -a config_cmds
config_cmds=(
'migrate:Migrate a pre-release config to the official 2.0 release version'
'pack:Pack up your CircleCI configuration into a single file.'
'process:Validate config and display expanded configuration.'
'validate:Check that the config file is well formed.'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'config subcommand' config_cmds}" \
'*:: :->args' \
&& ret=0
case $state in
args)
case $words[1] in
(pack|process|validate|check)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'*:<path> The path to your orb (use "-" for STDIN):_files'
;;
migrate)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
{-c,--config}"[path to config file (default: \".circleci/config.yml\")]:config file:_files" \
{-i,--in-place}"[whether to update file in place. If false, emits to stdout]"
;;
esac
;;
esac
;;
context)
local -a context_cmds
context_cmds=(
'create:Create a new context'
'delete:Delete the named context'
'list:List contexts'
'remove-secret:Remove a secret from the named context'
'show:Show a context'
'store-secret:Store an new secret in the named context. The value is read from stdin.'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'context subcommand' context_cmds}" \
'*:: :->args' \
&& ret=0
case $words[1] in
(create|show)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:vcs-type:(github bitbucket)' \
'2:org name' \
'3:context name'
;;
delete)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
{-f,--force}'[Delete the context without asking for confirmation.]' \
'1:vcs-type:(github bitbucket)' \
'2:org name' \
'3:context name'
;;
list)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:vcs-type:(github bitbucket)' \
'2:org name'
;;
(remove-secret|store-secret)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:vcs-type:(github bitbucket)' \
'2:org name' \
'3:context name' \
'4:secret name'
;;
esac
;;
follow)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]"
;;
diagnostic)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
;;
local)
local -a local_cmds
local_cmds=(
'execute:Run a job in a container on the local machine'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'local subcommand' local_cmds}" \
'*:: :->args' \
&& ret=0
case $words[1] in
execute)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'--branch[Git branch]:branch' \
'--checkout-key[Git Checkout key \(default "~/.ssh/id_rsa"\)]:checkout key:_files' \
{-c,--config}'[config file \(default ".circleci/config.yml"\)]:config file:_files' \
{-e,--env}'[Set environment variables, e.g. \-e VAR=VAL]:VAR=VAL' \
'--index[node index of parallelism]:num index' \
'--job[job to be executed \(default "build"\)]:job name' \
'--node-total[total number of parallel nodes \(default 1\)]:parallel size' \
'--repo-url[Git Url]:Git URL' \
'--revision[Git Revision]:Git revision' \
'--skip-checkout[use local path as-is]' \
{-v,--volume}'[Volume bind-mounting]:mount volume path:_directories'
;;
esac
;;
namespace)
local -a namespace_cmds
namespace_cmds=(
'create:create an namespace'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'namespace subcommand' namespace_cmds}" \
'*:: :->args' \
&& ret=0
case $state in
args)
case $words[1] in
create)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1:name" \
"2:vcs" \
"3:org-name"
esac
;;
esac
;;
orb)
local -a orb_cmds
orb_cmds=(
'add-to-category:Add an orb to a category'
'create:Create an orb in the specified namespace'
'info:Show the meta-data of an orb'
'init:Initialize a new orb.'
'list:List orbs'
'list-categories:List orb categories'
'pack:Pack an Orb with local scripts.'
'process:Validate an orb and print its form after all pre-registration processing'
'publish:Publish an orb to the registry'
'remove-from-category:Remove an orb from a category'
'source:Show the source of an orb'
"unlist:Disable or enable an orb's listing in the registry"
'validate:Validate an orb.yml'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'orb subcommand' orb_cmds}" \
'*:: :->args' \
&& ret=0
case $words[1] in
add-to-category)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1:<namespace>/<orb>" \
"2:<category-name>"
;;
create)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'--integration-testing[Enable test mode to bypass interactive UI.]' \
"*:<namespace>/<name>"
;;
# "*:namespace/orb@version:($(circleci orb list -u | sed 's| (|@|g' | cut -d')' -f1 | awk 'NF<3 {print}'))"
info)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"*:namespace/orb@version:->all_orbs"
case $state in
all_orbs)
_circleci_all_orbs
_wanted all-orbs expl 'orbs' compadd -a _zsh_circleci_all_orbs && ret=0
;;
esac
;;
init)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"*:path:_files"
;;
list)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
{-d,--details}'[output all the commands, executors, and jobs, along with a tree of their parameters]' \
'--sort[sort of]:(builds projects orgs)' \
{-u,--uncertified}'[include uncertified orbs]' \
'--json[print output as json instead of human-readable]' \
"*:namespace:->all_namespaces"
case $state in
all_namespaces)
_circleci_all_namespaces
_wanted all-namespaces expl 'namespaces' compadd -a _zsh_circleci_all_namespaces && ret=0
;;
esac
;;
list-categories)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
;;
pack)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"*:path:_files"
;;
process)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'*:<path> The path to your orb \(use "-" for STDIN\):_files'
;;
publish)
local -a orb_publish_cmds
orb_publish_cmds=(
'increment:Increment a released version of an orb'
'promote:Promote a development version of an orb to a semantic release'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'orb publish subcommand' orb_publish_cmds}"
case $words[1] in
increment)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:<path> The path to your orb \(use "-" for STDIN\):_files' \
"2:<namespace/orb> A fully-qualified reference to an orb. This takes the form namespace/orb@version]" \
"3:segment:(major minor patch)"
;;
promote)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:<path> The path to your orb \(use "-" for STDIN\):path:_files' \
"2:segment:segment:(major minor patch)"
;;
*)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:<path> The path to your orb \(use "-" for STDIN\):_files' \
"2:<orb> A fully-qualified reference to an orb. This takes the form namespace/orb@version"
;;
esac
;;
remove-from-category)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1:<namespace>/<orb>" \
"2:<category-name>"
;;
source)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"*:namespace/orb@version:->all_orbs"
case $state in
all_orbs)
_circleci_all_orbs
_wanted all-orbs expl 'orbs' compadd -a _zsh_circleci_all_orbs && ret=0
;;
esac
;;
unlint)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1:<namespace>/<orb>:_wanted all-orbs expl 'orbs' compadd -a _zsh_circleci_all_orbs" \
"2:enable or disable the listing:(true false)"
;;
validate)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:The path to your orb (use "-" for STDIN):_files'
;;
esac
;;
query)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:The path to your orb (use "-" for STDIN):_files' \
&& ret=0
;;
runner)
local -a runner_commands
runner_commands=(
'instance:Operate on runner instances'
'resource-class:Operate on runner resource-classes'
'token:Operate on runner tokens'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'runner subcommand' runner_commands}" \
'*:: :->args'
case $words[1] in
instance)
local -a resource_class_commands
resource_class_commands=(
{list,ls}':List resource-classes for a namespace'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'resource-class subcommand' resource_class_commands}"
case $word[1] in
(list|ls)
_arguments \
{-h,--help}"[help for $words[1]]" \
"*:namespace or resource-class:->all_namespaces"
case $state in
all_namespaces)
_circleci_all_namespaces
_wanted all-namespaces expl 'namespaces' compadd -a _zsh_circleci_all_namespaces && ret=0
;;
esac
;;
esac
;;
resource-class)
local -a resource_class_commands
resource_class_commands=(
'create:Create a resource-class'
{delete,rm}':Delete a resource-class'
{list,ls}':List resource-classes for a namespace'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'resource-class subcommand' resource_class_commands}"
case $word[1] in
create)
_arguments \
{-h,--help}"[help for $words[1]]" \
"1:resource-class" \
"2:description>"
;;
(delete|rm)
_arguments \
{-h,--help}"[help for $words[1]]" \
"1:resource-class"
;;
(list|ls)
_arguments \
{-h,--help}"[help for $words[1]]" \
"*:namespace:->all_namespaces"
case $state in
all_namespaces)
_circleci_all_namespaces
_wanted all-namespaces expl 'namespaces' compadd -a _zsh_circleci_all_namespaces && ret=0
;;
esac
;;
esac
;;
token)
local -a token_commands
token_commands=(
'create:Create a token for a resource-class'
{delete,rm}':Delete a token'
{list,ls}':List tokens for a resource-class'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[2]]" \
"1: :{_describe 'token subcommand' token_commands}" \
&& ret=0
case $word[3] in
create)
_arguments \
{-h,--help}"[help for $words[3]]" \
"--config=[true to emit a CircleCI runner config template with the token]:boolean:(true)" \
"4:resource-class" \
"5:nickname"
;;
(delete|rm)
_arguments \
{-h,--help}"[help for $words[3]]" \
"*:token-id"
;;
(list|ls)
_arguments \
{-h,--help}"[help for $words[3]]" \
"*:resource-class"
;;
esac
;;
esac
;;
tests)
local -a tests_commands
tests_commands=(
'glob:glob files using pattern]'
'split:return a split batch of provided files'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'tests subcommand' tests_commands}" \
'*:: :->args' \
&& ret=0
case $words[1] in
glob)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"*:re2 regexp PATTERN" \
&& ret=0
;;
split)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"--index[index of node.]:index size" \
"--show-counts[print test file or test class counts to stderr (default false)]" \
"--split-by[how to weight the split. (default \"name\")]:split type:(name filesize timings)" \
"--timings-file[JSON file containing historical timing data.]:json file:_files" \
"--timings-type[lookup historical timing data (default \"autodetect\")]:timing type:(classname filename testname autodetect)" \
"--total[number of nodes. (default 1)]:node size" \
&& ret=0
;;
esac
;;
update)
local -a update_commands
update_commands=(
'build-agent:Update the build agent to the latest version'
'check:Check if there are any updates available'
'install:Update the tool to the latest version'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'update subcommand' update_commands}" \
'*:: :->args' \
&& ret=0
;;
step)
local -a step_commands
step_commands=(
'halt:Halt the current job and treat it as successful'
)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'step subcommand' step_commands}" \
&& ret=0
;;
setup)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'--integration-testing[Enable test mode to bypass interactive UI.]' \
'--no-prompt[Disable prompt to bypass interactive UI. \(MUST supply --host and --token\)]' \
'--host[URL to your CircleCI host]:CircleCI host url' \
'--token[your token for using CircleCI]:CircleCI token' \
;;
query)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
'1:The path to your query \(use "-" for STDIN\)'
;;
version)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
;;
(help|usage)
_arguments \
$_global_flags \
{-h,--help}"[help for $words[1]]" \
"1: :{_describe 'command' commands}"
;;
esac
;;
esac
return ret
}
_circleci "$*"
# -----------------------------------------------------------------------------
#
# Use CircleCI from the command line.
#
# This project is the seed for CircleCI's new command-line application.
#
# For more help, see the documentation here: https://circleci.com/docs/2.0/local-cli/
#
#
# Usage:
# circleci [command]
#
# Available Commands:
# admin Administrative operations for a CircleCI Server installation.
# config Operate on build config files
# context Contexts provide a mechanism for securing and sharing environment variables across projects. The environment variables are defined as name/value pairs and are injected at runtime.
# diagnostic Check the status of your CircleCI CLI.
# follow Attempt to follow the project for the current git repository.
# help Help about any command
# local Debug jobs on the local machine
# namespace Operate on namespaces
# open Open the current project in the browser.
# orb Operate on orbs
# query Query the CircleCI GraphQL API.
# runner Operate on runners
# setup Setup the CLI with your credentials
# step Execute steps
# switch
# tests Collect and split tests so they may be run in parallel.
# update Update the tool to the latest version
# usage Generate usage documentation in markdown for the CLI.
# version Display version information
#
# Flags:
# --debug Enable debug logging.
# --endpoint string URI to your CircleCI GraphQL API endpoint (default "graphql-unstable")
# --github-api string Change the default endpoint to GitHub API for retrieving updates (default "https://api.github.com/")
# -h, --help help for circleci
# --host string URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
# --skip-update-check Skip the check for updates check run before every command. (default true)
# --token string your token for using CircleCI, also CIRCLECI_CLI_TOKEN
# Use "circleci [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Administrative operations for a CircleCI Server installation.
#
#
# Usage:
# circleci admin [command]
#
# Available Commands:
# delete-namespace-alias Delete a namespace alias
# import-orb Import an orb version from circleci.com into a CircleCI Server installation
# rename-namespace Rename a namespace
#
# Flags:
# -h, --help help for admin
#
# Global Flags:
# --host string URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
# --skip-update-check Skip the check for updates check run before every command. (default true)
# --token string your token for using CircleCI, also CIRCLECI_CLI_TOKEN
# Use "circleci admin [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Delete a namespace alias.
#
# A namespace can have multiple aliases (names). This command deletes an alias left behind by a rename. The most recent alias cannot be deleted.
#
# Example:
# - namespace A is renamed to B
# - alias B is created, coexisting with alias A
# - after migrating config accordingly, we can delete the A alias.
#
#
# Usage:
# circleci admin delete-namespace-alias <name> [flags]
#
# Args:
# <name> The name of the alias to delete
#
#
# Flags:
# -h, --help help for delete-namespace-alias
# --no-prompt Disable prompt to bypass interactive UI.
#
# Global Flags:
# --host string URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
# --skip-update-check Skip the check for updates check run before every command. (default true)
# --token string your token for using CircleCI, also CIRCLECI_CLI_TOKEN
#
# -----------------------------------------------------------------------------
#
# Import an orb version from circleci.com into a CircleCI Server installation
#
#
# Usage:
# circleci admin import-orb <namespace>[/<orb>[@<version>]] [flags]
#
# Flags:
# -h, --help help for import-orb
# --no-prompt Disable prompt to bypass interactive UI.
#
# Global Flags:
# --host string URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
# --skip-update-check Skip the check for updates check run before every command. (default true)
# --token string your token for using CircleCI, also CIRCLECI_CLI_TOKEN
#
# -----------------------------------------------------------------------------
#
# Rename a namespace
#
#
# Usage:
# circleci admin rename-namespace <old-name> <new-name> [flags]
#
# Args:
# <old-name> The current name of the namespace
# <new-name> The new name you want to give the namespace
#
#
# Flags:
# -h, --help help for rename-namespace
# --no-prompt Disable prompt to bypass interactive UI.
#
# Global Flags:
# --host string URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
# --skip-update-check Skip the check for updates check run before every command. (default true)
# --token string your token for using CircleCI, also CIRCLECI_CLI_TOKEN
# #
# -----------------------------------------------------------------------------
#
# Operate on build config files
#
#
# Usage:
# circleci config [command]
#
# Available Commands:
# migrate Migrate a pre-release config to the official 2.0 release version
# pack Pack up your CircleCI configuration into a single file.
# process Validate config and display expanded configuration.
# validate Check that the config file is well formed.
#
# Flags:
# -h, --help help for config
#
# Global Flags:
# --host string URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
# --skip-update-check Skip the check for updates check run before every command. (default true)
# --token string your token for using CircleCI, also CIRCLECI_CLI_TOKEN
# Use "circleci config [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Migrate a pre-release config to the official 2.0 release version
#
# Usage:
# circleci config migrate [flags]
#
# Flags:
# -h, --help help for migrate
# -i, --in-place whether to update file in place. If false, emits to stdout
#
# Global Flags:
# -c, --config string path to config file (default ".circleci/config.yml")
# --verbose enable verbose logging output
#
# -----------------------------------------------------------------------------
#
# Pack up your CircleCI configuration into a single file.
#
#
# Usage:
# circleci config pack <path> [flags]
#
# Args:
# <path> The path to your config (use "-" for STDIN)
#
#
# Flags:
# -h, --help help for pack
#
# Global Flags:
# --host string URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
# --skip-update-check Skip the check for updates check run before every command. (default true)
# --token string your token for using CircleCI, also CIRCLECI_CLI_TOKEN
#
# -----------------------------------------------------------------------------
#
# Validate config and display expanded configuration.
#
#
# Usage:
# circleci config process <path> [flags]