@candledottv/cli 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -3
- package/dist/index.js +6242 -135
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -38,21 +38,30 @@ node packages/cli/dist/index.js auth login
|
|
|
38
38
|
| Command | What it does |
|
|
39
39
|
| --- | --- |
|
|
40
40
|
| `candle setup [--no-browser]` | The onboarding wizard: authorizes this device (skipped when already authorized), prints the agent wallets as funding destinations plus the paste-into-your-agent brief, shows the skill/MCP install lines, runs the full doctor check (setup's exit code is doctor's), and links the web console. Safe to re-run. |
|
|
41
|
-
| `candle auth login [--scopes <a,b,c>] [--label <name>] [--no-browser]` | Authorizes this device: prints a code, opens (or prints) an approval URL, polls until approved, then stores the resulting device token and API key. |
|
|
41
|
+
| `candle auth login [--profile <name>] [--scopes <a,b,c>] [--label <name>] [--no-browser]` | Authorizes this device: prints a code, opens (or prints) an approval URL, polls until approved, then stores the resulting device token and API key. |
|
|
42
42
|
| `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. |
|
|
43
43
|
| `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. |
|
|
44
44
|
| `candle keys list` | Lists this account's API keys: prefix, scopes, environment, timestamps, and which device minted each one. |
|
|
45
45
|
| `candle keys create [--scopes <a,b,c>] [--label <name>] [--expires-in <days>] [--tx-limit <usd> [--reset daily\|weekly\|monthly\|never]]` | 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. Stored locally only if the CLI does not already hold a working key. |
|
|
46
46
|
| `candle keys revoke <prefix>` | Revokes an API key by prefix. Revoking the CLI's own stored key also clears it locally. |
|
|
47
|
-
| `candle wallets` | Shows the account's embedded (launch) wallets and any linked wallets, using the API key. |
|
|
48
|
-
| `candle
|
|
47
|
+
| `candle wallets` | 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. |
|
|
48
|
+
| `candle profile list` | Lists profiles on this machine, with cached accounts. |
|
|
49
|
+
| `candle profile add <name> --api-url <url>` | Creates a profile before authenticating it. |
|
|
50
|
+
| `candle profile use <name>` | Makes a profile the active one. |
|
|
51
|
+
| `candle profile rename <old> <new>` | Renames a profile. |
|
|
52
|
+
| `candle profile remove <name> --yes` | Deletes a profile and its stored credentials. |
|
|
53
|
+
| `candle mcp [--tools <a,b,c>] [--read-only] [--print-config]` | Runs the Candle MCP server (`npx @candledottv/mcp`) with this CLI's stored API key and API URL in its environment, so an MCP client config is just `{"mcpServers": {"candle": {"command": "/Users/you/.local/bin/candle", "args": ["mcp"]}}}` -- the absolute path, because GUI hosts launch servers with the app's environment and never see your PATH. Run `--print-config` to print that block filled in for this install. `--read-only` starts it with no key and only the four keyless read tools; `--tools` pins an explicit allowlist. |
|
|
49
54
|
| `candle doctor` | Runs a full health check (runtime, backend, credentials, API reachability, credential validity, wallet delegation) as a PASS/FAIL/SKIP table. Exits nonzero on any FAIL. |
|
|
55
|
+
| `candle verify <file> --bundle <path> [--identity <uri>] [--issuer <url>]` | Verifies a release asset's Sigstore bundle against the trusted root compiled into this binary. No network, no credentials, and nothing else installed: the bundle carries the certificate and the transparency-log entry. `--identity` defaults to the release identity for the version in a `latest.json` sitting beside the bundle; `--issuer` defaults to GitHub Actions'. Prints `verified: <identity>` and exits 0, or the reason on stderr and exits 1. |
|
|
56
|
+
| `candle update [--check] [--to <tag>]` | Replaces this binary with the latest signed release. The download is renamed over the running binary only after its SHA-256 matches both SHA256SUMS and `latest.json` AND its Sigstore bundle verifies in process against that exact version's release workflow. `--check` reports what is available and installs nothing; `--to <tag>` pins a release (an older one installs, with a warning). A Homebrew or npm install is left alone, with the command that owns it printed instead. |
|
|
50
57
|
|
|
51
58
|
Every command accepts these global options:
|
|
52
59
|
|
|
53
60
|
| Flag | Effect |
|
|
54
61
|
| --- | --- |
|
|
55
62
|
| `--api-url <url>` | Overrides the API base URL for this invocation, beating `CANDLE_API_URL` and the stored config value. |
|
|
63
|
+
| `--profile <name>` | Act as a named profile; see Profiles below. |
|
|
64
|
+
| `--no-verify-account` | Skips the check that the stored key belongs to the profile's account. |
|
|
56
65
|
| `--json` | Machine-readable output instead of a formatted table or summary, generally the underlying API response. One exception: `auth login`'s JSON output still omits the plaintext device token and API key, matching its human-readable summary, since login never displays either value in any mode. |
|
|
57
66
|
| `--help`, `-h` | Prints usage. |
|
|
58
67
|
| `--version`, `-v` | Prints the CLI version. |
|
|
@@ -104,6 +113,55 @@ The CLI picks the best available backend for your machine, in this order:
|
|
|
104
113
|
|
|
105
114
|
`candle auth status` and `candle doctor` both report which backend is active.
|
|
106
115
|
|
|
116
|
+
## Profiles
|
|
117
|
+
|
|
118
|
+
One machine can hold credentials for several accounts and hosts. `auth login` creates a profile
|
|
119
|
+
implicitly when none is already selected, named from `--profile <name>` or derived from the API
|
|
120
|
+
host (`staging`, `production`, or the hostname, de-duplicated with a numeric suffix). Which profile a command acts as, highest
|
|
121
|
+
wins: `--profile`, `CANDLE_PROFILE`, the `activeProfile` in `config.json`, the sole profile. With
|
|
122
|
+
several profiles and none selected the CLI refuses and lists them; guessing is how a wallet
|
|
123
|
+
import once landed on the wrong account.
|
|
124
|
+
|
|
125
|
+
Re-running `auth login` refreshes the profile you are already on, in place: the same name, the
|
|
126
|
+
same refs, a new device token and key. Use `--profile <new name>` to add another instead.
|
|
127
|
+
`auth logout` removes the acting profile's entry and its stored credentials, and clears
|
|
128
|
+
`activeProfile` when it pointed there. `candle profile list` shows every profile with its cached
|
|
129
|
+
account and how old that cache is (no network call); `profile use <name>` makes one active and
|
|
130
|
+
refreshes its account from the API; `profile add <name> --api-url <url>` creates one before
|
|
131
|
+
authenticating it; `profile rename` and `profile remove <name> --yes` do what they say. Removing a
|
|
132
|
+
profile deletes its two stored credentials and nothing else; imported wallet signers belong to the
|
|
133
|
+
wallet, not the profile. `candle wallets` marks, per linked wallet, whether this machine holds its
|
|
134
|
+
signer (`stored`, `none`, or `stale` for a revoked wallet whose signer is still here).
|
|
135
|
+
|
|
136
|
+
Every authenticated command prints `Profile: <name> Account: <account> at <api url>` before its
|
|
137
|
+
own output (`--json` output is unchanged except `auth status`, `auth login` and `doctor`, which
|
|
138
|
+
carry `profile` and `account`; `auth status` and `doctor` also carry `cachedAccount`, the account
|
|
139
|
+
the profile recorded, whenever a profile is resolved; scripts get identity from
|
|
140
|
+
`auth status --json`). The account is cached
|
|
141
|
+
at login from the API. Where the line is printed from that cache and `CANDLE_API_KEY` or
|
|
142
|
+
`CANDLE_DEVICE_TOKEN` is overriding the stored credential, it reads
|
|
143
|
+
`Account: unknown (CANDLE_API_KEY override)` rather than naming an account that credential was
|
|
144
|
+
never checked against; `auth status` and `setup` look the account up live and print what they
|
|
145
|
+
get, and `auth status` and `doctor` name the account the profile recorded beside it when the two
|
|
146
|
+
differ (not under an env credential override, where the live answer is not the profile's key's).
|
|
147
|
+
Before an authenticated command acts, the CLI asks the profile's stored key which account it
|
|
148
|
+
belongs to and **refuses** if the answer differs from the account the profile recorded, naming
|
|
149
|
+
both and the repairs in order of cost. A key that was legitimately re-issued is repaired with
|
|
150
|
+
`candle profile use <name>`, which re-caches the account; `candle auth login --profile <name>`
|
|
151
|
+
re-authenticates instead; `--no-verify-account` skips the check for one invocation without
|
|
152
|
+
repairing anything. An unreachable API turns the check into a warning, never a failure. The
|
|
153
|
+
check is skipped when
|
|
154
|
+
`CANDLE_API_KEY` or `CANDLE_DEVICE_TOKEN` is overriding the stored credential, when a profile has
|
|
155
|
+
no cached account or no stored key, and for the commands that only read the identity or repair it:
|
|
156
|
+
`auth login`, `auth status`, `auth logout`, `doctor`, `verify` (which acts as no identity at all:
|
|
157
|
+
two files and a signature) and the `profile` commands. `setup` is guarded, because it skips its
|
|
158
|
+
login step whenever credentials are already stored.
|
|
159
|
+
|
|
160
|
+
A pre-profile install is migrated on first run: profile `default` is created from the existing
|
|
161
|
+
settings and the two credentials are copied to `profile:default:*` refs. The old refs and fields
|
|
162
|
+
are left in place so an older CLI keeps working, until an `auth logout` clears them along with
|
|
163
|
+
the profile they were migrated into.
|
|
164
|
+
|
|
107
165
|
## Environment variables
|
|
108
166
|
|
|
109
167
|
| Variable | Effect |
|
|
@@ -111,6 +169,7 @@ The CLI picks the best available backend for your machine, in this order:
|
|
|
111
169
|
| `CANDLE_DEVICE_TOKEN` | Overrides the stored device token for this process. Every command that needs the device token checks this first, before the store. |
|
|
112
170
|
| `CANDLE_API_KEY` | Overrides the stored API key for this process, same precedence as above. |
|
|
113
171
|
| `CANDLE_API_URL` | Overrides the API base URL, beating the stored config value (but not an explicit `--api-url` flag). |
|
|
172
|
+
| `CANDLE_PROFILE` | Selects the profile when `--profile` is not given. |
|
|
114
173
|
| `CANDLE_KEYRING_PASSPHRASE` | The passphrase for the encrypted-file backend. Without it, a non-interactive process (no TTY) fails with a clear error rather than falling back to writing plaintext; an interactive session is prompted instead. |
|
|
115
174
|
| `CANDLE_CONFIG_DIR` | Overrides where the CLI keeps its config and encrypted-file credentials (default `~/.config/candle`). Mainly a testing seam. |
|
|
116
175
|
|