@capxul/cli 4.20.0-beta.10 → 4.20.0-beta.12

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
@@ -24,6 +24,119 @@ machinery and collection controls send no observation records.
24
24
  check uses the public Capxul SDK and verifies the backend response nonce.
25
25
  It does not authenticate a person or submit a transaction.
26
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
+ ## Personal Payments
57
+
58
+ ```sh
59
+ capxul payment send --input payment.json --request-key REQUEST_KEY --confirm --json
60
+ capxul payment send --resume REQUEST_KEY --confirm --json
61
+ capxul payment retry --payment-id PAYMENT_ID --confirm --json
62
+ capxul payment list --json
63
+ capxul payment get --payment-id PAYMENT_ID --json
64
+ capxul payment wait --payment-id PAYMENT_ID --timeout-seconds 120 --json
65
+ ```
66
+
67
+ These commands use the current authenticated session. Add `--email EMAIL` to
68
+ select a saved session. In a terminal, omit the required Payment ID to enter it.
69
+ `list` returns `{ payments }`. `get` returns `{ payment }` and refuses when the
70
+ Payment is absent or unavailable to the session. Human output shows the full ID,
71
+ status, amount, counterparty and available receipt.
72
+
73
+ `wait` observes the exact Payment until it reaches a terminal state or needs an
74
+ action. A failed Payment can be a completed observation. The timeout accepts
75
+ 1–3600 seconds and includes session restoration. A timeout or unavailable read
76
+ prints exact get/wait commands. Waiting never resubmits a Payment.
77
+
78
+ `send` accepts a bounded JSON file or `--input -` for stdin. An interactive
79
+ send can collect the recipient, asset, amount and document options. It validates
80
+ these fields, resolves the recipient, and previews the exact target before
81
+ confirmation. A scripted send requires `--request-key` and `--confirm`. A human
82
+ send generates a key when none was supplied. Signing starts after confirmation.
83
+
84
+ The CLI saves the exact input in protected local state before preparation. It
85
+ prints the request key and resume command, then prints prepared Payment IDs
86
+ before signing. `--resume` uses that saved input and key; it refuses input or key
87
+ overrides. Keep the same CLI home and authenticated person for recovery.
88
+ A different input cannot replace the saved input for the same key.
89
+
90
+ Send returns `{ payment, requestKey }` with the observed Payment state. Retry
91
+ returns `{ payments }` and addresses the existing Payment command. It never
92
+ creates a replacement send. Uncertain results keep exact read/wait or same-key
93
+ resume guidance. A submitted result does not prove settlement.
94
+
95
+ For an external address, JSON input must include
96
+ `"externalAddressAcknowledged": true`. `--confirm` alone does not acknowledge
97
+ the address. Human input shows the exact address and an unverified-recipient
98
+ warning before one default-No confirmation. Known Capxul Parties resolved from
99
+ addresses remain supported. Resume keeps the saved reference and acknowledgement.
100
+ A saved key cannot gain new acknowledgement; use fresh input and a fresh key.
101
+
102
+ ## Activity
103
+
104
+ ```sh
105
+ capxul activity list --limit 25 --json
106
+ capxul activity get --kind payment --id PAYMENT_ID --json
107
+ capxul activity get --kind movement --id MOVEMENT_ID --json
108
+ capxul activity summary --from 1790553600000 --to 1790639999999 --json
109
+ capxul activity annotate --input annotation.json --confirm --json
110
+ ```
111
+
112
+ Add explicit `--org ORGANIZATION_ID` for Organization scope. The saved
113
+ Organization read default does not select this scope. List supports kind,
114
+ direction, status and inclusive epoch-millisecond bounds. Reuse a cursor with
115
+ the same filters and actor. An unavailable indexer produces a visible incomplete
116
+ activity warning. Movement rows remain Movements.
117
+
118
+ Summary keeps exact per-asset raw-unit totals. Get returns exact detail and
119
+ refuses a missing or unavailable reference. Annotation accepts only `reference`,
120
+ `accountingCategory` and `memo`; it cannot alter settlement or documents. Human
121
+ writes require preview and confirmation. Scripted writes require `--confirm`.
122
+ In a terminal, omit required fields for guided flags and annotation input.
123
+
124
+ ## Payment documents
125
+
126
+ ```sh
127
+ capxul document get --document-hash H --content-hash C --json
128
+ capxul document verify --document-hash H --content-hash C --json
129
+ capxul document render --document-hash H --content-hash C > document.html
130
+ capxul document export --document-hash H --content-hash C --out original.bin
131
+ ```
132
+
133
+ Each command uses the current authenticated session. Add `--email EMAIL` to
134
+ select a saved session. In a terminal, omit required fields to enter them.
135
+ `get` returns the original base64 bytes and document metadata in JSON. `verify`
136
+ reports `ok: false` when verification fails. `render` writes the SDK HTML
137
+ exactly to standard output. `export` writes the original bytes to a new file.
138
+ It refuses an existing output file.
139
+
27
140
  ## Contact commands
