@capxul/cli 4.20.0-beta.2 → 4.20.0-beta.21

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,7 +1,9 @@
1
1
  # Capxul CLI
2
2
 
3
- The CLI provides local diagnostics, an online backend check, and one global
4
- collection preference. It requires Node 24 or later on macOS or Linux.
3
+ The CLI provides email OTP login, persistent first-party sessions, terminal-owned
4
+ signup, personal and Organization contacts, a bundled Openfort wallet page,
5
+ backend profile and account reads, diagnostics, and one global collection
6
+ preference. It requires Node 24 or later on macOS or Linux.
5
7
 
6
8
  ```sh
7
9
  capxul --help
@@ -14,27 +16,741 @@ capxul telemetry enable --json
14
16
  capxul doctor --online --timeout-ms 30000 --json
15
17
  ```
16
18
 
17
- Help, version, and completion do not read configuration or contact a server.
19
+ Help and version do not require application credentials or a working backend.
20
+ With no arguments, `capxul` shows the same generated help as `capxul --help`.
21
+ They use the same observation policy as ordinary commands. Shell completion
22
+ machinery and collection controls send no observation records.
18
23
  `doctor` checks local configuration unless `--online` is present. An online
19
24
  check uses the public Capxul SDK and verifies the backend response nonce.
20
25
  It does not authenticate a person or submit a transaction.
21
26
 
