@agledger/cli 1.4.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +10 -14
- package/README.md +162 -16
- package/SKILL.md +14 -9
- package/dist/api-client.d.ts +24 -5
- package/dist/api-client.js +85 -16
- package/dist/base.d.ts +106 -31
- package/dist/base.js +299 -41
- package/dist/commands/api.d.ts +1 -0
- package/dist/commands/api.js +4 -3
- package/dist/commands/auth.d.ts +6 -2
- package/dist/commands/auth.js +20 -10
- package/dist/commands/config.d.ts +1 -0
- package/dist/commands/config.js +17 -1
- package/dist/commands/discover.d.ts +1 -0
- package/dist/commands/discover.js +5 -1
- package/dist/commands/docs.d.ts +1 -0
- package/dist/commands/docs.js +7 -1
- package/dist/commands/help-json.d.ts +1 -0
- package/dist/commands/list-commands.d.ts +1 -0
- package/dist/commands/login.d.ts +16 -3
- package/dist/commands/login.js +121 -10
- package/dist/commands/logout.d.ts +3 -1
- package/dist/commands/logout.js +35 -11
- package/dist/commands/verify.d.ts +22 -1
- package/dist/commands/verify.js +241 -21
- package/dist/oidc.d.ts +143 -0
- package/dist/oidc.js +384 -0
- package/dist/util/config.d.ts +13 -1
- package/oclif.manifest.json +147 -12
- package/package.json +2 -2
package/oclif.manifest.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"agledger api GET /v1/records -F status=ACTIVE -F limit=50",
|
|
21
21
|
"agledger api POST /v1/records --data '{\"type\":\"notarize-generic-v1\",\"criteria\":{\"summary\":\"...\"}}'",
|
|
22
22
|
"agledger api POST /v1/records -F type=notarize-generic-v1 -F criteria.summary=\"summarize Q3 filings\"",
|
|
23
|
-
"agledger api POST /v1/records -F type=notarize-generic-v1 -f externalTaskId=4821 # -f keeps a digit-only id a string",
|
|
23
|
+
"agledger api POST /v1/records -F type=notarize-generic-v1 -F criteria.summary=\"file Q3 report\" -f externalTaskId=4821 # -f keeps a digit-only id a string",
|
|
24
24
|
"agledger api POST /v1/records --input payload.json",
|
|
25
25
|
"cat payload.json | agledger api POST /v1/records --input -",
|
|
26
26
|
"agledger api GET /v1/records --paginate # streams all pages as NDJSON"
|
|
@@ -61,6 +61,12 @@
|
|
|
61
61
|
"multiple": false,
|
|
62
62
|
"type": "option"
|
|
63
63
|
},
|
|
64
|
+
"verbose": {
|
|
65
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
66
|
+
"name": "verbose",
|
|
67
|
+
"allowNo": false,
|
|
68
|
+
"type": "boolean"
|
|
69
|
+
},
|
|
64
70
|
"data": {
|
|
65
71
|
"description": "Request body as a JSON string. For GET/DELETE, used as query parameters.",
|
|
66
72
|
"name": "data",
|
|
@@ -105,7 +111,7 @@
|
|
|
105
111
|
"type": "boolean"
|
|
106
112
|
},
|
|
107
113
|
"idempotency-key": {
|
|
108
|
-
"description": "Dedup key for POST, max 256 chars. One is generated per call,
|
|
114
|
+
"description": "Dedup key for POST, max 256 chars. One is generated per call and shown by --verbose, and a TIMEOUT or dropped-connection error carries it as `idempotencyKey`. Pass this only when retrying a call that may already have reached the Server: reuse the first attempt's key and it replays the original result instead of creating a second record, where a rerun without it can create a duplicate. Bound to method, route and body, so a retry with a changed body is rejected.",
|
|
109
115
|
"name": "idempotency-key",
|
|
110
116
|
"hasDynamicHelp": false,
|
|
111
117
|
"multiple": false,
|
|
@@ -136,7 +142,7 @@
|
|
|
136
142
|
"auth": {
|
|
137
143
|
"aliases": [],
|
|
138
144
|
"args": {},
|
|
139
|
-
"description": "Check current authentication status. Returns `authenticated: false` when no
|
|
145
|
+
"description": "Check current authentication status, including the OIDC cert identity when a token source is configured. Returns `authenticated: false` when no credential is configured (exit 0).",
|
|
140
146
|
"flags": {
|
|
141
147
|
"json": {
|
|
142
148
|
"description": "Force JSON output (default when stdout is piped)",
|
|
@@ -172,6 +178,12 @@
|
|
|
172
178
|
"hasDynamicHelp": false,
|
|
173
179
|
"multiple": false,
|
|
174
180
|
"type": "option"
|
|
181
|
+
},
|
|
182
|
+
"verbose": {
|
|
183
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
184
|
+
"name": "verbose",
|
|
185
|
+
"allowNo": false,
|
|
186
|
+
"type": "boolean"
|
|
175
187
|
}
|
|
176
188
|
},
|
|
177
189
|
"hasDynamicHelp": false,
|
|
@@ -251,6 +263,12 @@
|
|
|
251
263
|
"hasDynamicHelp": false,
|
|
252
264
|
"multiple": false,
|
|
253
265
|
"type": "option"
|
|
266
|
+
},
|
|
267
|
+
"verbose": {
|
|
268
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
269
|
+
"name": "verbose",
|
|
270
|
+
"allowNo": false,
|
|
271
|
+
"type": "boolean"
|
|
254
272
|
}
|
|
255
273
|
},
|
|
256
274
|
"hasDynamicHelp": false,
|
|
@@ -307,6 +325,12 @@
|
|
|
307
325
|
"hasDynamicHelp": false,
|
|
308
326
|
"multiple": false,
|
|
309
327
|
"type": "option"
|
|
328
|
+
},
|
|
329
|
+
"verbose": {
|
|
330
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
331
|
+
"name": "verbose",
|
|
332
|
+
"allowNo": false,
|
|
333
|
+
"type": "boolean"
|
|
310
334
|
}
|
|
311
335
|
},
|
|
312
336
|
"hasDynamicHelp": false,
|
|
@@ -369,6 +393,12 @@
|
|
|
369
393
|
"multiple": false,
|
|
370
394
|
"type": "option"
|
|
371
395
|
},
|
|
396
|
+
"verbose": {
|
|
397
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
398
|
+
"name": "verbose",
|
|
399
|
+
"allowNo": false,
|
|
400
|
+
"type": "boolean"
|
|
401
|
+
},
|
|
372
402
|
"full": {
|
|
373
403
|
"description": "Fetch the expanded llms-full.txt narrative instead of the concise llms.txt.",
|
|
374
404
|
"name": "full",
|
|
@@ -436,6 +466,12 @@
|
|
|
436
466
|
"hasDynamicHelp": false,
|
|
437
467
|
"multiple": false,
|
|
438
468
|
"type": "option"
|
|
469
|
+
},
|
|
470
|
+
"verbose": {
|
|
471
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
472
|
+
"name": "verbose",
|
|
473
|
+
"allowNo": false,
|
|
474
|
+
"type": "boolean"
|
|
439
475
|
}
|
|
440
476
|
},
|
|
441
477
|
"hasDynamicHelp": false,
|
|
@@ -492,6 +528,12 @@
|
|
|
492
528
|
"hasDynamicHelp": false,
|
|
493
529
|
"multiple": false,
|
|
494
530
|
"type": "option"
|
|
531
|
+
},
|
|
532
|
+
"verbose": {
|
|
533
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
534
|
+
"name": "verbose",
|
|
535
|
+
"allowNo": false,
|
|
536
|
+
"type": "boolean"
|
|
495
537
|
}
|
|
496
538
|
},
|
|
497
539
|
"hasDynamicHelp": false,
|
|
@@ -512,7 +554,12 @@
|
|
|
512
554
|
"login": {
|
|
513
555
|
"aliases": [],
|
|
514
556
|
"args": {},
|
|
515
|
-
"description": "Verify an API key and store it in ~/.agledger/config.json (0600)",
|
|
557
|
+
"description": "Verify an API key, or an OIDC token source with --oidc, and store it in ~/.agledger/config.json (0600)",
|
|
558
|
+
"examples": [
|
|
559
|
+
"<%= config.bin %> login --api-url https://agledger.internal --api-key agl_agt_... --profile prod",
|
|
560
|
+
"<%= config.bin %> login --oidc --api-url https://agledger.internal --oidc-token-cmd 'gcloud auth print-identity-token --audiences=agledger'",
|
|
561
|
+
"<%= config.bin %> login --oidc --api-url https://agledger.internal --oidc-token-file /var/run/secrets/tokens/agledger"
|
|
562
|
+
],
|
|
516
563
|
"flags": {
|
|
517
564
|
"json": {
|
|
518
565
|
"description": "Force JSON output (default when stdout is piped)",
|
|
@@ -549,6 +596,42 @@
|
|
|
549
596
|
"hasDynamicHelp": false,
|
|
550
597
|
"multiple": false,
|
|
551
598
|
"type": "option"
|
|
599
|
+
},
|
|
600
|
+
"verbose": {
|
|
601
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
602
|
+
"name": "verbose",
|
|
603
|
+
"allowNo": false,
|
|
604
|
+
"type": "boolean"
|
|
605
|
+
},
|
|
606
|
+
"oidc": {
|
|
607
|
+
"description": "Store an OIDC token source instead of an API key. A token command is verified by one cert exchange and a GET /v1/auth/me before it is saved. A token file is only checked to hold a JWT: the Server exchanges each token once, so exchanging it here would leave the next command a spent token until the file rotates.",
|
|
608
|
+
"name": "oidc",
|
|
609
|
+
"allowNo": false,
|
|
610
|
+
"type": "boolean"
|
|
611
|
+
},
|
|
612
|
+
"oidc-token-cmd": {
|
|
613
|
+
"description": "With --oidc: a shell command whose stdout is an OIDC JWT, run on every cert exchange.",
|
|
614
|
+
"env": "AGLEDGER_OIDC_TOKEN_CMD",
|
|
615
|
+
"name": "oidc-token-cmd",
|
|
616
|
+
"hasDynamicHelp": false,
|
|
617
|
+
"multiple": false,
|
|
618
|
+
"type": "option"
|
|
619
|
+
},
|
|
620
|
+
"oidc-token-file": {
|
|
621
|
+
"description": "With --oidc: a file holding an OIDC JWT, read on every cert exchange (a projected token in a pod).",
|
|
622
|
+
"env": "AGLEDGER_OIDC_TOKEN_FILE",
|
|
623
|
+
"name": "oidc-token-file",
|
|
624
|
+
"hasDynamicHelp": false,
|
|
625
|
+
"multiple": false,
|
|
626
|
+
"type": "option"
|
|
627
|
+
},
|
|
628
|
+
"oidc-agent-id": {
|
|
629
|
+
"description": "With --oidc: an optional assertion of the agent id the token binds to. The token decides the agent, never this value: when it names a different agent, or the token binds none, the exchange fails 403 CERT_AGENT_BINDING_MISMATCH instead of issuing a cert. To bind an agent, an administrator sets oidcIss/oidcSub on it (PATCH /v1/agents/{id}) or maps an agent_id claim on the trusted issuer (claimMapping.agent_id).",
|
|
630
|
+
"env": "AGLEDGER_OIDC_AGENT_ID",
|
|
631
|
+
"name": "oidc-agent-id",
|
|
632
|
+
"hasDynamicHelp": false,
|
|
633
|
+
"multiple": false,
|
|
634
|
+
"type": "option"
|
|
552
635
|
}
|
|
553
636
|
},
|
|
554
637
|
"hasDynamicHelp": false,
|
|
@@ -569,7 +652,12 @@
|
|
|
569
652
|
"logout": {
|
|
570
653
|
"aliases": [],
|
|
571
654
|
"args": {},
|
|
572
|
-
"description": "Remove a stored profile from ~/.agledger/config.json",
|
|
655
|
+
"description": "Remove a stored profile from ~/.agledger/config.json: the active profile, the one named by --profile, or every profile with --all. Exits 2 when there is no such profile to remove. Removing the active profile leaves none active: pick another with `config use`.",
|
|
656
|
+
"examples": [
|
|
657
|
+
"<%= config.bin %> logout",
|
|
658
|
+
"<%= config.bin %> logout --profile prod",
|
|
659
|
+
"<%= config.bin %> logout --all"
|
|
660
|
+
],
|
|
573
661
|
"flags": {
|
|
574
662
|
"json": {
|
|
575
663
|
"description": "Force JSON output (default when stdout is piped)",
|
|
@@ -600,13 +688,18 @@
|
|
|
600
688
|
"type": "option"
|
|
601
689
|
},
|
|
602
690
|
"profile": {
|
|
603
|
-
"description": "Profile name to remove",
|
|
691
|
+
"description": "Profile name to remove (default: the active profile)",
|
|
604
692
|
"name": "profile",
|
|
605
|
-
"default": "default",
|
|
606
693
|
"hasDynamicHelp": false,
|
|
607
694
|
"multiple": false,
|
|
608
695
|
"type": "option"
|
|
609
696
|
},
|
|
697
|
+
"verbose": {
|
|
698
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
699
|
+
"name": "verbose",
|
|
700
|
+
"allowNo": false,
|
|
701
|
+
"type": "boolean"
|
|
702
|
+
},
|
|
610
703
|
"all": {
|
|
611
704
|
"description": "Remove all profiles",
|
|
612
705
|
"name": "all",
|
|
@@ -634,14 +727,15 @@
|
|
|
634
727
|
"args": {
|
|
635
728
|
"file": {
|
|
636
729
|
"description": "Path to the audit export JSON file (or \"-\" for stdin).",
|
|
637
|
-
"name": "file"
|
|
638
|
-
"required": true
|
|
730
|
+
"name": "file"
|
|
639
731
|
}
|
|
640
732
|
},
|
|
641
733
|
"description": "Verify a record audit export offline (COSE_Sign1 envelope, RFC 9052; Ed25519 or ES256).",
|
|
642
734
|
"examples": [
|
|
735
|
+
"<%= config.bin %> verify audit-export.json --trust-anchor sha256:<64 hex>",
|
|
643
736
|
"<%= config.bin %> verify audit-export.json",
|
|
644
737
|
"<%= config.bin %> verify audit-export.json --keys vault-keys.json",
|
|
738
|
+
"<%= config.bin %> verify audit-export.json --agent-keys agent-jwks.json",
|
|
645
739
|
"<%= config.bin %> verify audit-export.json --json",
|
|
646
740
|
"cat audit-export.json | <%= config.bin %> verify -"
|
|
647
741
|
],
|
|
@@ -681,13 +775,40 @@
|
|
|
681
775
|
"multiple": false,
|
|
682
776
|
"type": "option"
|
|
683
777
|
},
|
|
778
|
+
"verbose": {
|
|
779
|
+
"description": "Report which credential was used, and each OIDC cert exchange, as JSON lines on stderr. Never prints a key, token or cert.",
|
|
780
|
+
"name": "verbose",
|
|
781
|
+
"allowNo": false,
|
|
782
|
+
"type": "boolean"
|
|
783
|
+
},
|
|
684
784
|
"keys": {
|
|
685
|
-
"description": "Path to a JSON file holding
|
|
785
|
+
"description": "Path to a JSON file holding public keys you supply. Accepts a {keyId: SPKI-DER-base64} map, a [{keyId, publicKey, ...}] list, or the raw GET /v1/verification-keys response envelope ({data:[...], ...}, the .data array is unwrapped automatically, and each key's signed statements are walked with --trust-anchor). Merged over any keys embedded in the export. Where a key came from is not whether it is trusted: that is --trust-anchor.",
|
|
686
786
|
"name": "keys",
|
|
687
787
|
"hasDynamicHelp": false,
|
|
688
788
|
"multiple": false,
|
|
689
789
|
"type": "option"
|
|
690
790
|
},
|
|
791
|
+
"trust-anchor": {
|
|
792
|
+
"description": "sha256:<64 hex> SPKI digest of a vault key you took out of band (the installer prints the first vault key's; the Server's signing-key-digest.js derives one from any key you hold). The signed key statements the export carries are walked from it: an entry signed by a key the walk does not reach fails CHAIN_SIGNING_KEY_UNANCHORED, and a statement that does not hold fails KEY_STATEMENT_INVALID, KEY_CLOSURE_INVALID or CHAIN_KEY_WINDOW_DRIFT. Without one, a pass rests on keys nobody pinned. Repeatable.",
|
|
793
|
+
"name": "trust-anchor",
|
|
794
|
+
"hasDynamicHelp": false,
|
|
795
|
+
"multiple": true,
|
|
796
|
+
"type": "option"
|
|
797
|
+
},
|
|
798
|
+
"distrusted-key": {
|
|
799
|
+
"description": "sha256:<64 hex>, optionally @<RFC 3339 instant>: a key the operator distrusts, as in the Server's VAULT_DISTRUSTED_KEYS. What it signed from that instant (with none, from its retirement) counts for nothing in the walk. Requires --trust-anchor. A dated entry may name a key also given to --trust-anchor, which then vouches for what it signed before the instant. Where an export lists a key retired at the instant the Server distrusts it from (distrustedFrom), earlier than its signed retirement, a run without the same entry fails on that window, and the finding names the --distrusted-key to confirm with the Server's operator. Repeatable.",
|
|
800
|
+
"name": "distrusted-key",
|
|
801
|
+
"hasDynamicHelp": false,
|
|
802
|
+
"multiple": true,
|
|
803
|
+
"type": "option"
|
|
804
|
+
},
|
|
805
|
+
"agent-keys": {
|
|
806
|
+
"description": "Path to a JSON file holding Ed25519 public keys of agent certs: a JWK, a list of JWKs, or a {keys:[...]} JWK Set (an entry may wrap its key as {publicKeyJwk:{...}}). Each is the publicKeyJwk an agent sent at cert exchange (also the cnf.jwk claim in its certJws). An entry whose sealed agent signature names one of them by thumbprint has that signature re-verified offline, and fails CHAIN_AGENT_SIGNATURE_INVALID if it does not verify.",
|
|
807
|
+
"name": "agent-keys",
|
|
808
|
+
"hasDynamicHelp": false,
|
|
809
|
+
"multiple": false,
|
|
810
|
+
"type": "option"
|
|
811
|
+
},
|
|
691
812
|
"require-key-id": {
|
|
692
813
|
"description": "Require every entry to reference this keyId. Rejects otherwise-valid exports signed by a retired or unexpected key.",
|
|
693
814
|
"name": "require-key-id",
|
|
@@ -695,11 +816,24 @@
|
|
|
695
816
|
"multiple": false,
|
|
696
817
|
"type": "option"
|
|
697
818
|
},
|
|
819
|
+
"distrusted-keys": {
|
|
820
|
+
"hidden": true,
|
|
821
|
+
"name": "distrusted-keys",
|
|
822
|
+
"hasDynamicHelp": false,
|
|
823
|
+
"multiple": false,
|
|
824
|
+
"type": "option"
|
|
825
|
+
},
|
|
698
826
|
"require-out-of-band-keys": {
|
|
699
|
-
"
|
|
827
|
+
"hidden": true,
|
|
700
828
|
"name": "require-out-of-band-keys",
|
|
701
829
|
"allowNo": false,
|
|
702
830
|
"type": "boolean"
|
|
831
|
+
},
|
|
832
|
+
"require-supplied-keys": {
|
|
833
|
+
"description": "Refuse keys embedded in the export: an entry whose only key is export-embedded fails CHAIN_KEY_POLICY_VIOLATION, so every signature is checked against a key from --keys.",
|
|
834
|
+
"name": "require-supplied-keys",
|
|
835
|
+
"allowNo": false,
|
|
836
|
+
"type": "boolean"
|
|
703
837
|
}
|
|
704
838
|
},
|
|
705
839
|
"hasDynamicHelp": false,
|
|
@@ -709,6 +843,7 @@
|
|
|
709
843
|
"pluginName": "@agledger/cli",
|
|
710
844
|
"pluginType": "core",
|
|
711
845
|
"strict": true,
|
|
846
|
+
"usage": "verify FILE [--trust-anchor <value>...] [--distrusted-key <value>...] [--keys <value>] [--agent-keys <value>] [--require-key-id <value>] [--require-supplied-keys] [--json] [--quiet]",
|
|
712
847
|
"enableJsonFlag": false,
|
|
713
848
|
"isESM": true,
|
|
714
849
|
"relativePath": [
|
|
@@ -718,5 +853,5 @@
|
|
|
718
853
|
]
|
|
719
854
|
}
|
|
720
855
|
},
|
|
721
|
-
"version": "
|
|
856
|
+
"version": "2.0.0"
|
|
722
857
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agledger/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "AGLedger CLI: developer and agent interface for AGLedger",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prepublishOnly": "npm run build && npm run lint:pkg"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agledger/verify-core": "^
|
|
34
|
+
"@agledger/verify-core": "^2.0.0",
|
|
35
35
|
"@oclif/core": "^5.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|