28
141
 
29
142
  ```sh
@@ -69,6 +182,20 @@ returns `AddressBookEntry`. Human `get` prints `No contact found` for null and
69
182
  exits successfully. Entries retain their stable PartyId, exact reference,
70
183
  relationships, hidden state, and last activity time.
71
184
 
185
+ ## Personal Account reads
186
+
187
+ ```bash
188
+ capxul account status --email person@example.com
189
+ capxul account balance --json
190
+ capxul account deposit --wizard
191
+ ```
192
+
193
+ These commands reuse your verified current session unless you provide an email.
194
+ They do not start setup or open a signer. Status shows lifecycle and transaction
195
+ readiness; a failed lifecycle exposes its stage and error code. Balance shows
196
+ exact asset quantities and available fiat valuations. An unavailable valuation
197
+ or failed read is not zero. Deposit uses the SDK's address and network.
198
+
72
199
  ## Organization commands
73
200
 
74
201
  ```sh
@@ -89,29 +216,213 @@ These commands accept `--email`. Without it, they restore the protected current
89
216
  session. Organization reads accept `--org` or its alias `--org-id`. Identical
90
217
  repeated IDs are accepted. Different IDs are refused.
91
218
 
92
- A read without `--org` resolves one exact Organization in this order: the saved
93
- read default, then the recovery handle this machine recorded for the person's
94
- Organization journey. A recovery handle can also name an Organization whose
95
- setup lane still runs, which the own-access list does not carry yet; the read
96
- reports that exact lane, and it applies the usual current-access rule again once
97
- the Organization reports ready. The read refuses an Organization it cannot
98
- reach, and it never substitutes another one.
99
-
100
- `org use` requires an explicit Organization ID. It checks current access and
101
- saves a protected per-person read default. The default never grants authority.
102
- Each read checks current access again. Without an explicit ID or saved default,
103
- interactive mode asks you to select an Organization. JSON, CI, and noninteractive
104
- mode refuse missing scope. No command starts a signer or changes backend state.
105
-
106
- `org get` reports the canonical command `org.status`. Both member list forms
107
- report `org.members` and retain pending members with `accountId: null`.
108
- `org member get` matches the full AccountId, not a Safe address or ID prefix.
109
- No match returns exit 2. Duplicate matches return exit 1.
110
-
111
- `org wait` reads the same lifecycle every second until it reports `ready` or
112
- `failed`. It never retries setup. The timeout accepts integers from 1 to 3600
113
- seconds and defaults to 120. Timeout returns exit 5; interruption returns 130.
114
- A successful read can report a failed or pending domain state.
219
+ A read without --org uses the saved read default, then this machine's
220
+ recovery ID, then the one unfinished setup returned by the backend. org list
221
+ includes unfinished founder setups. This works from a clean authenticated home.
222
+ Interactive status/wait offers a choice when several unfinished setups exist.
223
+ Scripted and JSON reads require an exact --org in that case. A ready
224
+ Organization must still appear in current access.
225
+
226
+ Human output shows Organization identity and setup, with a separate unfinished
227
+ setup section and explicit empty results. Members without an Account ID remain
228
+ visible. `org me` shows backend capabilities and exact per-payment Budget caps;
229
+ these caps are not available balances. `--json` keeps the structured SDK data.
230
+
231
+ org use saves a protected per-person read default. Without --org, an interactive
232
+ use command offers current accessible Organizations and ignores the old default.
233
+ A scripted use requires --org. The default grants no
234
+ authority. Member lookup uses an exact AccountId. In a human terminal, omit
235
+ --account-id to select an attached Account from the authorized member list.
236
+ Members without an Account ID cannot be selected. Scripted and JSON lookup
237
+ requires --account-id. Reads do not sign or change
238
+ setup state.
239
+
240
+ org wait opens one exact setup subscription. It continues when needsAttention
241
+ has a scheduled next check. It stops at ready, failed, awaitingAuthorization,
242
+ or attention without a next check. It does not request a check or poll. The
243
+ timeout accepts 1 to 3600 seconds and defaults to 120. A deadline returns
244
+ CLI_DEADLINE at exit 5; Ctrl-C returns CANCELLED at exit 130.
245
+
246
+ ## Organization Payment send
247
+
248
+ ```sh
249
+ capxul org payment send --org O --input payment.json --request-key K --confirm --json
250
+ capxul org payment send --org O --resume K --confirm --json
251
+ capxul org payment send
252
+ ```
253
+
254
+ The Organization input adds its exact Budget ID as `permissionId`. It supports
255
+ the same recipient, amount, and V3 document fields as Personal send. It rejects
256
+ `timing` and payload actor, Organization, key, and lineage overrides. Scripted
257
+ calls require an explicit Organization, request identity, and `--confirm`.
258
+ A human terminal collects missing input and previews the selected actor, exact
259
+ Organization, Budget, treasury asset position, recipient, and document summary.
260
+ A saved read default does not select this write.
261
+
262
+ One default-No confirmation precedes signing. The protected input binds actor,
263
+ Organization, and key. Resume uses that input and forbids source/key overrides.
264
+ Prepared IDs reach stderr before the next signature. Send reports submission;
265
+ exact scoped get/wait establishes later state. JSON preview includes safe
266
+ summary fields and omits document bytes. External recipients use the same
267
+ literal-true input field and human warning as Personal send. Resume preserves
268
+ the saved reference even when the current lookup resolves to a Party.
269
+
270
+ ## Organization Payment reads
271
+
272
+ ```sh
273
+ capxul org payment list --org O [--json]
274
+ capxul org payment get --org O --payment-id P [--json]
275
+ capxul org payment wait --org O --payment-id P [--timeout-seconds N] [--json]
276
+ ```
277
+
278
+ These commands require an explicit Organization. They do not use the saved
279
+ read default. The backend checks current Organization participation and returns
280
+ only that Organization's outgoing, incoming, and self Payments. Get refuses
281
+ a missing or mismatched Payment ID. Reads do not need a signer.
282
+
283
+ Wait observes the exact Organization and Payment through the SDK subscription.
284
+ It stops on a terminal state, required action, or required retry. The timeout
285
+ accepts 1 to 3600 seconds and defaults to 120. It covers session restoration
286
+ and observation. Deadline exit 5 and interruption exit 130 retain read/wait
287
+ instructions with both Organization and Payment IDs.
288
+
289
+ ## Organization Payment retry
290
+
291
+ ```sh
292
+ capxul org payment retry --org O --payment-id P --confirm --json
293
+ capxul org payment retry
294
+ ```
295
+
296
+ Retry addresses the original command and every Payment in that command. It
297
+ creates no replacement send or request key. A terminal can collect the Payment
298
+ ID and select a currently accessible Organization. A saved read default does
299
+ not choose the write target. JSON and scripted runs require both IDs and
300
+ `--confirm`.
301
+
302
+ Before signing, the preview shows every original Payment, recipient, exact
303
+ asset and quantity, timing, and state. It also shows the original command and
304
+ stored Budget. A human terminal asks one default-no question, including when
305
+ `--confirm` is supplied. The signer starts after this step. A changed prepared cohort
306
+ or actor refuses before signature.
307
+
308
+ The result is `{ payments }` in the SDK's original order. Submitted Payments
309
+ can still be pending. A failure, timeout, or interruption retains the selected
310
+ Organization, Payment, and verified sibling IDs with same-scope get/wait
311
+ commands. Retry does not claim settlement from a submission hash.
312
+
313
+ ## Permissions
314
+
315
+ ```sh
316
+ capxul org permission list [--org O] [--json]
317
+ capxul org permission get --permission-id B [--org O] [--json]
318
+ capxul org permission create --org O --input budget.json --request-key K --confirm [--json]
319
+ capxul org permission change --org O --permission-id B --input budget.json --request-key K --confirm [--json]
320
+ ```
321
+
322
+ These commands use the explicit Organization, then the protected read default.
323
+ A human terminal can select an accessible Organization when neither exists.
324
+ Each read checks current Organization access. `get` requires an exact Permission
325
+ ID and refuses a missing or mismatched result. Reads do not need a signer.
326
+
327
+ Human output shows Permission and assignment IDs, revisions, and states.
328
+ Budget output labels the exact per-payment cap or no cap. It does not show a
329
+ remaining balance. JSON preserves the public SDK result.
330
+
331
+ Every Budget write supplies the complete policy:
332
+
333
+ ```json
334
+ {
335
+ "type": "budget",
336
+ "asset": "A",
337
+ "limit": { "asset": "A", "value": "500" },
338
+ "scope": {
339
+ "recipients": { "type": "allowlist", "accounts": ["account_alice"] },
340
+ "actions": ["pay"]
341
+ }
342
+ }
343
+ ```
344
+
345
+ Use an exact admitted AssetId for `A`. The cap must be positive and finite.
346
+ Recipients are `anyone` or 1 to 32 unique Account IDs. Actions are `pay`,
347
+ `commitments`, or both. `pay` covers single and batch Payments. Missing scope,
348
+ duplicate recipients/actions, unknown fields, and an asset mismatch refuse.
349
+ A Budget change keeps its asset. Management input is `{"type":"managePeople"}`.
350
+ Use `--input -` for stdin. Input is limited to 64 KiB.
351
+
352
+ A human terminal can guide policy input. Change prefills the exact active
353
+ revision's complete stored policy. The preview shows all before/after rights
354
+ and any allowance reset before one default-no confirmation. The CLI then records
355
+ verified prepared IDs and compares the frozen policy with that confirmation.
356
+ If it changed, the CLI refuses before signing. A missing human key is generated
357
+ and printed before the first write. Scripted runs require `--request-key` and
358
+ `--confirm`.
359
+
360
+ Success means submitted and pending application. It does not prove active
361
+ rights. After an interruption or uncertain result, retain the original input,
362
+ Organization ID, key, command ID, and execution ID. The key alone cannot restore
363
+ wizard/stdin input.
364
+
365
+ `org permission replace --org O --request-key K --confirm` replaces the current
366
+ Roles module and carries its active Permissions, assignments, and admitted
367
+ Invitation rights. Human mode guides missing scope and shows the full frozen
368
+ before/after snapshot before one default-no approval. Machine mode requires
369
+ scope, key, and confirmation. A changed snapshot refuses before staging or
370
+ signature. Unfinished Invitation configuration must complete or cancel first.
371
+ Submission remains pending application. Use exact command get/wait after an
372
+ uncertain result; the command does not promise unconditional replacement replay.
373
+
374
+ ## Payroll runs, rosters, and reads
375
+
376
+ ```sh
377
+ capxul org payroll groups list --org O [--json]
378
+ capxul org payroll groups save --org O --input group.json --confirm [--json]
379
+ capxul org payroll groups remove --org O --group-id G --confirm [--json]
380
+ capxul org payroll terms --org O [--json]
381
+ capxul org payroll list --org O [--json]
382
+ capxul org payroll run --org O --input run.json --request-key K --confirm [--json]
383
+ capxul org payroll run --org O --resume K --confirm [--json]
384
+ capxul org payroll get --org O --run-id R [--json]
385
+ capxul org payroll wait --org O --run-id R --timeout-seconds 120 [--json]
386
+ ```
387
+
388
+ Group input contains `name`, `tone`, and `members`. Each member supplies a
389
+ canonical `partyId`, draft `amount` text, and `currency`. An optional `id`
390
+ updates that exact group. These commands do not sign or transfer money.
391
+ Group amounts stay unchanged, including unfinished draft text. They do not
392
+ supply payout quantities or currency conversion. A lost create response must
393
+ be reconciled with the same scoped group list before another create.
394
+
395
+ Terms retain raw rates, decimals, units, and effective dates. Run listing
396
+ retains the backend `settledThisMonth` aggregate. The CLI does not sum a partial
397
+ run page or compute earned pay.
398
+
399
+ Run input contains `permissionId`, `asset`, `period`, and ordered `items`.
400
+ Each item supplies a recipient Ref, asserted `partyId`, settlement `amount`,
401
+ raw-unit `gross` and `net`, and signed `adjustments`. Net must equal the exact
402
+ settlement quantity and gross plus adjustments. Keep Organization, actor, signer,
403
+ and request-key routing outside the JSON. `--input -` reads bounded stdin.
404
+ The current Payroll producer accepts email and Party Refs. Other Ref kinds
405
+ refuse before client work.
406
+
407
+ In a human terminal, `capxul org payroll run` guides the current Organization,
408
+ Budget, settlement asset, date, roster or known Parties, and actual payout
409
+ quantities. Roster amounts and terms are reference data. The complete preview
410
+ shows each recipient and Safe, quantity, raw units, and adjustment. One
411
+ default-no approval precedes signing, including when `--confirm` is supplied.
412
+ Machine runs require exact scope, input, key, and `--confirm`.
413
+
414
+ The command saves the exact input in protected storage under the verified actor,
415
+ Organization, and key before execution. `--resume K` restores that snapshot.
416
+ It requires the same explicit Organization and cannot combine fresh input or
417
+ another key. Payroll accepts email and Party references. Raw external addresses
418
+ are outside the current run contract.
419
+ Success returns `{ run, requestKey }`; submission does not prove settlement.
420
+
421
+ Get returns the full authorized run detail, command, ordered items, and recorded
422
+ times. Wait observes the exact run without polling or submitting. It keeps
423
+ waiting through partial settlement and ends when all Payments settle, a failure
424
+ is recorded, or action is required. Timeout exits 5. Cancellation exits 130.
425
+ Recovery retains exact Organization, run, and any observed request key.
115
426
 