27
+ ## Guided terminal input
28
+
29
+ In a human terminal, these commands collect missing required fields one step at
30
+ a time:
31
+
32
+ ```sh
33
+ capxul org permission change
34
+ capxul org member invite
35
+ capxul org payment get
36
+ capxul document get
37
+ ```
38
+
39
+ Supplied valid values remain in the command. Preview and confirmation still
40
+ apply to writes. `--wizard` provides an explicit entry to the same native input
41
+ flow. Ctrl+C or Ctrl+D cancels with exit 130. Bare groups show help. JSON, CI,
42
+ and noninteractive runs require their declared input and do not prompt.
43
+
44
+ ## Waiting output
45
+
46
+ Pending setup and observation commands show a waiting message. Human terminals
47
+ also show an activity indicator. The indicator stops before a prompt or final
48
+ result. Noninteractive human output uses text without animation.
49
+
50
+ Payment, Payroll, Permission, Organization, and Invitation waits print observed
51
+ state changes on stderr. JSON mode uses declared progress objects on stderr and
52
+ one final version 1 result on stdout. Account setup reports public signer states.
53
+ Activity shows that the CLI is waiting. It does not prove settlement or a healthy
54
+ connection. A deadline stops observation; it does not cancel a submitted operation.
55
+
56
+ ## Status overview
57
+
58
+ ```sh
59
+ capxul status
60
+ capxul status --email EMAIL --json
61
+ capxul status --org ORGANIZATION_ID
62
+ ```
63
+
64
+ `status` reads the current personal Account unless one explicit Organization
65
+ is selected with `--org`. It shows the saved session identity, selected actor
66
+ profile and readiness, separate asset balances, received and issued requests,
67
+ pending or active Payments, and five recent Activity rows. It gives scoped
68
+ commands to inspect requests and Activity. A saved Organization default does
69
+ not change the overview's personal scope.
70
+
71
+ Each source read retains its own state. An unavailable balance or Inbox is
72
+ not an empty balance or Inbox. Indexed Activity fallback is marked incomplete.
73
+ JSON returns `state: "partial"` when a read fails or Activity is incomplete.
74
+ Document counts include known references from available request and Payment
75
+ reads. Activity detail can have additional documents. The overview does not
76
+ render or download PDFs and does not prepare or submit Payments. Showing an
77
+ existing scheduled or streaming Payment does not add recurring billing.
78
+
79
+ ## Personal Payments
80
+
81
+ ```sh
82
+ capxul payment send --input payment.json --request-key REQUEST_KEY --confirm --json
83
+ capxul payment send --resume REQUEST_KEY --confirm --json
84
+ capxul payment retry --payment-id PAYMENT_ID --confirm --json
85
+ capxul payment list --json
86
+ capxul payment get --payment-id PAYMENT_ID --json
87
+ capxul payment wait --payment-id PAYMENT_ID --timeout-seconds 120 --json
88
+ ```
89
+
90
+ These commands use the current authenticated session. Add `--email EMAIL` to
91
+ select a saved session. In a terminal, omit the required Payment ID to enter it.
92
+ `list` returns `{ payments }`. `get` returns `{ payment }` and refuses when the
93
+ Payment is absent or unavailable to the session. Human output shows the full ID,
94
+ status, amount, counterparty and available receipt.
95
+
96
+ `wait` observes the exact Payment until it reaches a terminal state or needs an
97
+ action. A failed Payment can be a completed observation. The timeout accepts
98
+ 1–3600 seconds and includes session restoration. A timeout or unavailable read
99
+ prints exact get/wait commands. Waiting never resubmits a Payment.
100
+
101
+ `send` accepts a bounded JSON file or `--input -` for stdin. An interactive
102
+ send can collect the recipient, asset, amount and document options. It validates
103
+ these fields, resolves the recipient, and previews the exact target before
104
+ confirmation. A scripted send requires `--request-key` and `--confirm`. A human
105
+ send generates a key when none was supplied. Signing starts after confirmation.
106
+
107
+ The CLI saves the exact input in protected local state before preparation. It
108
+ prints the request key and resume command, then prints prepared Payment IDs
109
+ before signing. `--resume` uses that saved input and key; it refuses input or key
110
+ overrides. Keep the same CLI home and authenticated person for recovery.
111
+ A different input cannot replace the saved input for the same key.
112
+
113
+ Send returns `{ payment, requestKey }` with the observed Payment state. Retry
114
+ returns `{ payments }` and addresses the existing Payment command. It never
115
+ creates a replacement send. Uncertain results keep exact read/wait or same-key
116
+ resume guidance. A submitted result does not prove settlement.
117
+
118
+ For an external address, JSON input must include
119
+ `"externalAddressAcknowledged": true`. `--confirm` alone does not acknowledge
120
+ the address. Human input shows the exact address and an unverified-recipient
121
+ warning before one default-No confirmation. Known Capxul Parties resolved from
122
+ addresses remain supported. Resume keeps the saved reference and acknowledgement.
123
+ A saved key cannot gain new acknowledgement; use fresh input and a fresh key.
124
+
125
+ ## Activity
126
+
127
+ ```sh
128
+ capxul activity list --limit 25 --json
129
+ capxul activity get --kind payment --id PAYMENT_ID --json
130
+ capxul activity get --kind movement --id MOVEMENT_ID --json
131
+ capxul activity summary --from 1790553600000 --to 1790639999999 --json
132
+ capxul activity annotate --input annotation.json --confirm --json
133
+ ```
134
+
135
+ Add explicit `--org ORGANIZATION_ID` for Organization scope. The saved
136
+ Organization read default does not select this scope. List supports kind,
137
+ direction, status and inclusive epoch-millisecond bounds. Reuse a cursor with
138
+ the same filters and actor. An unavailable indexer produces a visible incomplete
139
+ activity warning. Movement rows remain Movements.
140
+
141
+ Summary keeps exact per-asset raw-unit totals. Get returns exact detail and
142
+ refuses a missing or unavailable reference. Annotation accepts only `reference`,
143
+ `accountingCategory` and `memo`; it cannot alter settlement or documents. Human
144
+ writes require preview and confirmation. Scripted writes require `--confirm`.
145
+ In a terminal, omit required fields for guided flags and annotation input.
146
+
147
+ ## Issued requests and received Inbox
148
+
149
+ ```sh
150
+ capxul request list
151
+ capxul request issue --input invoice.json --confirm
152
+ capxul request get --request-id REQUEST_ID
153
+ capxul request cancel --request-id REQUEST_ID --confirm
154
+ capxul inbox list
155
+ capxul inbox get --request-id REQUEST_ID
156
+ capxul inbox pay --request-id REQUEST_ID --confirm
157
+ capxul inbox decline --request-id REQUEST_ID --confirm
158
+ capxul org request list --org ORGANIZATION_ID
159
+ capxul org request issue --org ORGANIZATION_ID --input invoice.json --confirm
160
+ capxul org request get --org ORGANIZATION_ID --request-id REQUEST_ID
161
+ capxul org request cancel --org ORGANIZATION_ID --request-id REQUEST_ID --confirm
162
+ capxul org inbox list --org ORGANIZATION_ID
163
+ capxul org inbox get --org ORGANIZATION_ID --request-id REQUEST_ID
164
+ capxul org inbox pay --org ORGANIZATION_ID --request-id REQUEST_ID --permission-id PERMISSION_ID --confirm
165
+ capxul org inbox decline --org ORGANIZATION_ID --request-id REQUEST_ID --confirm
166
+ ```
167
+
168
+ `request` reads the selected actor's issued Invoice and payment requests.
169
+ `inbox` reads payment requests addressed to that actor. Organization reads
170
+ require one explicit Organization ID. Add `--email EMAIL` to select a saved
171
+ session. No signer is required for these reads.
172
+
173
+ For human reads, start with `capxul request --help` or `capxul inbox --help`.
174
+ Run `request list` for requests you issued. Run `inbox list` for requests you
175
+ received. Copy the full request ID from the list into the matching `get` command.
176
+ In a terminal, omit required fields to start guided input. Ctrl+C or Ctrl+D
177
+ cancels with exit 130. The wizard can ask about optional email selection before
178
+ required fields. Provide `--email EMAIL` when you need one saved session.
179
+
180
+ For agent reads, supply all required flags and add `--json`. Capture stdout,
181
+ stderr, and the process exit code separately. A refusal is still a version 1
182
+ result on stdout. Inspect `outcome` and `error.code`; do not infer success from
183
+ valid JSON. Missing required input exits 2. A missing authenticated session exits 3. Noninteractive human refusals use stderr. These runs do not prompt.
184
+
185
+ A missing `--org` refuses an Organization request or Inbox read before session
186
+ restoration. Supply that selector on every Organization command. Do not assume
187
+ that `org use` selects request or Inbox scope.
188
+
189
+ The [installed beta18 audit](../../docs/planning/checkout-cli/request-read-contract.md#installed-beta18-local-audit-c06)
190
+ records local help, refusal, and cancellation checks. Authenticated request
191
+ reads, document output, issuance, and payment remain separate journey checks.
192
+
193
+ Human output shows request ID, reference, amount, status, counterparty
194
+ reference, and document references. An unpaid Invoice can have a document
195
+ before any Payment exists. The document guidance preserves the selected
196
+ session. Run that explicit command to save a PDF. Request and Inbox reads do
197
+ not render or download PDFs. JSON output preserves scope, direction, and the
198
+ SDK item or list. Unavailable reads remain failures, not empty lists.
199
+
200
+ Cancel changes an issued request. Decline changes a received request. Both
201
+ commands read the exact request in the selected scope before the write.
202
+ Terminal writes show a preview and ask for confirmation. Scripted writes
203
+ require `--confirm` before session restoration. A lost write reply gives an
204
+ exact readback command in the same scope and session. It never repeats the
205
+ write. These commands start no signer and move no funds.
206
+
207
+ Issue accepts a basic payment request or an Invoice request JSON object from
208
+ `--input FILE` or `--input -`. Both require `payer` and an exact positive
209
+ `amount`. A basic request requires an explicit `reference` and accepts an
210
+ optional private `memo`. An Invoice request also supplies `invoice`.
211
+ Issue saves available document PDFs in the common directory by default.
212
+ Human and JSON output include `checkoutUrl` for an Invoice instruction with a link token.
213
+ Memo requests do not receive an Invoice checkout URL.
214
+ The PDF includes the checkout link from the authorized backend render context.
215
+ For a custom deployment, set `CAPXUL_CHECKOUT_FRONTEND_ORIGIN` in both the CLI
216
+ and backend environments. Use the same frontend origin for both.
217
+ Offer create, get, list, revise, and deactivate output also include `checkoutUrl`.
218
+ The checkout page reads current terms and status when the link opens.
219
+ Use `--output-dir DIRECTORY` to change that location. A PDF failure retains the
220
+ issued request and its document references. Do not issue it again to retry PDF
221
+ output; use the printed document render command.
222
+
223
+ ```json
224
+ {
225
+ "payer": { "kind": "email", "email": "bob@example.com" },
226
+ "amount": { "asset": "<admitted asset ID>", "value": "9" },
227
+ "invoice": {
228
+ "kind": "invoice",
229
+ "invoiceNumber": "INV-002",
230
+ "payerRef": "Bob",
231
+ "payeeRef": "Alice",
232
+ "dueAt": 1900000000000,
233
+ "note": "Thank you",
234
+ "discountMinor": "1000000",
235
+ "lineItems": [{ "description": "Consulting", "quantity": 1, "unitMinor": "10000000" }]
236
+ }
237
+ }
238
+ ```
239
+
240
+ For a basic request, omit `invoice`:
241
+
242
+ ```json
243
+ {
244
+ "payer": { "kind": "email", "email": "bob@example.com" },
245
+ "amount": { "asset": "<admitted asset ID>", "value": "9" },
246
+ "reference": "SESSION-001",
247
+ "memo": "Counselling session"
248
+ }
249
+ ```
250
+
251
+ Supply your Invoice number. The request reference defaults to that number;
252
+ optional `reference` changes the request reference only. `dueAt` uses epoch
253
+ milliseconds, as the shared Invoice document and frontend do. Set it to zero
254
+ for no due date. Optional `expiresAt` also uses epoch milliseconds. `discountMinor` and
255
+ `unitMinor` use the asset's exact minor units. The example is 10 USDC less
256
+ 1 USDC for a six-decimal USDC asset. The backend checks the Invoice total,
257
+ registered payer, and issuer authority before creation. Optional `memo` is a
258
+ request memo; `invoice.note` is the document note. Unknown fields refuse.
259
+
260
+ Earlier CLI guidance incorrectly named Unix seconds for `dueAt`. Convert those
261
+ values to milliseconds for new drafts. Rendering does not change the dates in
262
+ an issued document. Inspect an incorrect Invoice before cancelling it and
263
+ issuing a corrected request.
264
+
265
+ A lost issuance reply provides issued-list readback in the same scope and
266
+ session. Issuance has no automatic resend.
267
+
268
+ Inbox pay reads and confirms exact backend-owned request terms. It uses the existing
269
+ CLI signer and the SDK fulfillment API. Organization payment requires the
270
+ selected Permission; the backend checks Budget and spending authority. The
271
+ command publishes prepared Payment IDs before signing. A submitted Payment
272
+ is not a settled Payment. Use the printed get/wait commands to inspect its state.
273
+ Returned documents use the same default PDF directory.
274
+
275
+ A lost reply or timeout gives exact readback in the same session and scope.
276
+ Pay refuses an already prepared Invoice unless you explicitly use `--resume`
277
+ after readback. Resumption must retain its linked Payment ID and original
278
+ Invoice terms. It does not create another request or Payment. Use
279
+ `--timeout-seconds N` to change the bounded signing wait (default 120).
280
+ An Invoice retains its issued instruction. A generic request uses a deterministic
281
+ Memo instruction. Reading terms creates no Payment or document. Fulfillment
282
+ checks those terms again and stores the Memo with the original request birth.
283
+
284
+ ## Payment documents
285
+
286
+ ```sh
287
+ capxul document get --document-hash H --content-hash C --json
288
+ capxul document verify --document-hash H --content-hash C --json
289
+ capxul document render --document-hash H --content-hash C
290
+ capxul document render --document-hash H --content-hash C --output-dir ./documents --json
291
+ capxul document export --document-hash H --content-hash C --out original.bin
292
+ ```
293
+
294
+ Each command uses the current authenticated session. Add `--email EMAIL` to
295
+ select a saved session. In a terminal, omit required fields to enter them.
296
+ `get` returns document metadata and saves a PDF. It does not print source bytes.
297
+ `verify` reports `ok: false` when verification fails. `render` saves a PDF and its
298
+ self-contained HTML source in the `documents` directory next to CLI settings.
299
+ Use `--output-dir` to change this directory. Human and JSON output contain
300
+ file metadata. Each render uses a new private directory and preserves earlier
301
+ files. `export` writes the original bytes to a new file.
302
+ It refuses an existing output file.
303
+
304
+ Personal and Organization Payment `send`, `get`, `wait`, `retry`, and `list`
305
+ also save available documents as PDFs. Activity detail and Payroll results
306
+ save available documents in the same directory. Their results include
307
+ document output metadata.
308
+ Pending or unavailable documents retain that state. A document failure does
309
+ not change the Payment result or start another Payment.
310
+
311
+ ## Contact commands
312
+
313
+ ```sh
314
+ capxul contact list [--include-hidden]
315
+ capxul contact get --entry-id PARTY_ID
316
+ capxul contact add --input FILE|- [--confirm]
317
+ capxul contact label --entry-id PARTY_ID --label TEXT [--confirm]
318
+ capxul contact hide --entry-id PARTY_ID [--confirm]
319
+ capxul contact unhide --entry-id PARTY_ID [--confirm]
320
+
321
+ capxul org contact list --org ORGANIZATION_ID [--include-hidden]
322
+ capxul org contact get --org ORGANIZATION_ID --entry-id PARTY_ID
323
+ capxul org contact add --org ORGANIZATION_ID --input FILE|- [--confirm]
324
+ capxul org contact label --org ORGANIZATION_ID --entry-id PARTY_ID --label TEXT [--confirm]
325
+ capxul org contact hide --org ORGANIZATION_ID --entry-id PARTY_ID [--confirm]
326
+ capxul org contact unhide --org ORGANIZATION_ID --entry-id PARTY_ID [--confirm]
327
+ ```
328
+
329
+ Personal commands use the authenticated Account address book. Organization
330
+ commands require one explicit `--org` or `--org-id`; they never use the saved
331
+ Organization read default. `list` omits hidden entries unless
332
+ `--include-hidden` is present. `get`, `label`, `hide`, and `unhide` address one
333
+ stable Party with `--entry-id`.
334
+
335
+ `add --input` reads the existing `AddressBookAddInput` JSON shape. For example:
336
+
337
+ ```json
338
+ {
339
+ "ref": { "kind": "email", "email": "supplier@example.test" },
340
+ "label": "New Supplier"
341
+ }
342
+ ```
343
+
344
+ Use `--input -` to read the same object from stdin. An interactive `add` can
345
+ collect the reference kind, value, and optional label instead. Interactive
346
+ writes show the actor and exact contact change, then ask a default-no question.
347
+ JSON, CI, and other noninteractive writes require `--confirm` before the CLI
348
+ creates a client. Contact writes do not start a browser signer.
349
+
350
+ Success data is the SDK value without a CLI wrapper: `list` returns
351
+ `AddressBookEntry[]`, `get` returns `AddressBookEntry | null`, and each mutation
352
+ returns `AddressBookEntry`. Human `get` prints `No contact found` for null and
353
+ exits successfully. Entries retain their stable PartyId, exact reference,
354
+ relationships, hidden state, and last activity time.
355
+
356
+ ## Personal Account reads
357
+
358
+ ```bash
359
+ capxul account status --email person@example.com
360
+ capxul account balance --json
361
+ capxul account deposit --wizard
362
+ ```
363
+
364
+ These commands reuse your verified current session unless you provide an email.
365
+ They do not start setup or open a signer. Status shows lifecycle and transaction
366
+ readiness; a failed lifecycle exposes its stage and error code. Balance shows
367
+ exact asset quantities and available fiat valuations. An unavailable valuation
368
+ or failed read is not zero. Deposit uses the SDK's address and network.
369
+
370
+ ## Organization commands
371
+
372
+ ```sh
373
+ capxul org list --json
374
+ capxul org use --org ORGANIZATION_ID
375
+ capxul org status --org ORGANIZATION_ID --json
376
+ capxul org get --json
377
+ capxul org me --json
378
+ capxul org members --json
379
+ capxul org member list --json
380
+ capxul org member get --account-id ACCOUNT_ID --json
381
+ capxul org wait --timeout-seconds 120 --json
382
+ capxul org create --name NAME --handle HANDLE --country CC [--bio TEXT] [--size TEXT] [--confirm]
383
+ capxul org retry --org ORGANIZATION_ID [--confirm]
384
+ ```
385
+
386
+ These commands accept `--email`. Without it, they restore the protected current
387
+ session. Organization reads accept `--org` or its alias `--org-id`. Identical
388
+ repeated IDs are accepted. Different IDs are refused.
389
+
390
+ A read without --org uses the saved read default, then this machine's
391
+ recovery ID, then the one unfinished setup returned by the backend. org list
392
+ includes unfinished founder setups. This works from a clean authenticated home.
393
+ Interactive status/wait offers a choice when several unfinished setups exist.
394
+ Scripted and JSON reads require an exact --org in that case. A ready
395
+ Organization must still appear in current access.
396
+
397
+ Human output shows Organization identity and setup, with a separate unfinished
398
+ setup section and explicit empty results. Members without an Account ID remain
399
+ visible. `org me` shows backend capabilities and exact per-payment Budget caps;
400
+ these caps are not available balances. `--json` keeps the structured SDK data.
401
+
402
+ org use saves a protected per-person read default. Without --org, an interactive
403
+ use command offers current accessible Organizations and ignores the old default.
404
+ A scripted use requires --org. The default grants no
405
+ authority. Member lookup uses an exact AccountId. In a human terminal, omit
406
+ --account-id to select an attached Account from the authorized member list.
407
+ Members without an Account ID cannot be selected. Scripted and JSON lookup
408
+ requires --account-id. Reads do not sign or change
409
+ setup state.
410
+
411
+ org wait opens one exact setup subscription. It continues when needsAttention
412
+ has a scheduled next check. It stops at ready, failed, awaitingAuthorization,
413
+ or attention without a next check. It does not request a check or poll. The
414
+ timeout accepts 1 to 3600 seconds and defaults to 120. A deadline returns
415
+ CLI_DEADLINE at exit 5; Ctrl-C returns CANCELLED at exit 130.
416
+
417
+ ## Organization Payment send
418
+
419
+ ```sh
420
+ capxul org payment send --org O --input payment.json --request-key K --confirm --json
421
+ capxul org payment send --org O --resume K --confirm --json
422
+ capxul org payment send
423
+ ```
424
+
425
+ The Organization input adds its exact Budget ID as `permissionId`. It supports
426
+ the same recipient, amount, and document fields as Personal send. It rejects
427
+ `timing` and payload actor, Organization, key, and lineage overrides. Scripted
428
+ calls require an explicit Organization, request identity, and `--confirm`.
429
+ A human terminal collects missing input and previews the selected actor, exact
430
+ Organization, Budget, treasury asset position, recipient, and document summary.
431
+ A saved read default does not select this write.
432
+
433
+ One default-No confirmation precedes signing. The protected input binds actor,
434
+ Organization, and key. Resume uses that input and forbids source/key overrides.
435
+ Prepared IDs reach stderr before the next signature. Send reports submission;
436
+ exact scoped get/wait establishes later state. JSON preview includes safe
437
+ summary fields and omits document bytes. External recipients use the same
438
+ literal-true input field and human warning as Personal send. Resume preserves
439
+ the saved reference even when the current lookup resolves to a Party.
440
+
441
+ ## Organization Payment reads
442
+
443
+ ```sh
444
+ capxul org payment list --org O [--json]
445
+ capxul org payment get --org O --payment-id P [--json]
446
+ capxul org payment wait --org O --payment-id P [--timeout-seconds N] [--json]
447
+ ```
448
+
449
+ These commands require an explicit Organization. They do not use the saved
450
+ read default. The backend checks current Organization participation and returns
451
+ only that Organization's outgoing, incoming, and self Payments. Get refuses
452
+ a missing or mismatched Payment ID. Reads do not need a signer.
453
+
454
+ Wait observes the exact Organization and Payment through the SDK subscription.
455
+ It stops on a terminal state, required action, or required retry. The timeout
456
+ accepts 1 to 3600 seconds and defaults to 120. It covers session restoration
457
+ and observation. Deadline exit 5 and interruption exit 130 retain read/wait
458
+ instructions with both Organization and Payment IDs.
459
+
460
+ ## Organization Payment retry
461
+
462
+ ```sh
463
+ capxul org payment retry --org O --payment-id P --confirm --json
464
+ capxul org payment retry
465
+ ```
466
+
467
+ Retry addresses the original command and every Payment in that command. It
468
+ creates no replacement send or request key. A terminal can collect the Payment
469
+ ID and select a currently accessible Organization. A saved read default does
470
+ not choose the write target. JSON and scripted runs require both IDs and
471
+ `--confirm`.
472
+
473
+ Before signing, the preview shows every original Payment, recipient, exact
474
+ asset and quantity, timing, and state. It also shows the original command and
475
+ stored Budget. A human terminal asks one default-no question, including when
476
+ `--confirm` is supplied. The signer starts after this step. A changed prepared cohort
477
+ or actor refuses before signature.
478
+
479
+ The result is `{ payments }` in the SDK's original order. Submitted Payments
480
+ can still be pending. A failure, timeout, or interruption retains the selected
481
+ Organization, Payment, and verified sibling IDs with same-scope get/wait
482
+ commands. Retry does not claim settlement from a submission hash.
483
+
484
+ ## Permissions
485
+
486
+ ```sh
487
+ capxul org permission list [--org O] [--json]
488
+ capxul org permission get --permission-id B [--org O] [--json]
489
+ capxul org permission create --org O --input budget.json --request-key K --confirm [--json]
490
+ capxul org permission change --org O --permission-id B --input budget.json --request-key K --confirm [--json]
491
+ ```
492
+
493
+ These commands use the explicit Organization, then the protected read default.
494
+ A human terminal can select an accessible Organization when neither exists.
495
+ Each read checks current Organization access. `get` requires an exact Permission
496
+ ID and refuses a missing or mismatched result. Reads do not need a signer.
497
+
498
+ Human output shows Permission and assignment IDs, revisions, and states.
499
+ Budget output labels the exact per-payment cap or no cap. It does not show a
500
+ remaining balance. JSON preserves the public SDK result.
501
+
502
+ Every Budget write supplies the complete policy:
503
+
504
+ ```json
505
+ {
506
+ "type": "budget",
507
+ "asset": "A",
508
+ "limit": { "asset": "A", "value": "500" },
509
+ "scope": {
510
+ "recipients": { "type": "allowlist", "accounts": ["account_alice"] },
511
+ "actions": ["pay"]
512
+ }
513
+ }
514
+ ```
515
+
516
+ Use an exact admitted AssetId for `A`. The cap must be positive and finite.
517
+ Recipients are `anyone` or 1 to 32 unique Account IDs. Actions are `pay`,
518
+ `commitments`, or both. `pay` covers single and batch Payments. Missing scope,
519
+ duplicate recipients/actions, unknown fields, and an asset mismatch refuse.
520
+ A Budget change keeps its asset. Management input is `{"type":"managePeople"}`.
521
+ Use `--input -` for stdin. Input is limited to 64 KiB.
522
+
523
+ A human terminal can guide policy input. Change prefills the exact active
524
+ revision's complete stored policy. The preview shows all before/after rights
525
+ and any allowance reset before one default-no confirmation. The CLI then records
526
+ verified prepared IDs and compares the frozen policy with that confirmation.
527
+ If it changed, the CLI refuses before signing. A missing human key is generated
528
+ and printed before the first write. Scripted runs require `--request-key` and
529
+ `--confirm`.
530
+
531
+ Success means submitted and pending application. It does not prove active
532
+ rights. After an interruption or uncertain result, retain the original input,
533
+ Organization ID, key, command ID, and execution ID. The key alone cannot restore
534
+ wizard/stdin input.
535
+
536
+ `org permission replace --org O --request-key K --confirm` replaces the current
537
+ Roles module and carries its active Permissions, assignments, and admitted
538
+ Invitation rights. Human mode guides missing scope and shows the full frozen
539
+ before/after snapshot before one default-no approval. Machine mode requires
540
+ scope, key, and confirmation. A changed snapshot refuses before staging or
541
+ signature. Unfinished Invitation configuration must complete or cancel first.
542
+ Submission remains pending application. Use exact command get/wait after an
543
+ uncertain result; the command does not promise unconditional replacement replay.
544
+
545
+ ## Payroll runs, rosters, and reads
546
+
547
+ ```sh
548
+ capxul org payroll groups list --org O [--json]
549
+ capxul org payroll groups save --org O --input group.json --confirm [--json]
550
+ capxul org payroll groups remove --org O --group-id G --confirm [--json]
551
+ capxul org payroll terms --org O [--json]
552
+ capxul org payroll list --org O [--json]
553
+ capxul org payroll run --org O --input run.json --request-key K --confirm [--json]
554
+ capxul org payroll run --org O --resume K --confirm [--json]
555
+ capxul org payroll get --org O --run-id R [--json]
556
+ capxul org payroll wait --org O --run-id R --timeout-seconds 120 [--json]
557
+ ```
558
+
559
+ Group input contains `name`, `tone`, and `members`. Each member supplies a
560
+ canonical `partyId`, draft `amount` text, and `currency`. An optional `id`
561
+ updates that exact group. These commands do not sign or transfer money.
562
+ Group amounts stay unchanged, including unfinished draft text. They do not
563
+ supply payout quantities or currency conversion. A lost create response must
564
+ be reconciled with the same scoped group list before another create.
565
+
566
+ Terms retain raw rates, decimals, units, and effective dates. Run listing
567
+ retains the backend `settledThisMonth` aggregate. The CLI does not sum a partial
568
+ run page or compute earned pay.
569
+
570
+ Run input contains `permissionId`, `asset`, `period`, and ordered `items`.
571
+ Each item supplies a recipient Ref, asserted `partyId`, settlement `amount`,
572
+ raw-unit `gross` and `net`, and signed `adjustments`. Net must equal the exact
573
+ settlement quantity and gross plus adjustments. Keep Organization, actor, signer,
574
+ and request-key routing outside the JSON. `--input -` reads bounded stdin.
575
+ The current Payroll producer accepts email and Party Refs. Other Ref kinds
576
+ refuse before client work.
577
+
578
+ In a human terminal, `capxul org payroll run` guides the current Organization,
579
+ Budget, settlement asset, date, roster or known Parties, and actual payout
580
+ quantities. Roster amounts and terms are reference data. The complete preview
581
+ shows each recipient and Safe, quantity, raw units, and adjustment. One
582
+ default-no approval precedes signing, including when `--confirm` is supplied.
583
+ Machine runs require exact scope, input, key, and `--confirm`.
584
+
585
+ The command saves the exact input in protected storage under the verified actor,
586
+ Organization, and key before execution. `--resume K` restores that snapshot.
587
+ It requires the same explicit Organization and cannot combine fresh input or
588
+ another key. Payroll accepts email and Party references. Raw external addresses
589
+ are outside the current run contract.
590
+ Success returns `{ run, requestKey }`; submission does not prove settlement.
591
+
592
+ Get returns the full authorized run detail, command, ordered items, and recorded
593
+ times. Wait observes the exact run without polling or submitting. It keeps
594
+ waiting through partial settlement and ends when all Payments settle, a failure
595
+ is recorded, or action is required. Timeout exits 5. Cancellation exits 130.
596
+ Recovery retains exact Organization, run, and any observed request key.
597
+
598
+ ## Invitation commands
599
+
600
+ ```sh
601
+ capxul org invite list [--mine] [--limit N] [--cursor C] [--phase PHASE ...] [--org O]
602
+ capxul org invite get --invitation-id I [--org O]
603
+ capxul org invite wait --invitation-id I [--org O] [--timeout-seconds N]
604
+ capxul org invite review --invitation-id I --org O [--timeout-seconds N]
605
+ capxul org invite accept --invitation-id I --offer-digest D --org O [--confirm] [--timeout-seconds N]
606
+ capxul org invite decline --invitation-id I --org O [--confirm]
607
+ capxul org invite cancel --invitation-id I --org O [--confirm]
608
+ capxul org invite resend --invitation-id I --org O [--confirm]
609
+ capxul org invite retry --invitation-id I --org O [--confirm]
610
+ capxul org member invite (--to-email E | --account-id ID) [--budget-id B ...] [--permission-id M ...] [--new-budget-name N --asset A (--limit Q | --unlimited) (--recipient-account ID ... | --any-recipient) --actions pay[,commitments]] --org O [--request-key K] [--preview] [--confirm]
611
+ ```
612
+
613
+ `org invite list` returns your own offers. It accepts `--limit` (1--100),
614
+ `--cursor`, and repeated `--phase` values, and its result carries `invitations`,
615
+ `nextCursor`, and `observedAt`: pass `nextCursor` back as `--cursor`, and change
616
+ no other filter between the two calls. `--mine` names the own-offer projection,
617
+ which is already the default. With `--org O` the command returns that
618
+ Organization's invitations for a current Admin instead; the Organization list is
619
+ not filtered to you, so `--mine` together with `--org` refuses with exit 2. The
620
+ other invitation commands require an exact `--invitation-id`.
621
+
622
+ `org invite get` and `org invite wait` use `--org` when you name it. Without
623
+ `--org` they walk your own-offer pages, 100 rows per request, until they find
624
+ the invitation or the pages end. They never consult the saved read default, and
625
+ an offer you cannot see is refused. `--timeout-seconds` bounds the resolution
626
+ and the read together on both commands.
627
+
628
+ Invitation lists label own-offer or Organization Admin scope and the verified
629
+ actor. They show an explicit empty page, next cursor, or end of results. Page
630
+ filters and cursor values stay in their selected scope.
631
+
632
+ Invitation human output shows the authoritative phase, delivery, expiry, and
633
+ offered policies. An offer does not prove active membership. Manual resend/retry commands come only
634
+ from the backend action projection, with exact scope/session and earliest time.
635
+ Older responses without that projection show read-back guidance. Lifecycle
636
+ recovery remains separate from manual options. Member-invite
637
+ previews show exact per-payment caps and allowed recipients/actions; expiry is
638
+ unavailable before authoring. The native authoring wizard asks for Organization,
639
+ recipient, grants and policy before session email. New-Budget labels identify
640
+ policy inputs; skip them for existing grants. Wizard answers use the same request
641
+ validation as flags. Every authoring write prints its request key
642
+ before submission. JSON result data stays unchanged.
643
+
644
+ Uncertain decline/cancel/resend/retry failures and transition deadlines print an
645
+ exact `org invite get` command with the resolved session. Read the current offer
646
+ before another transition; a lost response does not authorize replay.
647
+
648
+ `org invite wait` uses one exact SDK subscription after resolving scope. It
649
+ finishes when the offer settles or lifecycle recovery asks a person to act.
650
+ Manual recovery options do not stop the wait. It never polls, retries, resends,
651
+ or accepts. The deadline covers resolution and observation; completion, failure
652
+ and interruption release the subscription, including a handle that arrives late.
653
+
654
+ Native invitation target prompts ask Organization and invitation IDs before
655
+ session email. Transition confirmation shows the verified actor and the current
656
+ resolved offer, including grants and expiry, before the default-No question.
657
+
658
+ `org invite review` requires `--org`, returns the current `InvitationView`
659
+ directly in `data`, and performs no write or signing.
660
+
661
+ The four transitions require `--org` in both modes, as `accept` does. They never
662
+ author a new offer. A noninteractive or JSON run requires `--confirm`. An
663
+ interactive run shows the resolved current offer and asks a default-no question.
664
+
665
+ `org member invite` authorizes one exact offer. `--preview` writes nothing and
666
+ needs neither a request key nor confirmation. A noninteractive write requires
667
+ `--request-key` and `--confirm`. An interactive run prints the request key it
668
+ used before it submits, so a lost response is recoverable with the same
669
+ identity. At most one `--new-budget-name` is accepted per command.
670
+
671
+ `org invite accept` is the exact grantee's consent commit. It takes the exact
672
+ digest the offer shows as `--offer-digest`: a noninteractive or JSON run must
673
+ supply it, and without it the command refuses with exit 2 before it creates a
674
+ client. An interactive run may omit it, and then reads the offer and fills the
675
+ digest from the value it displayed. A digest you state is never replaced by the
676
+ displayed one. `--expected-offer` remains a compatibility spelling, and both
677
+ spellings must match when supplied together. The command returns the
678
+ `InvitationView` directly in `data`. The grant is executed by the deployment's
679
+ technical executor, so the command needs no browser bridge and works in a
680
+ headless or CI session. A repeat with the stored digest returns the same
681
+ accepted result; a different digest refuses and cannot overwrite consent. The
682
+ returned view is the authorization-time view of the consent commit
683
+ (`pending_grant`); read the settled `active` state with `get` or `wait`.
684
+
685
+ ## Organization writes
686
+
687
+ org create and org retry use the protected current session unless --email names
688
+ one. A JSON or noninteractive write requires --confirm. A terminal write shows
689
+ the current Organization and recovery information, then asks a default-no
690
+ question. The signer starts after confirmation.
691
+
692
+ `org create --wizard` guides name, handle, country, optional bio and size, then
693
+ session email. Supplied flags remain in the generated command. The final write
694
+ preview names the verified actor and starts with No selected.
695
+ `org retry --wizard` collects the exact Organization ID before session email.
696
+ Its final preview shows the verified actor and current lifecycle. Saved read
697
+ defaults and creation recovery records cannot change that retry ID.
698
+
699
+ org create validates name, handle, and country before client work. It calls
700
+ onboarding.beginOrganization, saves and prints the exact Organization ID,
701
+ authorizes only an awaitingAuthorization setup, then subscribes to setup
702
+ changes. It reports success only after ready and current access. JSON progress
703
+ uses one line per state:
704
+
705
+ { "type": "organization.lifecycle", "organizationId": "O", "status": "processing" }
706
+
707
+ org retry requires one exact --org. It authorizes only awaitingAuthorization.
708
+ For an accepted setup it asks the backend to check the same operation hash
709
+ through setup.resume, then subscribes. Neither command replaces a submitted
710
+ operation. The local recovery record keeps a safe handle and Organization ID
711
+ for convenience; the backend unfinished list supports recovery without it.
712
+
713
+ --timeout-seconds sets one 1-to-3600-second deadline for the command. A
714
+ deadline stops local work and returns exit 5. If the last observed setup has
715
+ another automatic check scheduled, the message is "Stopped waiting.
716
+ Organization setup continues in the background." Before acceptance or without
717
+ a scheduled check, the message is "Stopped waiting. Read the Organization
718
+ setup status." The error details include the safe Organization ID when known,
719
+ last observed setup state, setup reason, and bounded provider diagnostics.
720
+ Ctrl-C stops local work at exit 130. Neither stop writes a backend failure.
721
+
22
722
  ## Configuration
23
723
 
24
- | Variable | Use |
25
- | ------------------------------ | ------------------------------------------------------------------------------------------------------------ |
26
- | `CAPXUL_CLI_HOME` | Directory for global CLI settings. Defaults to `$XDG_CONFIG_HOME/capxul/cli`, or `$HOME/.config/capxul/cli`. |
27
- | `CAPXUL_PUBLISHABLE_KEY` | Application publishable key, required for an online check. |
28
- | `CAPXUL_BOOTSTRAP_URL` | Bootstrap origin. Defaults to `https://api.staging.capxul.com`. Convex Cloud origins are rejected. |
29
- | `CAPXUL_POSTHOG_HOST` | PostHog ingestion origin. |
30
- | `CAPXUL_POSTHOG_PROJECT_TOKEN` | Project ingestion token. Both PostHog variables are required for export. |
31
- | `CAPXUL_TELEMETRY_DISABLED` | Set to `true` to disable remote observation regardless of the saved preference. |
724
+ | Variable | Use |
725
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
726
+ | `CAPXUL_CLI_HOME` | Directory for global CLI settings. Defaults to `$XDG_CONFIG_HOME/capxul/cli`, or `$HOME/.config/capxul/cli`. |
727
+ | `CAPXUL_PUBLISHABLE_KEY` | Optional developer override for the bundled first-party staging key. |
728
+ | `CAPXUL_BOOTSTRAP_URL` | Bootstrap origin. Defaults to `https://api.staging.capxul.com`. Convex Cloud origins are rejected. |
729
+ | `CAPXUL_CHECKOUT_FRONTEND_ORIGIN` | Checkout frontend origin. Staging uses `https://app.staging.capxul.com`. Devnet at `http://127.0.0.1:3211` uses `http://127.0.0.1:3002`. Custom bootstrap origins require this value. |
730
+ | `CAPXUL_POSTHOG_HOST` | Optional development override for the built-in public PostHog ingestion origin. |
731
+ | `CAPXUL_POSTHOG_PROJECT_TOKEN` | Optional development override for the built-in public project ingestion token. |
732
+ | `CAPXUL_TELEMETRY_DISABLED` | Set to `true` to disable remote observation regardless of the saved preference. |
32
733
 
33
- Collection defaults to enabled. Local commands send no remote signals.
734
+ The published CLI includes the verified first-party staging application key and
735
+ Capxul-owned public ingestion configuration. You do not need key or PostHog
736
+ environment variables. A different bootstrap origin requires an explicit key. Collection defaults to enabled for
737
+ ordinary local and online commands, help, version, and safely attributed argument
738
+ refusals. Parser refusals produce a completion without a start. Early native
739
+ global errors with no resolved command route send nothing, because the CLI
740
+ cannot determine whether they belong to a silent collection control.
34
741
  `telemetry disable` saves one preference for the OS user and sends no final
35
742
  remote event. Already running CLI processes check the current preference before
36
743
  each export. Requests already sent cannot be recalled. `telemetry status`
37
744
  reports the stored preference, effective policy, configuration, and reason.
745
+ `--log-level` controls normal diagnostic output, not collection. An eligible
746
+ invocation still produces its remote completion unless collection is disabled.
747
+
748
+ Eligible commands reuse a random anonymous identifier stored in the protected
749
+ CLI directory. Invocation and trace identifiers remain separate. A first-use
750
+ marker records the first eligible observed use, not a download or a verified
751
+ person. If this state cannot be accessed safely, observation stops and the
752
+ command retains its normal result. Delivery is bounded and best-effort; the CLI
753
+ does not keep a persistent activity queue.
38
754
 
39
755
  Settings use a versioned JSON file in a directory with mode `0700`. The file has
40
756
  mode `0600`. Writes are atomic and serialize between processes. A later writer
@@ -43,8 +759,22 @@ unsafe permissions, symlinks, and corrupt state produce a storage failure.
43
759
 
44
760
  ## Output
45
761
 
46
- `--json` writes one version 1 envelope to stdout. Success contains `data`.
47
- Failure contains `error.code` and CLI-owned `error.message`. Each envelope has
762
+ Organization setup failures include a copyable command with the exact ID and
763
+ selected email. When state is uncertain, read status first. A supported retry
764
+ includes `--confirm`; terminal runs still ask for confirmation. If no ID is
765
+ known, the command lists your Organizations instead of guessing one.
766
+ JSON errors can include `error.details.recovery` with `kind` (`read` or `retry`)
767
+ and an `argv` array for that primary action. These arguments preserve the same
768
+ scope as the human command; they do not grant authority or bypass current checks.
769
+
770
+ `--json` writes one version 1 envelope to stdout. Success contains `data`, which
771
+ can be an object, array, or null according to the command's SDK result.
772
+ Failure contains `error.code` and CLI-owned `error.message`. A wallet failure
773
+ also includes its known `error.mode` and allowed `error.details`: wallet stage,
774
+ operation, provider, provider code, and HTTP status. An unknown browser failure
775
+ uses mode `unknown`. No provider message, token, signature, or native cause enters
776
+ the result. These fields remain available when collection is off or
777
+ `--log-level none` is set. Each envelope has
48
778
  `command`, `invocationId`, and `outcome`. An invocation ID is null before a
49
779
  command starts. Human errors go to stderr.
50
780
 
@@ -93,11 +823,21 @@ compinit
93
823
  Use `npm update -g @capxul/cli` or `brew upgrade xelmar-tech/tap/capxul` to update.
94
824
  Use one installer for the `capxul` executable to avoid conflicting PATH entries.
95
825
 
826
+ After a successful human command, help, or version request, the CLI can show an
827
+ update notice on terminal stderr. It checks the public npm `latest` tag at most
828
+ once per 24 hours. It shows only the command for the verified running npm-global
829
+ or Homebrew installation. It does not execute that command. Unknown installations,
830
+ development versions, JSON output, redirected stderr, CI, shell completion, and
831
+ all `telemetry` commands receive no notice. The optional check has one 500 ms
832
+ budget. Safe failed attempts are cached. Storage or network failures remain
833
+ silent and do not change the command result. This check sends no telemetry.
834
+
96
835
  ## Development commands
97
836
 
98
837
  ```sh
99
838
  vp test run apps/cli
100
839
  vp run --filter @capxul/cli check-types
840
+ vp run --filter @capxul/cli lint
101
841
  vp run --filter @capxul/cli build
102
842
  vp exec node --test --test-name-pattern='@capxul/cli' scripts/__tests__/pack-install-smoke.test.mjs
103
843
  ```
@@ -105,3 +845,273 @@ vp exec node --test --test-name-pattern='@capxul/cli' scripts/__tests__/pack-ins
105
845
  The last command installs the tarball outside the workspace and exercises the
106
846
  installed executable with isolated settings and a local HTTP server. The CI
107
847
  `CLI / Linux / Node 24.0.0` job runs this proof at the declared minimum version.
848
+
849
+ ## Email login and session restoration
850
+
851
+ This CLI establishes a first-party BetterAuth session. An older native
852
+ `account:read` grant does not count as sign-in and cannot read the profile.
853
+ Logout clears the selected email's session and attempts to revoke any native
854
+ grant that was stored before the first-party flow replaced it.
855
+
856
+ `capxul auth login` and `capxul auth signup` stay separate commands. On a
857
+ terminal, each command is a wizard. `auth login` asks for the email and a masked
858
+ OTP. It accepts the code as a paste. It retries an invalid code at most three
859
+ times for one request. After sign-in, an incomplete account gets one offer to
860
+ continue setup in the same command. `auth signup` authenticates first, then asks
861
+ for the Profile fields: display name, two-letter country code, and handle. A
862
+ known value is the prompt default, so Enter keeps it.
863
+
864
+ The browser opens only when the shared Core onboarding journey needs Openfort
865
+ wallet readiness. It shows wallet status only. It has no email, OTP, Profile, or
866
+ approval form.
867
+
868
+ Ctrl+C or Ctrl+D at a wizard prompt cancels the command. The command prints no
869
+ success result and exits 130. A step that already finished keeps its result: a
870
+ completed sign-in keeps its session.
871
+
872
+ For an agent, send and verify in separate processes:
873
+
874
+ ```sh
875
+ capxul auth send --email "$TEST_EMAIL" --json
876
+ # Supply the delivered six-digit OTP through stdin, not a command argument.
877
+ capxul auth verify --email "$TEST_EMAIL" --otp-stdin --json
878
+ capxul auth profile --email "$TEST_EMAIL" --json
879
+ # A later process uses the same protected CLI home; no new OTP is required.
880
+ capxul auth profile --email "$TEST_EMAIL" --json
881
+ capxul auth status --email "$TEST_EMAIL" --json
882
+ capxul auth logout --email "$TEST_EMAIL" --json
883
+ ```
884
+
885
+ After sending a code, human output includes the exact verification command with
886
+ your email safely quoted. If verification has no pending code, the error gives
887
+ the exact command to request one. Neither command includes the OTP itself.
888
+
889
+ If account setup or its final read fails recoverably, the CLI prints an exact
890
+ `auth signup` continuation with your email and Profile fields. Run it with the
891
+ same protected CLI home to resume the saved session. Explicit access/input
892
+ refusals and non-retryable failures require their stated correction first.
893
+
894
+ Human profile/status output labels your Profile fields and available Account,
895
+ wallet and Smart Account identifiers. Failed setup includes its stage and error
896
+ code. These reads do not open the wallet browser. `--json` retains the structured
897
+ result, including the same Profile and lifecycle values.
898
+
899
+ A machine run never prompts. `auth login` with `--otp-stdin` sends the OTP and
900
+ verifies one code from stdin. It returns the tagged result
901
+ `setupState: "setup-required"` when the account needs setup. It does not start
902
+ setup work, so sign-in never becomes signup.
903
+
904
+ A fresh machine signup does verification and setup in one command. State every
905
+ Profile field; a missing field refuses with exit 2:
906
+
907
+ ```sh
908
+ # Supply only the delivered OTP through stdin.
909
+ capxul auth signup --email "$TEST_EMAIL" --otp-stdin \
910
+ --display-name "Test Person" --country GH --handle test_person --json
911
+ ```
912
+
913
+ `--otp-stdin` reads up to 64 bytes, ending at EOF. Pipe from a secret provider or
914
+ use input redirection from a protected file. An invalid value refuses with exit 2. A missing `--otp-stdin` refuses with exit 2 before the command starts client
915
+ work. OTPs are never accepted in argv, persisted in the continuation, or included
916
+ in output.
917
+
918
+ The local page binds to an OS-selected loopback port. A random launch capability
919
+ is redeemed once and removed from the URL before Openfort starts. The page receives
920
+ only the authenticated wallet token and encryption session in memory. Closing it
921
+ ends the current wallet attempt. Re-run `auth signup` with the same CLI home to
922
+ resume the same Profile and Account without another OTP while the backend session
923
+ remains valid.
924
+
925
+ `auth signup` returns only two readiness results. `setupState: "ready"` is a
926
+ personal Account that the Account readiness owner reads as ready and deployed,
927
+ and its data carries the public identifiers: the Profile, the public wallet
928
+ address (`smartAccount.signerAddress`), the personal Smart Account address
929
+ (`smartAccount.smartAccountAddress`), the Account ID
930
+ (`lifecycle.accountId`), and the ready status. Any other state returns the typed
931
+ recoverable result `setupState: "setup-required"`, with the lifecycle, its
932
+ failure code, and the command that resumes the journey. A ready Account starts
933
+ no wallet work, so a retry keeps the one Profile, wallet, Smart Account, and
934
+ Account. An interruption keeps the stored session and stores no code, so the
935
+ next command resumes the same setup.
936
+
937
+ A ready personal Account continues the same journey into Organization creation
938
+ with `capxul org create --name NAME --handle HANDLE --country CC`. The create
939
+ command records the safe recovery handle for that Organization, so an
940
+ interruption or a restart resumes the exact same Organization.
941
+
942
+ The CLI checks `--display-name`, `--country`, and `--handle` before it opens a
943
+ client, so a malformed value refuses with exit 2 and no code is sent. The handle
944
+ check covers the grammar only: a handle that another person holds, and a reserved
945
+ handle, refuse through the identity owner after sign-in. Both refusals name the
946
+ handle, and neither offers verification-code recovery for a Profile problem.
947
+
948
+ The version 2 `first-party-session` record stores the opaque provider credential
949
+ in the existing protected plaintext store. Its scope includes the application
950
+ key, issuer, environment, and email. Each process validates restoration with the
951
+ backend; cached session data is not authority. Conditional replacement prevents
952
+ a concurrent logout from being undone by a delayed credential save. The backend
953
+ owns expiry and revocation. A failed remote logout is reported as `unconfirmed`;
954
+ local sign-out remains in effect.
955
+
956
+ `auth profile` returns a backend-read Profile and account lifecycle without opening
957
+ the browser. Successful email authentication can return `setupState: "setup-required"`.
958
+ `auth signup` returns `setupState: "ready"` only after Core reads a ready Account.
959
+ After logout, profile reads refuse with `NOT_AUTHENTICATED` and exit 3. An invalid
960
+ or expired OTP refuses with exit 2.
961
+
962
+ Resume an existing personal Account after incomplete setup:
963
+
964
+ ```sh
965
+ capxul account retry --email you@example.com --confirm --timeout-seconds 120
966
+ capxul account retry --email you@example.com --wizard
967
+ ```
968
+
969
+ The terminal shows the verified session, Account ID and current lifecycle before
970
+ confirmation. A ready Account starts no wallet work. Missing Account or Profile
971
+ state directs to `auth signup`. A deadline stops waiting; check `account status`
972
+ for the same session before retrying.
973
+
974
+ Read an Organization treasury or deposit target:
975
+
976
+ ```sh
977
+ capxul org balance --org org_example --email you@example.com
978
+ capxul org deposit --org org_example --email you@example.com
979
+ capxul org balance --wizard
980
+ ```
981
+
982
+ These commands use the existing Organization read selection. Balances require
983
+ backend treasury access. Deposit instructions use the public SDK's own-access
984
+ projection. Neither command starts a signer or changes Organization setup.
985
+
986
+ Contact reads show the selected scope, label, full Party ID, reference,
987
+ relationships and hidden state. JSON keeps the existing array, entry or null.
988
+
989
+ ```sh
990
+ capxul contact list --include-hidden
991
+ capxul contact get --entry-id party_example
992
+ capxul org contact get --org org_example --wizard
993
+ ```
994
+
995
+ In a terminal, omit `--entry-id` to select a contact, including hidden contacts.
996
+ In a script, provide the exact Party ID. Organization contacts always require
997
+ an explicit `--org`; they never use the personal book as a fallback.
998
+
999
+ Contact add shows the reference and optional label before terminal confirmation.
1000
+ Without an input file, the wizard asks for these values. On an uncertain response,
1001
+ use the printed list command to check the same address book before adding again.
1002
+ Adding an existing contact can unhide it or change its label.
1003
+
1004
+ Change a contact label with `contact label --entry-id party_example --label
1005
+ "New label" --confirm`. In a terminal, omit the Party ID to select from the
1006
+ same book, including hidden contacts. Organization labels require `--org`.
1007
+ After an uncertain response, use the exact get command printed by the CLI.
1008
+
1009
+ `contact hide` can select a contact in a terminal when `--entry-id` is omitted.
1010
+ It confirms the hidden state, then prints the exact `contact unhide` command for
1011
+ the same Party, session and scope. The contact's history remains available.
1012
+
1013
+ `contact unhide` uses the same scoped selector, including hidden contacts, when
1014
+ a terminal omits `--entry-id`. It confirms the change and shows the visible
1015
+ contact. Scripts provide the exact Party ID and `--confirm`.
1016
+
1017
+ ## Fixed offers
1018
+
1019
+ Manage fixed service offers in your personal Account or an explicit Organization.
1020
+ These commands do not sign payments or create checkout purchases.
1021
+
1022
+ ```sh
1023
+ capxul offer create --input offer.json --request-key consulting-001 --confirm
1024
+ capxul offer list
1025
+ capxul offer get --offer-id OFFER_ID
1026
+ capxul offer revise --offer-id OFFER_ID --expected-revision 1 --input offer.json --confirm
1027
+ capxul offer deactivate --offer-id OFFER_ID --expected-revision 2 --confirm
1028
+ capxul org offer list --org ORG_ID
1029
+ ```
1030
+
1031
+ Use `org offer` and `--org ORG_ID` for each Organization command. Use `--email`
1032
+ to select a saved session. Scripts must supply `--confirm` for each write.
1033
+ A terminal shows the proposed change and asks for confirmation. Use `--json`
1034
+ for structured output. Lists and reads create no PDF.
1035
+
1036
+ The input file contains the complete offer terms. Use `--input -` to read stdin.
1037
+ The input limit is 64 KiB. Supply an admitted Base Sepolia asset ID from the
1038
+ existing asset catalog. Amounts use exact decimal strings. Quantity limits use
1039
+ positive whole numbers.
1040
+
1041
+ ```json
1042
+ {
1043
+ "title": "Consulting",
1044
+ "description": "One hour of consulting",
1045
+ "unitLabel": "hour",
1046
+ "unitAmount": { "asset": "ASSET_ID", "value": "12" },
1047
+ "quantity": { "min": 1, "max": 8 }
1048
+ }
1049
+ ```
1050
+
1051
+ Creation requires an explicit replay key. Keep the key and identical terms when
1052
+ recovering an uncertain result. Read the offer list before another write. Revision
1053
+ and deactivation require the revision you observed. A conflict requires a fresh
1054
+ read. The CLI does not retry a write automatically. Successful offer results
1055
+ include `checkoutUrl`. Share that URL for another purchase of the same offer.
1056
+ An offer link is not a saved purchase or proof of payment.
1057
+
1058
+ The checkout page reads the current offer before the payer continues. A quantity
1059
+ in the URL is a hint. The backend checks its bounds and freezes the selected
1060
+ revision, quantity, price, asset, network, and recipient for that purchase.
1061
+ Changing the URL cannot change a saved purchase. Refresh retains its checkout
1062
+ reference. Separate purchasers receive separate checkout and settlement IDs.
1063
+
1064
+ ## Invoice and document flow
1065
+
1066
+ Alice issues an Invoice to Bob with `request issue`. For an Organization issuer,
1067
+ Alice uses `org request issue --org ORGANIZATION_ID`. Issuance saves Alice's PDF
1068
+ by default and returns the request ID, document references, and checkout URL.
1069
+ Bob runs `inbox list`, then `inbox get --request-id REQUEST_ID`. An Organization
1070
+ payer uses the equivalent `org inbox` commands with its explicit Organization.
1071
+
1072
+ Bob's Inbox contains the request and document references. It does not receive a
1073
+ local PDF automatically. Bob uses the printed `document render` command to save
1074
+ his copy. Both participants read the same verified document. Their files can
1075
+ have different local paths. `status` shows available request and document counts;
1076
+ it does not download documents.
1077
+
1078
+ A direct Payment uses the existing Payment and Activity commands. Alice inspects
1079
+ her outgoing records. Bob inspects his incoming records after the backend observes
1080
+ them. Available document references can then be rendered by an authorized
1081
+ participant. Issuance, signing, submission, and settlement are separate states.
1082
+ A PDF file or checkout link does not prove that funds moved.
1083
+
1084
+ Cancellation removes the request from the received Inbox list. Because `inbox get`
1085
+ reads that list, it cannot find the cancelled ID. Existing participant document
1086
+ access remains available through the saved document and content hashes. Keep
1087
+ those references when retaining a cancelled Invoice.
1088
+
1089
+ The shared document directory is `documents` next to the CLI settings directory.
1090
+ `CAPXUL_CLI_HOME` selects a separate CLI settings directory. `--output-dir` changes
1091
+ the document output location for supported document and payment commands. Each
1092
+ render preserves previous files. A failed PDF render does not repeat issuance or
1093
+ payment. Retry `document render` with the existing document references.
1094
+
1095
+ ## Checkout links
1096
+
1097
+ An Invoice URL has the form `/checkout/invoices/LINK_TOKEN`. An offer URL has the
1098
+ form `/checkout/offers/OFFER_ID`. Use the complete `checkoutUrl` returned by the
1099
+ CLI. Do not build a payment by sending funds directly to the printed Safe.
1100
+
1101
+ A valid Invoice link holder can fund its fixed obligation. The named debtor and
1102
+ actual sender remain separate. Public checkout shows the approved payment
1103
+ summary. It does not expose private billing details or original document bytes.
1104
+ Only authorized participants can open the private Invoice document.
1105
+
1106
+ The checkout page offers registered Account or Organization funding and supported
1107
+ external wallet funding. Registered funding uses the selected actor's authority.
1108
+ External funding requires the correct network, balance, gas, and any exact token
1109
+ approval. Payment goes through the Payments contract with the validated snapshot.
1110
+ Inspect the resulting state and receipt before reporting payment complete.
1111
+
1112
+ CLI `inbox pay` retains its existing CLI signing flow. It does not depend on the
1113
+ hosted checkout page. A rejected signature or uncertain reply is not permission
1114
+ to send another Payment. Use the printed readback and recovery instructions.
1115
+
1116
+ Checkout links do not create recurring billing, automatic debits, booking,
1117
+ refunds, or QR codes.