@catena/cli 0.8.0 → 0.10.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/README.md CHANGED
@@ -7,12 +7,12 @@ and submit policy-checked money movement intents.
7
7
  Run it without installing:
8
8
 
9
9
  ```bash
10
- pnpm dlx @catena/cli <command> [args]
10
+ npx @catena/cli <command> [args]
11
11
  ```
12
12
 
13
- The package exposes the `catena` binary. Examples use `pnpm dlx @catena/cli` so
14
- they work directly from npm; pnpm selects `catena` because it is the package's
15
- only executable.
13
+ The package exposes the `catena` binary. Examples use `npx @catena/cli` so they
14
+ work directly from npm; npx selects `catena` because it is the package's only
15
+ executable.
16
16
 
17
17
  ## How it works
18
18
 
@@ -24,8 +24,31 @@ tools such as `jq`; pass `--json` to print compact single-line JSON instead.
24
24
  `unlink` revokes only the selected profile's server link and removes that
25
25
  profile's local credential.
26
26
 
27
- By default the CLI talks to `https://api.catena.com`. Set `CATENA_API_URL` when
28
- you need to target another Catena environment.
27
+ ## Hosts without a keychain
28
+
29
+ A container, a CI job, or a serverless runtime has no OS keychain and no
30
+ browser, so `link` cannot store a credential there. Set `CATENA_SECRET_KEY` to
31
+ the agent's P-256 secret key instead:
32
+
33
+ ```bash
34
+ CATENA_SECRET_KEY="<64 hex characters>" npx @catena/cli whoami
35
+ ```
36
+
37
+ Create the key in the Catena console: open the agent, select the **Secret keys**
38
+ tab, then **Create secret key**. The console shows it one time. `@catena/sdk`
39
+ reads the same variable, so one key serves either client. Set the value with no
40
+ surrounding whitespace: the CLI trims it, and the SDK does not.
41
+
42
+ While the key is set, `profiles current` reports `source: "secret-key"` with no
43
+ `.profile` field, and `profiles list` adds `shadowedBy` and marks every profile
44
+ `current: false`.
45
+
46
+ On a machine that also holds a linked profile or sets `CATENA_PROFILE`, every
47
+ command prints one stderr line that names the key as the signing credential.
48
+ Stdout keeps only the command result.
49
+
50
+ The key outranks every profile tier, but an explicit `--profile` still wins.
51
+ `unlink` does not apply to it; revoke the key in the console instead.
29
52
 
30
53
  ## First-time setup
31
54
 
@@ -34,14 +57,14 @@ agent id. Use `--name` to suggest a name when the console creates a new agent;
34
57
  the approving operator can edit it before approval.
35
58
 
36
59
  ```bash
37
- pnpm dlx @catena/cli link --name "Hermes Runtime"
60
+ npx @catena/cli link --name "Hermes Runtime"
38
61
  ```
39
62
 
40
63
  To link a specific existing agent, ask the Catena customer for the agent id
41
64
  shown in the Catena console. It looks like `agent_...`.
42
65
 
43
66
  ```bash
44
- pnpm dlx @catena/cli link <agent-id>
67
+ npx @catena/cli link <agent-id>
45
68
  ```
46
69
 
47
70
  The browser approval window stays open for up to 5 minutes. If the approval is
@@ -49,11 +72,10 @@ denied or times out, run the command again.
49
72
 
50
73
  Useful flags:
51
74
 
52
- | Flag | Description | Default |
53
- | ------------ | ------------------------------------------------------- | ------------------------------- |
54
- | `--bank-url` | Bank API URL. | `$CATENA_API_URL` or prod |
55
- | `--name` | Suggested name when creating an agent from the console. | none |
56
- | `--profile` | Credential profile name. | configured default or `default` |
75
+ | Flag | Description | Default |
76
+ | ----------- | ------------------------------------------------------- | ------------------------------- |
77
+ | `--name` | Suggested name when creating an agent from the console. | none |
78
+ | `--profile` | Credential profile name. | configured default or `default` |
57
79
 
58
80
  ## Commands