116
427
  ## Invitation commands
117
428
 
@@ -143,8 +454,35 @@ the invitation or the pages end. They never consult the saved read default, and
143
454
  an offer you cannot see is refused. `--timeout-seconds` bounds the resolution
144
455
  and the read together on both commands.
145
456
 
146
- `org invite wait` only reads. It finishes when the offer settles or when the
147
- recovery asks a person to act. It never retries, resends, or accepts.
457
+ Invitation lists label own-offer or Organization Admin scope and the verified
458
+ actor. They show an explicit empty page, next cursor, or end of results. Page
459
+ filters and cursor values stay in their selected scope.
460
+
461
+ Invitation human output shows the authoritative phase, delivery, expiry, and
462
+ offered policies. An offer does not prove active membership. Manual resend/retry commands come only
463
+ from the backend action projection, with exact scope/session and earliest time.
464
+ Older responses without that projection show read-back guidance. Lifecycle
465
+ recovery remains separate from manual options. Member-invite
466
+ previews show exact per-payment caps and allowed recipients/actions; expiry is
467
+ unavailable before authoring. The native authoring wizard asks for Organization,
468
+ recipient, grants and policy before session email. New-Budget labels identify
469
+ policy inputs; skip them for existing grants. Wizard answers use the same request
470
+ validation as flags. Every authoring write prints its request key
471
+ before submission. JSON result data stays unchanged.
472
+
473
+ Uncertain decline/cancel/resend/retry failures and transition deadlines print an
474
+ exact `org invite get` command with the resolved session. Read the current offer
475
+ before another transition; a lost response does not authorize replay.
476
+
477
+ `org invite wait` uses one exact SDK subscription after resolving scope. It
478
+ finishes when the offer settles or lifecycle recovery asks a person to act.
479
+ Manual recovery options do not stop the wait. It never polls, retries, resends,
480
+ or accepts. The deadline covers resolution and observation; completion, failure
481
+ and interruption release the subscription, including a handle that arrives late.
482
+
483
+ Native invitation target prompts ask Organization and invitation IDs before
484
+ session email. Transition confirmation shows the verified actor and the current
485
+ resolved offer, including grants and expiry, before the default-No question.
148
486
 
