@candledottv/cli 0.13.14 → 0.13.15
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 +33 -2
- package/dist/index.js +5105 -4374
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,16 +89,18 @@ emergency procedure, rebinding, trusted wallets and API key access levels are al
|
|
|
89
89
|
| `candle auth status` | Shows which storage backend is in use, both credential prefixes, the config file path, and a live validity check for each credential. |
|
|
90
90
|
| `candle auth logout [--keep-key]` | Revokes the stored API key (skipped with `--keep-key`), clears local credentials and config, and prints the portal URL for revoking the device itself. |
|
|
91
91
|
| `candle keys list [--scopes]` | Lists this account's API keys: prefix, name, Read, Write or Withdraw access, environment, timestamps, and which device minted each one. `--scopes` adds the raw scopes, sorted. |
|
|
92
|
-
| `candle keys create [--access read\|write\|withdraw \| --scopes <a,b,c>] [--label <name>] [--expires-in <days>] [--tx-limit <usd> [--reset daily\|weekly\|monthly\|never]] [--embedded-wallet deny\|allow]` | Creates a new API key and prints the plaintext exactly once, with the same optional name, expiration, and USD transaction limit the portal's create form takes. `--access` mints one of the portal's three levels (`write` trades and launches and cannot move funds; `withdraw` is Write plus `transfer:write` and `transfer:bound`: the key can move funds between your own wallets and to addresses you approved, and out of the wallet it runs to wallets you linked while signed in or marked trusted and to that wallet's vault); `--scopes` names raw scopes instead, never both. `--embedded-wallet` defaults to `deny`; `allow` lets the key spend the account's embedded wallet and is confirmed at a terminal. Stored locally only if the CLI does not already hold a working key. An account holds at most
|
|
92
|
+
| `candle keys create [--access read\|write\|withdraw \| --scopes <a,b,c>] [--label <name>] [--expires-in <days>] [--tx-limit <usd> [--reset daily\|weekly\|monthly\|never]] [--embedded-wallet deny\|allow]` | Creates a new API key and prints the plaintext exactly once, with the same optional name, expiration, and USD transaction limit the portal's create form takes. `--access` mints one of the portal's three levels (`write` trades and launches and cannot move funds; `withdraw` is Write plus `transfer:write` and `transfer:bound`: the key can move funds between your own wallets and to addresses you approved, and out of the wallet it runs to wallets you linked while signed in or marked trusted and to that wallet's vault); `--scopes` names raw scopes instead, never both. `--embedded-wallet` defaults to `deny`; `allow` lets the key spend the account's embedded wallet and is confirmed at a terminal. Stored locally only if the CLI does not already hold a working key. An account holds at most 25 active keys. |
|
|
93
93
|
| `candle keys access <prefix\|label\|self> (--access read\|write\|withdraw [--yes] \| --history)` | Changes an existing key's level in place (same key, wallets and caps). Widening needs the device token and the prefix typed back at a terminal; `--yes` skips the prompt when narrowing; `self` narrows the profile's own key and can never widen it. `--history` lists the key's changes and who made them. |
|
|
94
94
|
| `candle keys update <prefix\|label> --embedded-wallet allow\|deny [--yes]`, `candle keys self embedded-wallet deny` | Allow or deny a key the account's embedded wallet, with the device token (allowing needs the prefix typed back at a terminal). `self embedded-wallet deny` lets the profile's own key give it up with no prompt; a key can never allow itself. |
|
|
95
95
|
| `candle keys signer approve <code> --key <prefix\|label> [--reject]`, `candle keys signer move <prefix\|label> [--to-key <prefix\|label>]` | Key signers for bots on a different machine from the vault. `approve` accepts (or rejects) a key's signer request with the device token, after you type the full fingerprint the trading machine printed. `move`, on the machine holding a wallet's current signer, moves every wallet on the key onto its active signer; `--to-key` moves a revoked key's wallets to a live key. |
|
|
96
96
|
| `candle keys stop <prefix>` | Pause one key using the device token. Its requests are refused with `PROFILE_PAUSED` until resumed; the key and its local credential are kept. Repeating the command succeeds. |
|
|
97
97
|
| `candle keys resume <prefix>` | Resume a stopped key using the device token. Repeating the command succeeds. An API key cannot stop or resume itself; a revoked key cannot be resumed. |
|
|
98
|
-
| `candle keys
|
|
98
|
+
| `candle keys rotate <prefix\|label> ([--grace <duration> \| --now] [--force] [--yes] [--idempotency-key <key>] \| --finish)` | Gives a key a new secret and keeps its prefix, label, access, limits, wallets and history. The old secret keeps working through `--grace` (default `1h`, at most `24h`) or stops at once with `--now`; `--finish` ends an open window early. When the key is the CLI's own, the new secret replaces it in the keychain. A copy in `CANDLE_API_KEY` or anywhere else must be updated by hand before the window ends; `candle doctor` warns while the old secret is in use. Each run sends an `Idempotency-Key` and retries a dropped connection once; if there is still no answer, rerun with the printed `--idempotency-key` to recover the first secret. |
|
|
99
|
+
| `candle keys revoke <prefix>` | Revokes an API key by prefix. Revoking the CLI's own stored key also clears it locally. A prefix can start with `-`; the key commands accept it as typed, and `--` (`candle keys revoke -- -QVeHyie`) ends the options on any command. |
|
|
99
100
|
| `candle keys wallets <prefix>`, `keys wallets set <prefix> --wallets <id,id>`, `keys wallets scope <prefix> --scope all\|selected` | Each key is an agent profile with its own wallet set: list it, replace it, or limit the profile to its assigned wallets. |
|
|
100
101
|
| `candle wallets` (alias `candle wallet`) | Shows the account's embedded (launch) wallets and any linked wallets, using the API key, with a `Signer` column saying whether this machine holds each linked wallet's signing key and a `Trusted` column saying whether it is yours (linked while signed in, or marked with `trust`). It links and revokes; it never generates or prints a key, which the vault now derives. |
|
|
101
102
|
| `candle wallets import --chain solana\|evm`, `wallets revoke <wallet-id>` | Link a wallet you own (key from `--key-file` or a hidden prompt, sealed to Privy before it leaves the machine), or unlink one. |
|
|
103
|
+
| `candle wallets authorize` | Gives agents access to the account's embedded wallets. The grant is yours to make in a browser (each wallet's owner is you, so neither the CLI nor the API can attach Candle's signer): this opens the Agents page's grant-only step, creates no key, and with an API key waits until the wallets show as delegated. On a new account, run it before `candle auth login`. |
|
|
102
104
|
| `candle wallets trust\|untrust <label\|address\|id\|prefix*>...` | Mark linked wallets as yours so an agent's Withdraw key can move funds into them, or clear the mark. Owner only, over the device token, with a typed confirm; a trailing `*`, as in `'tr-*'`, selects by prefix. |
|
|
103
105
|
| `candle wallets allow-launch\|disallow-launch <label\|address\|id\|prefix*>...` | Deprecated. Where the server has `TEE_LAUNCH_BY_SCOPE_ENABLED` on, a key's `launch:write` decides TEE launches: `allow-launch` saves the value and exits 0, and `disallow-launch` saves it, prints the server's `ALLOW_LAUNCH_NOT_ENFORCED` message and exits 1, because no launch is stopped. A server with the switch off still lets TEE wallets pay for a launch (`candle launch`) only after `allow-launch`. Owner only, over the device token; the screen shows each wallet's label, address and bound key before a typed confirm. `disallow-launch --yes` skips the confirm. |
|
|
104
106
|
| `candle wallets close-empty [--wallet embedded\|<tee address\|label>] [--keep <mint>]... [--yes]` | Closes a wallet's empty token accounts and returns their rent to it, after a preview: the embedded wallet (`transfer:write`), or a Solana TEE wallet bound to the key (`swap:write`), whose close transactions Candle builds, this machine checks and the key signer approves. |
|
|
@@ -577,3 +579,32 @@ bytes once, and exit 3 retains the key. A comment cannot be edited and is never
|
|
|
577
579
|
`candle token comments <address> [--limit <n>] [--cursor <c>]` lists comments newest first with
|
|
578
580
|
tombstones; it is public and sends no key. `candle token post delete` removes the key account's own
|
|
579
581
|
comment, including after selling. Package release remains a separate human-owned step.
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
### Agent key rotation API
|
|
585
|
+
|
|
586
|
+
Owner clients can call `POST /api/v1/agent/keys/{prefix}/rotate` using a Privy session or
|
|
587
|
+
CLI device token (an agent API key is refused). Send a JSON object with optional
|
|
588
|
+
`graceSeconds` (integer 0–86400, default 3600) and `force` (boolean, default false).
|
|
589
|
+
Persist an `Idempotency-Key` header and reuse the same header, actor and input after a
|
|
590
|
+
lost response: every identity store returns the same secret and timestamps; conflicting
|
|
591
|
+
reuse returns 409. The response is `{ key, keyPrefix, rotatedAt, previousValidUntil, note }`.
|
|
592
|
+
Save `key` securely; `previousValidUntil` is epoch milliseconds or null for zero grace.
|
|
593
|
+
|
|
594
|
+
Rotation preserves the prefix, bindings, settings, history and original expiry.
|
|
595
|
+
An open grace window requires `force: true` to rotate again, discarding its oldest secret.
|
|
596
|
+
Old-secret responses carry `X-Candle-Key-Rotated` with an ISO UTC deadline. Update external
|
|
597
|
+
copies before that deadline. `POST /api/v1/agent/keys/{prefix}/rotate/finish` (no body)
|
|
598
|
+
ends grace immediately and returns `{ keyPrefix, changed }`; repeating it is harmless.
|
|
599
|
+
Zero grace also invalidates the old secret immediately. Invalid JSON/non-object bodies
|
|
600
|
+
return 400 without mutation; other-owner prefixes return 404; revoked, expired and hosted
|
|
601
|
+
MCP keys return 409; contained accounts return 403. `candle keys rotate` (see the commands
|
|
602
|
+
table) drives this route and updates the CLI's own keychain slot.
|
|
603
|
+
|
|
604
|
+
See [agent access](../../apps/docs/src/content/docs/developers/agent-access.md#rotating-a-key)
|
|
605
|
+
for the complete contract.
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
During the verifier upgrade, rotation and finish may return retryable 503 with reason
|
|
609
|
+
`rotation_verifier_not_ready` before changing any credential. Keep the existing secret
|
|
610
|
+
and retry after the service is ready; the API does not silently shorten the grace guarantee.
|