-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathlpass.ts
962 lines (962 loc) · 24.6 KB
/
lpass.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
const completionSpec: Fig.Spec = {
name: "lpass",
description: "Command line interface for LastPass",
subcommands: [
{
name: "login",
description: "Log in to LastPass",
options: [
{
name: "--trust",
description:
"Subsequent logins will not require multifactor authentication",
},
{
name: "--plaintext-key",
description: "Save decryption key to the hard disk in plaintext",
args: {
name: "--force",
description: "Skip user confirmation",
isOptional: true,
},
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
],
args: {
name: "USERNAME",
description: "LastPass account username (email address)",
},
},
{
name: "logout",
description: "Log out of LastPass",
options: [
{
name: "--force",
description: "Skip user confirmation",
},
],
},
{
name: "ls",
description: "List names in groups in a tree structure",
options: [
{
name: "--color",
description: "Control colored output to the terminal",
requiresSeparator: true,
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
{
name: ["--long", "-l"],
description: "Show the last modification time",
},
{
name: "-m",
description: "Show the last modified time",
},
{
name: "-u",
description: "Show the last used time",
},
],
args: {
name: "GROUP",
description: "Group of entries to list",
isOptional: true,
},
},
{
name: "passwd",
description: "Change LastPass password and reencrypt all entries",
},
{
name: "show",
description: "Show password or selected field",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: ["--clip", "-c"],
description: "Copy to the clipboard",
},
{
name: ["--quiet", "-q"],
description: "Display no output and only sets return code",
},
{
name: ["--expand-multi", "-x"],
description: "Show information from all matching sites",
},
{
name: ["--json", "-j"],
description: "Generate json output instead of human-readable text",
},
{
name: "--all",
description: "Show all fields",
exclusiveOn: [
"--username",
"--password",
"--url",
"--notes",
"--field",
"--id",
"--name",
"--attachid",
],
},
{
name: "--username",
description: "Show only the username",
exclusiveOn: [
"--all",
"--password",
"--url",
"--notes",
"--field",
"--id",
"--name",
"--attachid",
],
},
{
name: "--password",
description: "Show only the password",
exclusiveOn: [
"--all",
"--username",
"--url",
"--notes",
"--field",
"--id",
"--name",
"--attachid",
],
},
{
name: "--url",
description: "Show only the URL",
exclusiveOn: [
"--all",
"--username",
"--password",
"--notes",
"--field",
"--id",
"--name",
"--attachid",
],
},
{
name: "--notes",
description: "Show only the notes",
exclusiveOn: [
"--all",
"--username",
"--password",
"--url",
"--field",
"--id",
"--name",
"--attachid",
],
},
{
name: "--field",
description: "Show only the field",
exclusiveOn: [
"--all",
"--username",
"--password",
"--url",
"--notes",
"--id",
"--name",
"--attachid",
],
args: {
name: "FIELD",
description: "Show only this field",
},
},
{
name: "--id",
description: "Show only the ID",
exclusiveOn: [
"--all",
"--username",
"--password",
"--url",
"--notes",
"--field",
"--name",
"--attachid",
],
},
{
name: "--name",
description: "Show only the name",
exclusiveOn: [
"--all",
"--username",
"--password",
"--url",
"--notes",
"--field",
"--id",
"--attachid",
],
},
{
name: "--attach",
description: "Show only the attachment",
exclusiveOn: [
"--all",
"--username",
"--password",
"--url",
"--notes",
"--field",
"--id",
"--name",
],
args: {
name: "ATTACHID",
description: "Attachment ID",
},
},
{
name: ["--basic-regexp", "-G"],
description:
"Show sites matching case-insensitive regular expression",
exclusiveOn: ["--fixed-strings", "-F"],
},
{
name: ["--fixed-strings", "-F"],
description: "Show sites matching this exact substring",
exclusiveOn: ["--basic-regexp", "-G"],
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
],
args: {
name: "UNIQENAME|UNIQUEID",
description: "Shows entry with this unique name or ID",
},
},
{
name: "mv",
description: "Move LastPass entry to a different group",
options: [
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
],
args: [
{
name: "UNIQUENAME|UNIQUEID",
description: "Unique name or ID to move",
},
{
name: "GROUP",
description: "Destination group",
},
],
},
{
name: "add",
description: "Add a new entry",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: "--non-interactive",
description:
"Accept data until EOF or, unless the notes field is being edited, the first new line",
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
{
name: "--username",
description: "Add only the username",
exclusiveOn: [
"--password",
"--url",
"--notes",
"--field",
"--note-type",
],
},
{
name: "--password",
description: "Add only the password",
exclusiveOn: [
"--username",
"--url",
"--notes",
"--field",
"--note-type",
],
},
{
name: "--url",
description: "Add only the URL",
exclusiveOn: [
"--username",
"--password",
"--notes",
"--field",
"--note-type",
],
},
{
name: "--notes",
description: "Add only the notes",
exclusiveOn: [
"--username",
"--password",
"--url",
"--field",
"--note-type",
],
},
{
name: "--field",
description: "Add only the field",
exclusiveOn: [
"--username",
"--password",
"--url",
"--notes",
"--note-type",
],
args: {
name: "FIELD",
description: "Add only this field",
},
},
{
name: "--note-type",
description: "Add only the note",
exclusiveOn: [
"--username",
"--password",
"--url",
"--notes",
"--field",
],
args: {
name: "NOTETYPE",
description: "Type of note to add",
suggestions: [
"amex",
"bank",
"credit",
"database",
"drivers_license",
"email",
"health_insurance",
"im",
"mastercard",
"membership",
"passport",
"server",
"software_license",
"ssh_key",
"ssn",
"visa",
"wifi",
],
},
},
],
args: {
name: "NAME|UNIQUEID",
description: "Name or unique ID of the entry to add",
},
},
{
name: "edit",
description: "Edit existing entry",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: "--non-interactive",
description:
"Accept data until EOF or, unless the notes field is being edited, the first new line",
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
{
name: ["--name", "--username"],
description: "Edit only the name (or username)",
exclusiveOn: [
"--password",
"--url",
"--notes",
"--field",
"--note-type",
],
},
{
name: "--password",
description: "Edit only the password",
exclusiveOn: [
"--username",
"--url",
"--notes",
"--field",
"--note-type",
],
},
{
name: "--url",
description: "Edit only the URL",
exclusiveOn: [
"--username",
"--password",
"--notes",
"--field",
"--note-type",
],
},
{
name: "--notes",
description: "Edit only the notes",
exclusiveOn: [
"--username",
"--password",
"--url",
"--field",
"--note-type",
],
},
{
name: "--field",
description: "Edit only the field",
exclusiveOn: [
"--username",
"--password",
"--url",
"--notes",
"--note-type",
],
args: {
name: "FIELD",
description: "Edit just this field",
},
},
],
args: {
name: "NAME|UNIQUEID",
description: "Name or unique ID of the entry to edit",
},
},
{
name: "generate",
description: "Create randomly generated password",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
{
name: ["--clip", "-c"],
description: "Copy the text to the clipboard",
},
{
name: "--username",
description: "Generate password for this username",
args: {
name: "USERNAME",
description: "Username to generate the password for",
},
},
{
name: "--url",
description: "Generate password for this URL",
args: {
name: "URL",
description: "URL to generate the password for",
},
},
{
name: "--no-symbols",
description: "Generate password without symbols",
},
],
args: [
{
name: "NAME|UNIQUEID",
description:
"Name or unique ID of the entry to generate the password for",
},
{
name: "LENGTH",
description: "Length of the password to create",
},
],
},
{
name: "duplicate",
description: "Duplicate existing entry",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
],
args: {
name: "UNIQUENAME|UNIQUEID",
description: "Unique name or unique ID of the entry to duplicate",
},
},
{
name: "rm",
description: "Removes existing entry",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
],
args: {
name: "UNIQUENAME|UNIQUEID",
description: "Unique name or unique ID of the entry to remove",
},
},
{
name: "status",
description: "Show the LastPass login status",
options: [
{
name: ["--quiet", "-q"],
description: "Display no output and only sets return code",
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
],
},
{
name: "sync",
description: "Sync the local cache against the LastPass server",
options: [
{
name: ["--background", "-b"],
description: "Syncronization occurs in a daemonized process",
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
],
},
{
name: "import",
description: "Import account information from an unencrypted CSV",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: "--keep-dupes",
description: "Keeps any duplicate entries",
},
],
args: {
name: "FILENAME",
description: "CSV filename to import from",
},
},
{
name: "export",
description: "Export account information to an unencrypted CSV",
options: [
{
name: "--sync",
description: "When the current operation syncs to server",
requiresSeparator: true,
args: {
name: "sync",
suggestions: ["auto", "now", "no"],
isOptional: true,
default: "auto",
},
},
{
name: "--color",
description: "Control colored output to the terminal",
args: {
name: "color",
suggestions: ["auto", "never", "always"],
isOptional: true,
default: "auto",
},
},
{
name: "--fields",
description:
"Comma-separated subset of: id, url, username, password, extra, name, fav, id, grouping, group, fullname, last_touch, last_modified_gmt, attachpresent",
args: {
name: "FIELDLIST",
suggestions: [
"id,url,username,password,extra,name,fav,id,grouping,group,fullname,last_touch,last_modified_gmt,attachpresent",
],
},
},
],
args: {
name: "FILENAME",
description: "CSV filename to export to",
},
},
{
name: "share",
description: "LastPass Sharing Center functionality",
subcommands: [
{
name: "userls",
description:
"List the LastPass users which have access to the Shared Folders",
},
{
name: "useradd",
description: "Add user to Shared Folders",
options: [
{
name: "--read-only",
description: "Control read or write access",
args: [
{
name: "true",
description: "Grant read only access",
},
{
name: "false",
description: "Grant write access",
},
],
},
{
name: "--hidden",
description: "Share user view permission",
args: [
{
name: "true",
description: "User can only view entry",
},
{
name: "false",
description: "User can view entry and secrets",
},
],
},
{
name: "--admin",
description: "Share user administer permission",
args: [
{
name: "true",
description: "User can administer entry",
},
{
name: "false",
description: "User cannot administer entry",
},
],
},
],
args: [
{
name: "SHARE",
description: "Entry to share",
},
{
name: "USERNAME",
description: "User to share entry with",
},
],
},
{
name: "usermod",
description: "Modify user on Shared Folders",
options: [
{
name: "--read-only",
description: "Control read or write access",
args: [
{
name: "true",
description: "Grant read only access",
},
{
name: "false",
description: "Grant write access",
},
],
},
{
name: "--hidden",
description: "Share user view permission",
args: [
{
name: "true",
description: "User can only view entry",
},
{
name: "false",
description: "User can view entry and secrets",
},
],
},
{
name: "--admin",
description: "Share user administer permission",
args: [
{
name: "true",
description: "User can administer entry",
},
{
name: "false",
description: "User cannot administer entry",
},
],
},
],
args: [
{
name: "SHARE",
description: "Entry to modify",
},
{
name: "USERNAME",
description: "User access to modify",
},
],
},
{
name: "userdel",
description: "Remove user from Shared Folders",
args: [
{
name: "SHARE",
description: "LastPass entry to remove user from",
},
{
name: "USERNAME",
description: "LastPass user to remove",
},
],
},
{
name: "create",
description: "Create new LastPass Shared Folder",
args: {
name: "SHARE",
description: "LastPass Shared Folder to create",
},
},
{
name: "rm",
description: "LastPass Shared Folder to remove",
args: {
name: "SHARE",
description: "LastPass Shared Folder to remove",
},
},
{
name: "limit",
description: "Manipulate LastPass Shared Folder access",
options: [
{
name: ["--deny", "--allow"],
description: "Deny or allow access",
},
{
name: ["--add", "--rm", "--clear"],
description: "Add, remove, or clear acces",
},
],
args: [
{
name: "SHARE",
description: "Shared Folder to remove",
},
{
name: "USERNAME",
description: "User access to manipulate",
},
{
name: "sites",
description: "LastPass sites to manipulate",
isOptional: true,
},
],
},
],
args: {
name: "SHARE",
description: "LastPass Shared folder to query",
},
},
],
options: [
{
name: ["--help", "-h"],
description: "Display the help for lpass",
},
{
name: "--version",
description: "Display the version of lpass",
},
],
};
export default completionSpec;