149
487
  `org invite review` requires `--org`, returns the current `InvitationView`
150
488
  directly in `data`, and performs no write or signing.
@@ -175,109 +513,40 @@ returned view is the authorization-time view of the consent commit
175
513
 
176
514
  ## Organization writes
177
515
 
178
- `org create` and `org retry` restore the protected current session and start the
179
- existing command-scoped browser signer. They never read or write the saved read
180
- default. `org create` writes the person's Organization recovery handle. That
181
- handle holds the exact business handle and the exact Organization ID, and it
182
- holds nothing else. Local input checks run before any client, browser, or
183
- backend work, and they include the confirmation gate:
184
-
185
- - A noninteractive or JSON write requires `--confirm`. Without it the command
186
- refuses with exit 2 before any client, browser, or mutation work.
187
- - A terminal write verifies the session and performs its Organization reads
188
- first, then prints the resolved preview and asks a default-no prompt, even when
189
- `--confirm` is supplied. Rejection refuses with exit 2. An absent session is
190
- exit 3 before any preview. The browser signer is built only after confirmation
191
- succeeds, so a refused write never starts it.
192
-
193
- `--email` selects the session explicitly. Otherwise the protected
194
- current-session pointer decides. An invalid explicit email refuses with exit 2.
195
-
196
- `--timeout-seconds` bounds the command's own wait, not backend execution. It
197
- accepts integers from 1 to 3600 and defaults to 120, and it is one deadline for
198
- the whole write: the `completeOrganization` or `retrySetup` call and the
199
- settlement that follows share it. While a lane settles the command reads the
200
- exact Organization lifecycle every second with no overlapping read. At the
201
- deadline the active SDK signal is aborted, so the command stops waiting and
202
- forwards no further signature, while the durable backend lane keeps running.
203
- Committed lifecycle progress is flushed first, so the Organization ID stays on
204
- stderr and the same Organization resumes with `org retry --org`. Exceeding the
205
- deadline returns exit 5.
206
-
207
- `org create` validates `--name`, the `--handle` grammar, and the ISO `--country`
208
- code first, and its terminal preview also lists the Organizations the person
209
- already has. It subscribes to the onboarding Organization-state projection, then
210
- completes the Organization with an explicit create intent. The first committed
211
- Organization ID is retained, and each committed lifecycle change is written to
212
- stderr before the next Organization authorization digest reaches the signer.
213
- JSON mode writes one newline-delimited progress object per change:
214
-
215
- ```json
216
- { "type": "organization.lifecycle", "organizationId": "O", "status": "settingUp" }
217
- ```
218
-
219
- Human mode prints the full Organization ID and lifecycle status. A refused or
220
- failed lane still reports the Organization it is about. The command returns
221
- success only after an exact `org(O).getLifecycle()` read reports `ready`. It
222
- never saves a read default and never returns a different ready Organization.
223
-
224
- `org create` continues the Organization journey this machine already prepared.
225
- Before the first durable write it records the exact business handle as the safe
226
- recovery handle. It adds the first committed Organization ID to that handle
227
- before it forwards any founder authorization digest, and it keeps that handle
228
- after a failure, an interruption, or a ready result. A later create therefore
229
- resolves exactly one Organization:
230
-
231
- - The same handle resumes the exact recorded Organization. It calls the SDK
232
- recovery owner once per attempt and settles the same lifecycle. It never
233
- submits a second bootstrap, and it never creates a second Organization or
234
- treasury.
235
- - A different handle refuses with exit 2 while the recorded Organization is not
236
- ready. The refusal names the exact Organization.
237
- - A different handle creates one Organization only after the recorded
238
- Organization reaches ready.
239
- - A recorded Organization that is already ready, and still in the person's
240
- current access, returns unchanged, with no write and no signature. A ready
241
- result the person can no longer reach refuses, and the committed recovery
242
- handle stays recorded for exact recovery.
243
- - A create that continues a recorded handle checks current access before it
244
- reports success. The committed Organization ID becomes durable first, so a
245
- refusal or an interruption keeps the exact recovery handle, and a ready
246
- lifecycle line reaches stderr only after the check resolves.
247
- - A terminal preview reads the recorded Organization's lifecycle only for the
248
- handle that continues it. A different handle is a new creation, so an
249
- unreachable recorded Organization never blocks it.
250
- - A handle the backend refuses is refused before any Organization write. The
251
- command releases the prepared handle, so the person can correct the handle and
252
- create. Every other failure keeps the handle, because its Organization may
253
- already exist.
254
-
255
- The recovery line names the exact Organization and the safe handle. JSON mode
256
- writes it as one newline-delimited progress object:
257
-
258
- ```json
259
- { "type": "organization.recovery", "organizationId": "O", "handle": "acme" }
260
- ```
261
-
262
- `org retry` stays explicit: `--org` (or its alias `--org-id`) is the one write
263
- scope, and no read default or recovery handle is consulted.
264
-
265
- `org retry` requires an explicit `--org` (or `--org-id`). It validates the ID
266
- with the public `toOrgId` constructor, reads that exact Organization's lifecycle
267
- for its terminal preview, resumes that same durable setup lane, then settles the
268
- same Organization's lifecycle. A resumed lane that asks the
269
- signer to reset its session clears the stale readiness, closes that browser
270
- bridge, and opens the next one for the same command. `org retry` never creates a
271
- replacement Organization and never changes the read default. An already-ready
272
- Organization returns that exact readiness without a signature. A conflicting
273
- failed or in-flight lane is preserved and refused.
274
-
275
- The result data for both commands is `{ organizationId, lifecycle }`. A known
276
- Organization ID on a `WRONG_STATE` refusal appears only in the SDK-supplied
277
- `error.details.organizationId` field, and the refusal copy names the recovery
278
- action instead of authentication guidance. No token, OTP, signature, or signer
279
- capability is ever printed. Interruption returns 130 and closes both the
280
- subscription and the browser bridge.
516
+ org create and org retry use the protected current session unless --email names
517
+ one. A JSON or noninteractive write requires --confirm. A terminal write shows
518
+ the current Organization and recovery information, then asks a default-no
519
+ question. The signer starts after confirmation.
520
+
521
+ `org create --wizard` guides name, handle, country, optional bio and size, then
522
+ session email. Supplied flags remain in the generated command. The final write
523
+ preview names the verified actor and starts with No selected.
524
+ `org retry --wizard` collects the exact Organization ID before session email.
525
+ Its final preview shows the verified actor and current lifecycle. Saved read
526
+ defaults and creation recovery records cannot change that retry ID.
527
+
528
+ org create validates name, handle, and country before client work. It calls
529
+ onboarding.beginOrganization, saves and prints the exact Organization ID,
530
+ authorizes only an awaitingAuthorization setup, then subscribes to setup
531
+ changes. It reports success only after ready and current access. JSON progress
532
+ uses one line per state:
533
+
534
+ { "type": "organization.lifecycle", "organizationId": "O", "status": "processing" }
535
+
536
+ org retry requires one exact --org. It authorizes only awaitingAuthorization.
537
+ For an accepted setup it asks the backend to check the same operation hash
538
+ through setup.resume, then subscribes. Neither command replaces a submitted
539
+ operation. The local recovery record keeps a safe handle and Organization ID
540
+ for convenience; the backend unfinished list supports recovery without it.
541
+
542
+ --timeout-seconds sets one 1-to-3600-second deadline for the command. A
543
+ deadline stops local work and returns exit 5. If the last observed setup has
544
+ another automatic check scheduled, the message is "Stopped waiting.
545
+ Organization setup continues in the background." Before acceptance or without
546
+ a scheduled check, the message is "Stopped waiting. Read the Organization
547
+ setup status." The error details include the safe Organization ID when known,
548
+ last observed setup state, setup reason, and bounded provider diagnostics.
549
+ Ctrl-C stops local work at exit 130. Neither stop writes a backend failure.
281
550
 