59
81
 
@@ -63,8 +85,8 @@ Connect the selected profile to an agent. Omit `agent-id` to create or choose an
63
85
  agent from the Catena console.
64
86
 
65
87
  ```bash
66
- pnpm dlx @catena/cli link --name "Hermes Runtime"
67
- pnpm dlx @catena/cli link <agent-id>
88
+ npx @catena/cli link --name "Hermes Runtime"
89
+ npx @catena/cli link <agent-id>
68
90
  ```
69
91
 
70
92
  ### `unlink`
@@ -72,7 +94,7 @@ pnpm dlx @catena/cli link <agent-id>
72
94
  Disconnect the selected profile from its agent and remove its local credential.
73
95
 
74
96
  ```bash
75
- pnpm dlx @catena/cli unlink
97
+ npx @catena/cli unlink
76
98
  ```
77
99
 
78
100
  ### `profiles current`
@@ -80,7 +102,7 @@ pnpm dlx @catena/cli unlink
80
102
  Show the selected credential profile and its routing metadata.
81
103
 
82
104
  ```bash
83
- pnpm dlx @catena/cli profiles current
105
+ npx @catena/cli profiles current
84
106
  ```
85
107
 
86
108
  ### `profiles list`
@@ -88,7 +110,7 @@ pnpm dlx @catena/cli profiles current
88
110
  List linked credential profiles and mark the selected default profile.
89
111
 
90
112
  ```bash
91
- pnpm dlx @catena/cli profiles list
113
+ npx @catena/cli profiles list
92
114
  ```
93
115
 
94
116
  ### `profiles use <profile>`
@@ -96,7 +118,7 @@ pnpm dlx @catena/cli profiles list
96
118
  Set the selected default profile. The profile must already be linked.
97
119
 
98
120
  ```bash
99
- pnpm dlx @catena/cli profiles use mcp
121
+ npx @catena/cli profiles use mcp
100
122
  ```
101
123
 
102
124
  ### `whoami`
@@ -104,7 +126,7 @@ pnpm dlx @catena/cli profiles use mcp
104
126
  Show which agent the selected profile is linked to.
105
127
 
106
128
  ```bash
107
- pnpm dlx @catena/cli whoami
129
+ npx @catena/cli whoami
108
130
  ```
109
131
 
110
132
  ### `policy show`
@@ -113,7 +135,7 @@ Show the policy assigned to the linked agent. Read this before creating
113
135
  counterparties or submitting intents.
114
136
 
115
137
  ```bash
116
- pnpm dlx @catena/cli policy show
138
+ npx @catena/cli policy show
117
139
  ```
118
140
 
119
141
  The policy includes `policyCapabilities` rows. Each row grants one `read`,
@@ -126,7 +148,7 @@ counterparty creation.
126
148
  Ask a person to approve a temporary increase to one policy limit.
127
149
 
128
150
  ```bash
129
- pnpm dlx @catena/cli policy request-override \
151
+ npx @catena/cli policy request-override \
130
152
  --account acct_... \
131
153
  --amount 500 \
132
154
  --duration 4h \
@@ -153,14 +175,15 @@ Fetch an MPP-protected HTTP endpoint and pay a supported USDC charge from a
153
175
  wallet account:
154
176
 
155
177
  ```bash
156
- pnpm dlx @catena/cli mpp --url https://api.example.com/paid \
178
+ npx @catena/cli mpp --url https://api.example.com/paid \
157
179
  --account acct_... --max-amount 0.25
158
180
  ```
159
181
 
160
- Initial support covers `evm/charge` and `usdc/charge` for native USDC on Base
161
- and Base Sepolia. Payments use the agent's normal send capability, counterparty
162
- allowlist, spend limits, and approval flow. The recipient must already be a
163
- saved counterparty wallet rail.
182
+ The CLI recognizes structurally valid EVM `evm/charge` and `usdc/charge`
183
+ challenges and leaves network and canonical USDC support to the connected
184
+ server. Current support includes Base and Base Sepolia. Payments use the agent's
185
+ normal send capability, counterparty allowlist, spend limits, and approval flow.
186
+ The recipient must already be a saved counterparty wallet rail.
164
187
 
165
188
  The command accepts the same request-body, header, output, profile, and JSON
166
189
  flags as `x402`; run `mpp --help` for details. If approval is required, approve
@@ -173,7 +196,7 @@ retrying so the resource is not paid twice.
173
196
  List the accounts available under the agent's policy.
174
197
 
175
198
  ```bash
