@peac/cli 0.12.5 → 0.12.7

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/README.md CHANGED
@@ -1,28 +1,66 @@
1
1
  # @peac/cli
2
2
 
3
- PEAC protocol command-line tools.
3
+ PEAC protocol command-line tools for receipt verification, decoding, policy management, conformance testing, and evidence reconciliation.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
8
  pnpm add -g @peac/cli
9
- # or
10
- npx @peac/cli
11
9
  ```
12
10
 
13
- ## Commands
11
+ Or run directly without installing:
14
12
 
15
- ### `peac verify <receipt>`
13
+ ```bash
14
+ npx @peac/cli verify <receipt.jws>
15
+ ```
16
+
17
+ ## What It Does
18
+
19
+ `@peac/cli` provides the `peac` command for working with signed interaction receipts from the terminal. It supports verifying receipt signatures, decoding receipt contents, validating issuer configurations, managing policies, running conformance test suites, generating sample receipts, and reconciling evidence bundles.
20
+
21
+ ## How Do I Use It?
22
+
23
+ ### Verify a receipt
24
+
25
+ ```bash
26
+ peac verify <jws>
27
+ peac verify receipt.jws --verbose
28
+ ```
16
29
 
17
- Verify a PEAC receipt (JWS compact serialization).
30
+ Decodes the receipt, displays claims (issuer, audience, amount, payment rail), and verifies the cryptographic signature. Exit code 0 on success, 1 on failure.
31
+
32
+ ### Decode a receipt without verification
18
33
 
19
34
  ```bash
20
- peac verify eyJhbGciOiJFZERTQSIs...
35
+ peac decode <jws>
36
+ peac decode receipt.jws --json
21
37
  ```
22
38
 
23
- ### `peac conformance run`
39
+ Parses and displays the JWS header and claims payload without checking the signature. Use `--json` for machine-readable output.
24
40
 
25
- Run conformance tests against PEAC schema validators.
41
+ ### Validate an issuer configuration
42
+
43
+ ```bash
44
+ peac validate-issuer path/to/peac-issuer.json
45
+ peac validate-issuer https://example.com
46
+ ```
47
+
48
+ Validates a `peac-issuer.json` file or fetches and validates one from an issuer URL. Displays issuer metadata including JWKS URI, supported algorithms, and payment rails.
49
+
50
+ ### Policy management
51
+
52
+ ```bash
53
+ peac policy init # Create a new policy file
54
+ peac policy validate policy.yaml # Validate policy syntax
55
+ peac policy explain policy.yaml # Debug rule matching
56
+ peac policy generate policy.yaml # Compile to deployment artifacts
57
+ peac policy list-profiles # List available policy profiles
58
+ peac policy show-profile <name> # Show profile details
59
+ ```
60
+
61
+ Use `--json` for machine-readable output, `--yes` to skip prompts, `--strict` to exit non-zero on warnings.
62
+
63
+ ### Run conformance tests
26
64
 
27
65
  ```bash
28
66
  peac conformance run # Standard level, text output
@@ -33,57 +71,45 @@ peac conformance run --category claims # Filter by category
33
71
  peac conformance run --fixtures ./my-vectors # Custom fixtures path
34
72
  ```
35
73
 
36
- **Options:**
37
-
38
- | Option | Default | Description |
39
- | ------------ | ---------- | -------------------------------------------------------- |
40
- | `--level` | `standard` | Conformance level: `basic`, `standard`, `full` |
41
- | `--output` | `text` | Output format: `text`, `json`, `markdown` |
42
- | `--category` | all | Filter by category (e.g., `claims`, `signature`, `time`) |
43
- | `--fixtures` | built-in | Path to custom conformance fixtures |
44
- | `--verbose` | `false` | Show detailed test output |
45
-
46
- ### `peac conformance list`
47
-
48
- List available conformance test fixtures.
74
+ ### List conformance fixtures
49
75
 
50
76
  ```bash
51
77
  peac conformance list
52
78
  peac conformance list --category claims
53
79
  ```
54
80
 
55
- ### `peac samples list`
56
-
57
- List available sample receipts.
81
+ ### Reconcile evidence bundles
58
82
 
59
83
  ```bash
60
- peac samples list
61
- peac samples list --category valid
84
+ peac reconcile <bundle-a.json> <bundle-b.json>
62
85
  ```
63
86
 
64
- ### `peac samples show <id>`
87
+ Merges two evidence bundles and detects conflicts using composite `(iss, jti)` keys with fallback resolution. Conflicts are surfaced for human decision; no auto-resolution.
65
88
 
66
- Display details of a specific sample receipt.
89
+ ### Generate sample receipts
67
90
 
68
91
  ```bash
69
- peac samples show basic-receipt
92
+ peac samples list # List available samples
93
+ peac samples show basic-receipt # Show a specific sample
94
+ peac samples generate --output ./out # Generate sample files
70
95
  ```
71
96
 
72
- ### `peac samples generate`
97
+ ## Integrates With
73
98
 
74
- Generate sample receipt files.
99
+ - `@peac/protocol` (Layer 3): Receipt verification and issuance
100
+ - `@peac/crypto` (Layer 2): JWS decoding and signature operations
101
+ - `@peac/schema` (Layer 1): Receipt schema validation
102
+ - `@peac/audit`: Evidence bundle reading for reconciliation
103
+ - `@peac/disc`: Issuer discovery
104
+ - `@peac/policy-kit`: Policy loading, validation, and compilation
75
105
 
76
- ```bash
77
- peac samples generate --output ./samples
78
- peac samples generate --format json
79
- ```
106
+ ## For Agent Developers
107
+
108
+ If you are building AI agents that produce or consume signed receipts, the CLI is useful for inspecting receipts during development and debugging. For programmatic integration, use `@peac/protocol` directly. For MCP-based tool integration, use [`@peac/mcp-server`](https://www.npmjs.com/package/@peac/mcp-server).
80
109
 
81
- **Options:**
110
+ ## For Operators
82
111
 
83
- | Option | Default | Description |
84
- | ---------- | -------- | ------------------------------------ |
85
- | `--output` | `stdout` | Output directory for generated files |
86
- | `--format` | `jws` | Format: `jws`, `json` |
112
+ The CLI supports operator workflows including policy authoring (`peac policy init`), issuer configuration validation (`peac validate-issuer`), conformance testing (`peac conformance run`), and evidence reconciliation (`peac reconcile`). Use `--json` flags for integration with CI pipelines and monitoring systems.
87
113
 
88
114
  ## License
89
115
 
package/dist/index.cjs CHANGED
@@ -2124,7 +2124,7 @@ samples.command("generate").description("Generate sample receipt files").require
2124
2124
  $comment: sample.description,
2125
2125
  header: {
2126
2126
  alg: "EdDSA",
2127
- typ: "peac-receipt/0.1",
2127
+ typ: "interaction-record+jwt",
2128
2128
  kid
2129
2129
  },
2130
2130
  payload: adjustedClaims,