282
551
  ## Configuration
283
552
 
@@ -318,6 +587,14 @@ unsafe permissions, symlinks, and corrupt state produce a storage failure.
318
587
 
319
588
  ## Output
320
589
 
590
+ Organization setup failures include a copyable command with the exact ID and
591
+ selected email. When state is uncertain, read status first. A supported retry
592
+ includes `--confirm`; terminal runs still ask for confirmation. If no ID is
593
+ known, the command lists your Organizations instead of guessing one.
594
+ JSON errors can include `error.details.recovery` with `kind` (`read` or `retry`)
595
+ and an `argv` array for that primary action. These arguments preserve the same
596
+ scope as the human command; they do not grant authority or bypass current checks.
597
+
321
598
  `--json` writes one version 1 envelope to stdout. Success contains `data`, which
322
599
  can be an object, array, or null according to the command's SDK result.
323
600
  Failure contains `error.code` and CLI-owned `error.message`. A wallet failure
@@ -388,6 +665,7 @@ silent and do not change the command result. This check sends no telemetry.
388
665
  ```sh
389
666
  vp test run apps/cli
390
667
  vp run --filter @capxul/cli check-types
668
+ vp run --filter @capxul/cli lint
391
669
  vp run --filter @capxul/cli build
392
670
  vp exec node --test --test-name-pattern='@capxul/cli' scripts/__tests__/pack-install-smoke.test.mjs
393
671
  ```
@@ -398,11 +676,10 @@ installed executable with isolated settings and a local HTTP server. The CI
398
676
 
399
677
  ## Email login and session restoration
400
678
 
401
- This CLI establishes a first-party BetterAuth session. It has broader authority
402
- than the earlier native `account:read` grant. Existing native grants remain
403
- stored and tagged as `legacy-native-grant` in status. A profile read asks for an
404
- explicit new login; it never exchanges the old grant for a broader session.
405
- Logout forgets and attempts to revoke both credential types for the selected email.
679
+ This CLI establishes a first-party BetterAuth session. An older native
680
+ `account:read` grant does not count as sign-in and cannot read the profile.
681
+ Logout clears the selected email's session and attempts to revoke any native
682
+ grant that was stored before the first-party flow replaced it.
406
683
 
407
684
  `capxul auth login` and `capxul auth signup` stay separate commands. On a
408
685
  terminal, each command is a wizard. `auth login` asks for the email and a masked
@@ -433,6 +710,20 @@ capxul auth status --email "$TEST_EMAIL" --json
433
710
  capxul auth logout --email "$TEST_EMAIL" --json
434
711
  ```
435
712
 
713
+ After sending a code, human output includes the exact verification command with
714
+ your email safely quoted. If verification has no pending code, the error gives
715
+ the exact command to request one. Neither command includes the OTP itself.
716
+
717
+ If account setup or its final read fails recoverably, the CLI prints an exact
718
+ `auth signup` continuation with your email and Profile fields. Run it with the
719
+ same protected CLI home to resume the saved session. Explicit access/input
720
+ refusals and non-retryable failures require their stated correction first.
721
+
722
+ Human profile/status output labels your Profile fields and available Account,
723
+ wallet and Smart Account identifiers. Failed setup includes its stage and error
724
+ code. These reads do not open the wallet browser. `--json` retains the structured
725
+ result, including the same Profile and lifecycle values.
726
+
436
727
  A machine run never prompts. `auth login` with `--otp-stdin` sends the OTP and
437
728
  verifies one code from stdin. It returns the tagged result
438
729
  `setupState: "setup-required"` when the account needs setup. It does not start
@@ -495,3 +786,58 @@ the browser. Successful email authentication can return `setupState: "setup-requ
495
786
  `auth signup` returns `setupState: "ready"` only after Core reads a ready Account.
496
787
  After logout, profile reads refuse with `NOT_AUTHENTICATED` and exit 3. An invalid
497
788
  or expired OTP refuses with exit 2.
789
+
790
+ Resume an existing personal Account after incomplete setup:
791
+
792
+ ```sh
793
+ capxul account retry --email you@example.com --confirm --timeout-seconds 120
794
+ capxul account retry --email you@example.com --wizard
795
+ ```
796
+
797
+ The terminal shows the verified session, Account ID and current lifecycle before
798
+ confirmation. A ready Account starts no wallet work. Missing Account or Profile
799
+ state directs to `auth signup`. A deadline stops waiting; check `account status`
800
+ for the same session before retrying.
801
+
802
+ Read an Organization treasury or deposit target:
803
+
804
+ ```sh
805
+ capxul org balance --org org_example --email you@example.com
806
+ capxul org deposit --org org_example --email you@example.com
807
+ capxul org balance --wizard
808
+ ```
809
+
810
+ These commands use the existing Organization read selection. Balances require
811
+ backend treasury access. Deposit instructions use the public SDK's own-access
812
+ projection. Neither command starts a signer or changes Organization setup.
813
+
814
+ Contact reads show the selected scope, label, full Party ID, reference,
815
+ relationships and hidden state. JSON keeps the existing array, entry or null.
816
+
817
+ ```sh
818
+ capxul contact list --include-hidden
819
+ capxul contact get --entry-id party_example
820
+ capxul org contact get --org org_example --wizard
821
+ ```
822
+
823
+ In a terminal, omit `--entry-id` to select a contact, including hidden contacts.
824
+ In a script, provide the exact Party ID. Organization contacts always require
825
+ an explicit `--org`; they never use the personal book as a fallback.
826
+
827
+ Contact add shows the reference and optional label before terminal confirmation.
828
+ Without an input file, the wizard asks for these values. On an uncertain response,
829
+ use the printed list command to check the same address book before adding again.
830
+ Adding an existing contact can unhide it or change its label.
831
+
832
+ Change a contact label with `contact label --entry-id party_example --label
833
+ "New label" --confirm`. In a terminal, omit the Party ID to select from the
834
+ same book, including hidden contacts. Organization labels require `--org`.
835
+ After an uncertain response, use the exact get command printed by the CLI.
836
+
837
+ `contact hide` can select a contact in a terminal when `--entry-id` is omitted.
838
+ It confirms the hidden state, then prints the exact `contact unhide` command for
839
+ the same Party, session and scope. The contact's history remains available.
840
+
841
+ `contact unhide` uses the same scoped selector, including hidden contacts, when
842
+ a terminal omits `--entry-id`. It confirms the change and shows the visible
843
+ contact. Scripts provide the exact Party ID and `--confirm`.