176
- pnpm dlx @catena/cli accounts list
199
+ npx @catena/cli accounts list
177
200
  ```
178
201
 
179
202
  ### `counterparties list`
@@ -182,7 +205,7 @@ List counterparties, their status, and their rails. Use rail ids from this
182
205
  output with `send`.
183
206
 
184
207
  ```bash
185
- pnpm dlx @catena/cli counterparties list
208
+ npx @catena/cli counterparties list
186
209
  ```
187
210
 
188
211
  ### `counterparties create`
@@ -192,7 +215,7 @@ saves the counterparty without sending an email. The command returns an intent
192
215
  envelope; policy may complete it, block it, or route it to approval.
193
216
 
194
217
  ```bash
195
- pnpm dlx @catena/cli counterparties create \
218
+ npx @catena/cli counterparties create \
196
219
  --name "Acme Vendor" \
197
220
  --email billing@acme.test
198
221
  ```
@@ -210,7 +233,7 @@ Request creation of a bank-rail counterparty. The command returns an intent
210
233
  envelope; policy may complete it, block it, or route it to approval.
211
234
 
212
235
  ```bash
213
- pnpm dlx @catena/cli counterparties create bank \
236
+ npx @catena/cli counterparties create bank \
214
237
  --name "Acme Vendor" \
215
238
  --bank-name "Chase" \
216
239
  --routing-number 021000021 \
@@ -234,15 +257,15 @@ Request creation of a wallet-rail counterparty. The command returns an intent
234
257
  envelope; policy may complete it, block it, or route it to approval.
235
258
 
236
259
  ```bash
237
- pnpm dlx @catena/cli counterparties create wallet \
260
+ npx @catena/cli counterparties create wallet \
238
261
  --name "DAO Treasury" \
239
262
  --address 0xAbC123...
240
263
  ```
241
264
 
242
265
  Required flags: `--name`, `--address`.
243
266
 
244
- Optional flags: `--network` (defaults to `base`; Base is the only supported
245
- wallet network), `--email`, `--idempotency-key`.
267
+ Optional flags: `--network` (defaults to `base`; availability depends on the
268
+ connected environment), `--email`, `--idempotency-key`.
246
269
 
247
270
  ### `counterparties request-details`
248
271
 
@@ -250,7 +273,7 @@ Ask an existing counterparty to provide bank details, wallet details, or both.
250
273
  The request follows policy and may require human approval.
251
274
 
252
275
  ```bash
253
- pnpm dlx @catena/cli counterparties request-details cp_... --bank
276
+ npx @catena/cli counterparties request-details cp_... --bank
254
277
  ```
255
278
 
256
279
  Pass at least one of `--bank` or `--wallet`. `--idempotency-key` is optional.
@@ -261,7 +284,7 @@ The outstanding-invitation conflict remains independent of idempotency.
261
284
  Request a USD send to a counterparty rail.
262
285
 
263
286
  ```bash
264
- pnpm dlx @catena/cli send \
287
+ npx @catena/cli send \
265
288
  --rail cprl_... \
266
289
  --amount 125.00 \
267
290
  --method ach
@@ -296,7 +319,7 @@ when its inputs match an earlier command.
296
319
  Request a USD transfer between two accounts visible to the agent.
297
320
 
298
321
  ```bash
299
- pnpm dlx @catena/cli transfer \
322
+ npx @catena/cli transfer \
300
323
  --from acct_... \
301
324
  --to acct_... \
302
325
  --amount 125.00
@@ -315,7 +338,7 @@ when its inputs match an earlier command.
315
338
  Read an account balance through the policy engine.
316
339
 
317
340
  ```bash
318
- pnpm dlx @catena/cli accounts balance acct_...
341
+ npx @catena/cli accounts balance acct_...
319
342
  ```
320
343
 
321
344
  ### `accounts transactions`
@@ -325,7 +348,7 @@ same read access as `accounts balance` and never creates an intent. Returns
325
348
  `{ accountId, transactions, total }` newest-first.
326
349
 
327
350
  ```bash
328
- pnpm dlx @catena/cli accounts transactions acct_...
351
+ npx @catena/cli accounts transactions acct_...
329
352
  ```
330
353
 
331
354
  Optional flags: `--start` / `--end` (ISO 8601 bounds), `--limit` (default 50,
@@ -338,7 +361,7 @@ Read an account deposit address through the policy engine. `--network` and
338
361
  `--asset` default to `base` and `usdc`.
339
362
 
340
363
  ```bash
341
- pnpm dlx @catena/cli accounts deposit-address acct_... --network base --asset usdc
364
+ npx @catena/cli accounts deposit-address acct_... --network base --asset usdc
342
365
  ```
343
366
 
344
367
  ### `intents get`
@@ -346,7 +369,7 @@ pnpm dlx @catena/cli accounts deposit-address acct_... --network base --asset us
346
369
  Look up the current state of an intent created by this agent.
347
370
 
348
371
  ```bash
349
- pnpm dlx @catena/cli intents get int_...
372
+ npx @catena/cli intents get int_...
350
373
  ```
351
374
 
352
375
  The response includes a `data` field carrying the associated result once one
@@ -367,9 +390,9 @@ stdin. Use stdin (or `--` before the argument) when the message starts with `-`
367
390
  or spans multiple lines.
368
391
 
369
392
  ```bash
370
- pnpm dlx @catena/cli feedback "The transfer flow worked great"
393
+ npx @catena/cli feedback "The transfer flow worked great"
371
394
 
372
- pnpm dlx @catena/cli feedback <<'EOF'
395
+ npx @catena/cli feedback <<'EOF'
373
396
  - transfer failed
374
397
  - policy was confusing
375
398
  EOF
@@ -382,25 +405,26 @@ with code 1.
382
405
 
383
406
  `send` and `transfer` exit as soon as the intent is created and any immediate
384
407
  next action is submitted. Inspect the returned `.status` and `.reasons` fields,
385
- then use `pnpm dlx @catena/cli intents get <intent-id>` to check whether it
386
- later completes, requires approval, or fails.
408
+ then use `npx @catena/cli intents get <intent-id>` to check whether it later
409
+ completes, requires approval, or fails.
387
410
 
388
411
  ## Configuration
389
412
 
390
- | Variable | Purpose | Default |
391
- | ---------------- | ------------- | ------------------------ |
392
- | `CATENA_API_URL` | Bank API URL. | `https://api.catena.com` |
413
+ | Variable | Purpose | Default |
414
+ | ------------------- | ---------------------------------------------------- | ------- |
415
+ | `CATENA_SECRET_KEY` | Agent P-256 secret key (64 hex). Selects no profile. | none |
416
+ | `CATENA_PROFILE` | Credential profile name. | none |
393
417
 
394
418
  ## Discovering options
395
419
 
396
420
  Every command supports `--help`.
397
421
 
398
422
  ```bash
399
- pnpm dlx @catena/cli --help
400
- pnpm dlx @catena/cli send --help
401
- pnpm dlx @catena/cli counterparties create --help
402
- pnpm dlx @catena/cli counterparties create email --help
403
- pnpm dlx @catena/cli counterparties create bank --help
404
- pnpm dlx @catena/cli counterparties create wallet --help
405
- pnpm dlx @catena/cli counterparties request-details --help
423
+ npx @catena/cli --help
424
+ npx @catena/cli send --help
425
+ npx @catena/cli counterparties create --help
426
+ npx @catena/cli counterparties create email --help
427
+ npx @catena/cli counterparties create bank --help
428
+ npx @catena/cli counterparties create wallet --help
429
+ npx @catena/cli counterparties request-details --help
406
430
  ```