-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathop.ts
1321 lines (1317 loc) · 39.4 KB
/
op.ts
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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uQmCC";
interface Account {
url: string;
email: string;
user_uuid: string;
account_uuid: string;
}
const suggestAccounts: Fig.Generator = {
script: ["op", "account", "list", "--format", "json"],
postProcess: (out) => {
const json = JSON.parse(out) as Account[];
return json.map((account) => ({
name: account.email,
description: account.url,
insertValue: account.account_uuid,
icon,
}));
},
};
const spec: Fig.Spec = {
name: "op",
description: "Official 1Password CLI",
icon,
subcommands: [
{
name: "account",
description: "Manage your locally configured 1Password accounts",
icon,
subcommands: [
{
name: "add",
description: "Add an account to sign in to for the first time",
options: [
{
name: "--address",
description: "The sign-in address for your account",
args: {
name: "string",
},
},
{
name: "--email",
description: "The email address associated with your account",
args: {
name: "string",
},
},
{
name: "--raw",
description: "Only return the session token",
},
{
name: "--shorthand",
description: "Set the short account name",
args: {
name: "string",
},
},
],
},
{
name: "get",
description: "Get details about your account",
},
{
name: ["list", "ls"],
description: "List users and accounts set up on this device",
},
{
name: "forget",
description: "Remove a 1Password account from this device",
options: [
{
name: "--all",
description: "Forget all authenticated accounts",
},
],
args: {
name: "account",
},
},
],
},
{
name: "connect",
description:
"Manage Connect instances and Connect tokens in your 1Password account",
icon,
subcommands: [
{
name: "group",
description: "Manage group access to Secrets Automation",
subcommands: [
{
description: "Grant a group access to manage Secrets Automation",
name: "grant",
options: [
{
name: "--all-servers",
description:
"Grant access to all current and future servers in the authenticated account",
},
{
name: "--group",
description: "The group to receive access",
args: {
name: "group",
},
},
],
},
{
name: "revoke",
description:
"Revoke a group's access to manage Secrets Automation",
options: [
{
name: "--all-servers",
description:
"Revoke access to all current and future servers in the authenticated account",
},
{
name: "--group",
description: "The group to revoke access from",
args: {
name: "group",
},
},
],
},
],
},
{
name: "server",
description: "Manage Connect servers",
subcommands: [
{
name: "create",
description: "Set up a Connect server",
},
{
name: "get",
description: "Get a Connect server",
args: {
name: "serverName | serverID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
description: "Rename a Connect server",
name: "edit",
args: {
name: "serverName | serverID",
},
},
{
description: "Remove a Connect server",
name: ["delete", "remove", "rm"],
args: {
name: "serverName | serverID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
description: "List Connect servers",
name: ["list", "ls"],
},
],
},
{
name: "token",
description: "Manage Connect tokens",
subcommands: [
{
description: "Issue a token for a 1Password Connect server",
name: "create",
options: [
{
name: "--expires-in",
description:
"Set how long the Connect token is valid for in (s)econds, (m)inutes, or (h)ours",
args: {
name: "duration",
},
},
{
name: "--server",
description: "Issue a token for this server",
args: {
name: "string",
},
},
],
},
{
description: "Rename a Connect token",
name: "edit",
options: [
{
name: "--name",
description: "Change the token's name",
args: {
name: "string",
},
},
],
},
{
description: "Revoke a token for a Connect server",
name: ["delete", "remove", "rm"],
args: {
name: "token",
},
},
{
description: "Get a list of tokens",
name: ["list", "ls"],
},
],
},
{
name: "vault",
description: "Manage connect server vault access",
subcommands: [
{
description: "Grant a Connect server access to a vault",
name: "grant",
options: [
{
name: "--server",
description: "The server to be granted access",
args: {
name: "string",
},
},
],
},
{
description: "Revoke a Connect server's access to a vault",
name: "revoke",
options: [
{
name: "--server",
description: "The server to revoke access from",
args: {
name: "server",
},
},
],
},
],
},
],
},
{
name: "document",
description: "Perform CRUD operations on Document items in your vaults",
icon,
subcommands: [
{
name: "create",
description: "Create a document item",
options: [
{
name: "--file-name",
description: "Set the file's name",
args: {
name: "name",
},
},
{
name: "--tags",
description:
"Set the tags to the specified (comma-separated) values",
args: {
name: "tags",
},
},
{
name: "--title",
description: "Set the document item's title",
args: {
name: "title",
},
},
],
args: {
name: "file",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: "get",
description: "Download a document",
options: [
{
name: "--include-archive",
description:
"Include document items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable",
},
{
name: "--output",
description:
"Save the document to the file path instead of stdout",
args: {
name: "path",
},
},
],
args: {
name: "itemName | itemID",
},
},
{
name: "edit",
description: "Edit a document item",
options: [
{
name: "--file-name",
description: "Set the file's name",
args: {
name: "name",
},
},
{
name: "--tags",
description:
"Set the tags to the specified (comma-separated) values. An empty value will remove all tags",
args: {
name: "tags",
},
},
{
name: "--title",
description: "Set the document item's title",
args: {
name: "title",
},
},
],
args: [
{
name: "itemName | itemID",
},
{
name: "file",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
],
},
{
name: ["delete", "remove", "rm"],
description: "Delete or archive a document item",
options: [
{
name: "--archive",
description: "Move the document to the Archive",
},
],
args: {
name: "itemName | itemID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: ["list", "ls"],
description: "Get a list of documents",
options: [
{
name: "--include-archive",
description:
"Include document items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable",
},
],
},
],
},
{
name: "events-api",
description: "Manage Events API integrations in your 1Password account",
icon,
subcommands: [
{
name: "create",
description: "Set up an integration with the Events API",
},
],
},
{
name: "group",
description:
"Perform CRUD operations on the groups of users in your 1Password account",
icon,
subcommands: [
{
name: "user",
description: "Manage users in groups",
subcommands: [
{
description: "Grant a user access to a group",
name: "grant",
options: [
{
name: "--group",
description: "Specify the group to grant the user access to",
args: {
name: "string",
},
},
{
name: "--role",
description:
"Specify the user's role as a member or manager. Default: member",
args: {
name: "string",
},
},
],
},
{
description: "Revoke a user's access to a vault or group",
name: "revoke",
options: [
{
name: "--group",
description:
"Specify the group to revoke the user's access to",
args: {
name: "string",
},
},
],
},
{
description: "Retrieve users that belong to a group",
name: ["list", "ls"],
},
],
},
{
name: "create",
description: "Create a group",
options: [
{
name: "--description",
description: "Set the group's description",
args: {
name: "string",
},
},
],
},
{
name: "get",
description: "Get details about a group",
args: {
name: "groupName | groupID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: "edit",
description: "Edit a group's name or description",
options: [
{
name: "--description",
description: "Change the group's description",
args: {
name: "description",
},
},
],
args: {
name: "groupName | groupID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: ["delete", "remove", "rm"],
description: "Remove a group",
args: {
name: "groupName | groupID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: ["list", "ls"],
description: "List groups",
options: [
{
name: "--user",
description: "List groups that a user belongs to",
args: {
name: "user",
},
},
],
},
],
},
{
name: "item",
description:
"Perform CRUD operations on the 1Password items in your vaults",
icon,
subcommands: [
{
description: "Manage templates",
name: "template",
icon: "📕",
subcommands: [
{
name: "get",
description: "Get an item template",
options: [
{
name: ["-f", "--force"],
description: "Do not prompt for confirmation",
},
],
args: {
name: "category",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: ["list", "ls"],
description: "Get a list of templates",
},
],
},
{
name: "create",
description: "Create an item",
icon: "🪄",
options: [
{
name: "--category",
description: "Set the item's category",
args: {
name: "category",
},
},
{
name: "--dry-run",
description:
"Perform a dry run of the command and output a preview of the resulting item",
},
{
name: "--generate-password",
description: "Give the item a randomly generated password",
requiresSeparator: true,
args: {
name: "recipe",
},
},
{
name: "--tags",
description:
"Set the tags to the specified (comma-separated) values",
args: {
name: "tags",
},
},
{
name: "--template",
description: "Specify the filepath to read an item template from",
args: {
name: "string",
},
},
{
name: "--title",
description: "Set the item's title",
args: {
name: "title",
},
},
{
name: "--url",
description: "Set the URL associated with the item",
args: {
name: "URL",
},
},
],
args: {
name: "assignment...",
},
},
{
name: "get",
description: "Get an item's details",
icon: "📑",
options: [
{
name: "--fields",
description:
"Only return data from these fields. Use 'label=' to get the field by name or 'type=' to filter fields by type",
args: {
name: "fields",
},
},
{
name: "--include-archive",
description:
"Include items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable",
},
{
name: "--otp",
description: "Output the primary one-time password for this item",
},
{
name: "--share-link",
description: "Get a shareable link for the item",
},
],
args: {
name: "itemName | itemID | shareLink",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: "edit",
description: "Edit an item's details",
icon: "🔏",
args: [
{
name: "itemName | itemID | shareLink",
},
{
name: "assignment ...",
},
],
},
{
name: ["delete", "remove", "rm"],
description: "Delete or archive an item",
icon: "🗑️",
options: [
{
name: "--archive",
description: "Move the item to the Archive",
},
],
args: {
name: "itemName | itemID | shareLink",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: ["list", "ls"],
description: "List items",
icon: "📖",
options: [
{
name: "--categories",
description:
"Only list items in these categories (comma-separated)",
args: {
name: "categories",
},
},
{
name: "--include-archive",
description:
"Include items in the Archive. Can also be set using OP_INCLUDE_ARCHIVE environment variable",
},
{
name: "--long",
description: "Output a more detailed item list",
},
{
name: "--tags",
description: "Only list items with these tags (comma-separated)",
args: {
name: "tags",
},
},
],
},
{
name: "share",
description: "Share an item",
icon: "👥",
options: [
{
name: "--emails",
description: "Email addresses to share with",
args: {
name: "strings",
},
},
{
name: "--expiry",
description:
"Link expiring after the specified duration in (s)econds, (m)inutes, or (h)ours (default 7h)",
args: {
name: "duration",
},
},
{
name: "--vault",
description: "Look for the item in this vault",
args: {
name: "string",
},
},
],
args: {
name: "itemName | itemID",
},
},
],
},
{
name: "user",
description: "Manage users within this 1Password account",
icon,
subcommands: [
{
name: "provision",
description: "Provision a user in the authenticated account",
options: [
{
name: "--email",
description: "Provide the user's email address",
args: {
name: "string",
},
},
{
name: "--language",
description:
'Provide the user\'s account language. (default "en")',
args: {
name: "string",
},
},
],
},
{
name: "confirm",
description: "Confirm a user",
options: [
{
name: "--all",
description: "Confirm all unconfirmed users",
},
],
args: {
name: "email | name | userID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: "get",
description: "Get details about a user",
options: [
{
name: "--fingerprint",
description: "Get the user's public key fingerprint",
},
],
args: {
name: "email | name | userID | --me",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
{
name: "--me",
description: "Get the authenticated user's details",
type: "option",
},
],
},
},
{
name: "edit",
description: "Edit a user's name or Travel Mode status",
options: [
{
name: "--name",
description: "Set the user's name",
args: {
name: "string",
},
},
],
args: {
name: "email | name | userID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: "suspend",
description: "Suspend a user",
options: [
{
name: "--deauthorize-devices-after",
description:
"Deauthorize the user's devices after a time (rounded down to seconds)",
args: {
name: "duration",
},
},
],
args: {
name: "email | name | userID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: "reactivate",
description: "Reactivate a suspended user",
args: {
name: "email | name | userID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: ["delete", "remove", "rm"],
description: "Remove a user and all their data from the account",
args: {
name: "email | name | userID",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
{
name: ["list", "ls"],
description: "List users",
options: [
{
name: "--group",
description: "List users who belong to a group",
args: {
name: "group",
},
},
],
},
],
},
{
name: "vault",
description:
"Manage permissions and perform CRUD operations on your 1Password vaults",
icon,
subcommands: [
{
name: "group",
description: "Manage group vault access",
icon: "👥",
subcommands: [
{
name: "grant",
description: "Grant a group permissions to a vault",
options: [
{
name: "--group",
description: "The group to receive access",
args: {
name: "group",
},
},
{
name: "--no-input",
description:
"Do not prompt for input on interactive terminal",
args: {
name: "input",
},
},
{
name: "--permissions",
description: "The permissions to grant to the group",
args: {
name: "permissions",
},
},
],
},
{
name: "revoke",
description:
"Revoke a portion or the entire access of a group to a vault",
options: [
{
name: "--group",
description: "The group to revoke access from",
args: {
name: "group",
},
},
{
name: "--no-input",
description:
"Do not prompt for input on interactive terminal",
args: {
name: "input",
},
},
{
name: "--permissions",
description: "The permissions to revoke from the group",
args: {
name: "permissions",
},
},
],
},
{
name: ["list", "ls"],
description:
"List all the groups that have access to the given vault",
args: {
name: "vault",
suggestions: [
{ name: "-", description: "Read from stdin", hidden: true },
],
},
},
],
},
{
name: "user",
description: "Manage user vault access",
icon: "📈",
subcommands: [
{
description: "Grant a user access to a vault",
name: "grant",
options: [
{
name: "--no-input",
description:
"Do not prompt for input on interactive terminal",
args: {
name: "input",
},
},
{
name: "--permissions",
description: "The permissions to grant to the user",
args: {
name: "permissions",
},
},
{
name: "--user",
description: "The user to receive access",
args: {
name: "user",
},
},
],
},
{
description:
"Revoke a portion or the entire access of a user to a vault",
name: "revoke",
options: [
{
name: "--no-input",
description: