@phantomcodes/cli 1.4.2 → 1.4.3
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 +99 -144
- package/dist/agents/command.mjs +3 -3
- package/dist/cli/app.mjs +2 -2
- package/dist/cli/commands.d.mts +5 -1
- package/dist/cli/commands.mjs +105 -53
- package/dist/cli/help.mjs +10 -6
- package/dist/cli/screens.mjs +3 -3
- package/dist/core/version.d.mts +1 -1
- package/dist/core/version.mjs +1 -1
- package/dist/keys/saved.d.mts +2 -0
- package/dist/keys/saved.mjs +6 -2
- package/dist/setup/agents.d.mts +1 -1
- package/dist/setup/agents.mjs +2 -2
- package/dist/setup/command.mjs +32 -5
- package/dist/setup/editors.mjs +2 -2
- package/dist/setup/screen.mjs +2 -2
- package/dist/spend/report.mjs +2 -2
- package/dist/workspace/command.d.mts +13 -0
- package/dist/workspace/command.mjs +23 -15
- package/package.json +6 -6
- package/skills/phantom-ai/SKILL.md +40 -66
package/README.md
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Phantom CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`phantom` connects Claude Code, Codex, pi and other coding agents to [Phantom AI](https://phantom.codes), an OpenAI-compatible API. It signs you in, keeps your key on your computer, adds credit and caps what each key can spend.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[Docs](https://phantom.codes/docs) · [npm](https://www.npmjs.com/package/@phantomcodes/cli)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
it, or choose a model yourself. Connect the coding agents you already use, fund
|
|
9
|
-
their inference and control spending—all from your terminal.
|
|
7
|
+
## Install and set up
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
The `phantom-ai` skill ships in the package. `phantom setup` installs it for
|
|
14
|
-
each agent it finds:
|
|
9
|
+
You need Node 24 or newer and the coding agent itself.
|
|
15
10
|
|
|
16
11
|
```bash
|
|
17
12
|
npm i -g @phantomcodes/cli
|
|
18
|
-
phantom setup
|
|
13
|
+
phantom setup
|
|
19
14
|
```
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
With no key saved yet, `phantom setup` signs you in first, with the same browser approval as `phantom login`. Then it finds the agents on your computer, shows what it will change in each file, and asks before it writes anything. Restart your agent, or open a new terminal, to use the connection.
|
|
17
|
+
|
|
18
|
+
With no credit, phantom-1 runs on free models, up to 200 requests a day from a coding agent, and you don't need a card. Free calls leave out web search, which costs money on any model.
|
|
19
|
+
|
|
20
|
+
If you used pai, this CLI's old name, run `phantom setup` once after you install. Until then, Claude Code and the shell block that pai wrote still call `pai`, and phantom prints a reminder.
|
|
21
|
+
|
|
22
|
+
### What setup changes
|
|
23
|
+
|
|
24
|
+
Setup writes model settings for Claude Code, Codex, opencode, Continue, Goose, Aider, GitHub Copilot CLI, Cline, Gemini CLI, Crush, Qwen Code, Kilo Code, Kimi Code, Droid, Mistral Vibe and Zed. Cursor, VS Code, JetBrains AI Assistant, Warp and Trae keep these settings on their own settings screens, so setup prints the steps for you to follow. pi gets the skill only.
|
|
25
|
+
|
|
26
|
+
It also installs the `phantom-ai` skill, a file that teaches the agent the phantom commands. To install the skill for one agent and change nothing else, run `phantom setup --agent claude` (or the agent's name).
|
|
27
|
+
|
|
28
|
+
- `phantom setup --dry-run` shows the changes and writes nothing.
|
|
29
|
+
- `--no-shell`, or unticking "Your shell" in the checklist, leaves your shell startup file alone. Setup then prints the lines to add yourself.
|
|
30
|
+
- `--limit 20` caps what the key can spend each month, and `--limit none` removes the cap. At a terminal, setup asks once when the key has no cap.
|
|
31
|
+
- `phantom setup --restore` puts back each file setup changed, from the copies it kept.
|
|
32
|
+
- `phantom setup --provider off` takes Phantom out of an agent and keeps the rest of its settings. In JSON settings files (Claude Code, Qwen Code, Gemini CLI and others), setup records each value it replaces and puts it back.
|
|
33
|
+
|
|
34
|
+
Claude Code's background calls (titles, summaries and its Explore agent) run on the model you chose with `phantom models`, so picking `phantom-1:zdr` covers them too.
|
|
22
35
|
|
|
23
36
|
## Let your agent set it up
|
|
24
37
|
|
|
25
|
-
|
|
38
|
+
Paste this into Claude Code, Codex, Cursor or another agent that can run terminal commands:
|
|
26
39
|
|
|
27
40
|
```text
|
|
28
41
|
Help me set up phantom for AI inference through Phantom AI.
|
|
@@ -36,139 +49,81 @@ then create a named workspace key with that cap.
|
|
|
36
49
|
Ask whether I want to connect my existing agent for future runs or use a temporary
|
|
37
50
|
connection for one run. For saved setup, preview the changes with phantom setup --dry-run
|
|
38
51
|
and show them to me before applying the setup I approve. Make sure any spending cap
|
|
39
|
-
is on the key my agent
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Connect your existing agents
|
|
45
|
-
|
|
46
|
-
Keep using your coding agent, with Phantom AI handling its inference and model
|
|
47
|
-
routing. Connect it using your saved key:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
npm i -g @phantomcodes/cli
|
|
51
|
-
phantom setup
|
|
52
|
+
is on the key my agent uses. Ask before adding funds or starting paid inference.
|
|
53
|
+
Keep keys and recovery credentials out of chat. Finish with the command to launch
|
|
54
|
+
my agent, and explain how to undo any saved setup.
|
|
52
55
|
```
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
approval as `phantom login`), then sets up your agents with the new key.
|
|
56
|
-
|
|
57
|
-
Used pai, this CLI's old name? Run `phantom setup` once after you install. Until
|
|
58
|
-
then, Claude Code and the shell block pai set up still call `pai`, and phantom
|
|
59
|
-
prints a reminder.
|
|
60
|
-
|
|
61
|
-
The Phantom CLI detects supported agents, previews the configuration changes, then asks before
|
|
62
|
-
applying them. It connects their model calls to Phantom AI and wires up the saved
|
|
63
|
-
key. Restart your agent, or open a new terminal, to use the connection.
|
|
64
|
-
|
|
65
|
-
Saved setup covers Claude Code, Codex, opencode, Continue, Goose, Aider, GitHub
|
|
66
|
-
Copilot CLI, Cline, Gemini CLI, Crush, Qwen Code, Kilo Code, Kimi Code, Droid,
|
|
67
|
-
Mistral Vibe and Zed. Cursor, VS Code, JetBrains AI Assistant, Warp and Trae
|
|
68
|
-
keep these settings on their own settings screens, so setup prints the steps;
|
|
69
|
-
pi gets the agent skill.
|
|
70
|
-
|
|
71
|
-
Preview without changing files with `phantom setup --dry-run`. To leave your
|
|
72
|
-
shell startup file alone, untick "Your shell" in the checklist or pass
|
|
73
|
-
`--no-shell`; setup then prints the lines to add yourself. Cap what the key can spend each
|
|
74
|
-
month with `phantom setup --limit 20` (`--limit none` removes it); at a terminal,
|
|
75
|
-
setup asks once when the key has no cap. The Phantom CLI keeps backups;
|
|
76
|
-
undo the changes with `phantom setup --restore`. To take Phantom out of an agent
|
|
77
|
-
and keep the rest of its settings, run `phantom setup --provider off`: for JSON
|
|
78
|
-
settings files (Claude Code, Qwen Code, Gemini CLI and the others) setup records
|
|
79
|
-
each value it replaces, and puts it back.
|
|
80
|
-
|
|
81
|
-
Claude Code's background calls (titles, summaries and its Explore agent) run on the
|
|
82
|
-
model you chose with `phantom models`, so `phantom-1:zdr` covers them too.
|
|
83
|
-
|
|
84
|
-
## Connect for one run
|
|
57
|
+
## Run an agent for one session
|
|
85
58
|
|
|
86
59
|
```bash
|
|
87
|
-
npm i -g @phantomcodes/cli
|
|
88
60
|
phantom login
|
|
89
61
|
phantom fund --amount 10 --card
|
|
90
62
|
phantom workspace status
|
|
91
63
|
phantom codex
|
|
92
64
|
```
|
|
93
65
|
|
|
94
|
-
|
|
95
|
-
launch **Codex** (`phantom codex`), **Claude Code** (`phantom claude`), **pi**
|
|
96
|
-
(`phantom pi`), or **any other compatible agent**. Each runs phantom-1 unless you
|
|
97
|
-
pick a model (`--model` after `--`), and phantom-1 runs on free models until you add
|
|
98
|
-
credit. Free calls leave out web search, which costs money on any model.
|
|
66
|
+
`phantom claude`, `phantom codex` and `phantom pi` start the agent with a connection that lasts for that run, and leave your saved agent settings alone. When the agent exits, phantom prints what the run spent. The agent starts on phantom-1, or on the model you picked with `phantom models`; pass `--model` after `--` to choose another.
|
|
99
67
|
|
|
100
|
-
|
|
101
|
-
checkout; check your workspace balance after payment. Agent runs use temporary
|
|
102
|
-
configuration and print spending afterward. Your existing agent configuration
|
|
103
|
-
stays in place.
|
|
68
|
+
`phantom login` opens a page in your browser. You check that it shows the same short code as your terminal, approve it, and phantom saves the key on this computer (in the macOS Keychain on a Mac). If you already have a key, `phantom login --paste` saves it.
|
|
104
69
|
|
|
105
|
-
|
|
70
|
+
Put phantom's own flags before the agent's arguments, with `--` between them:
|
|
106
71
|
|
|
107
|
-
|
|
72
|
+
```bash
|
|
73
|
+
phantom codex --key coding -- exec "explain this repository"
|
|
74
|
+
```
|
|
108
75
|
|
|
109
|
-
Add credit
|
|
76
|
+
## Add credit
|
|
110
77
|
|
|
111
78
|
```bash
|
|
112
79
|
phantom fund --amount 10 --card
|
|
113
80
|
phantom fund --amount 10 --coin usdc
|
|
114
81
|
```
|
|
115
82
|
|
|
116
|
-
|
|
83
|
+
`--card` opens Stripe Checkout, where the total includes Stripe's card fee. `--coin usdc` pays in USDC on Solana, and `--coin usdc-base` pays in USDC on Base. The credit appears once Stripe confirms the payment. Check it with `phantom balance`.
|
|
117
84
|
|
|
118
|
-
## Give each agent
|
|
85
|
+
## Give each agent its own key and cap
|
|
119
86
|
|
|
120
|
-
|
|
87
|
+
Every key in a workspace spends from the same balance. Make one key per agent, each with its own cap:
|
|
121
88
|
|
|
122
89
|
```bash
|
|
123
90
|
phantom keys create --save coding --limit 5
|
|
124
91
|
phantom claude --key coding
|
|
125
92
|
phantom keys list
|
|
126
|
-
phantom keys set --id
|
|
93
|
+
phantom keys set --id coding --limit 10
|
|
127
94
|
```
|
|
128
95
|
|
|
129
|
-
|
|
130
|
-
rates. `--limit`, `--budget`, `--period` and `--rate` take a number of zero or more,
|
|
131
|
-
or `none`; a mistyped value such as `5usd` is refused and changes nothing. Use the
|
|
132
|
-
full key ID from `phantom keys list` when changing or revoking a key. If a new or
|
|
133
|
-
rotated key cannot be saved on this computer (a locked Keychain over SSH, say),
|
|
134
|
-
phantom shows it once on screen and exits with an error, so copy it before you
|
|
135
|
-
close the terminal.
|
|
136
|
-
Revoking a workspace key preserves workspace funds.
|
|
96
|
+
`phantom keys set` changes three caps:
|
|
137
97
|
|
|
138
|
-
|
|
98
|
+
- `--limit`: the most the key can spend in total.
|
|
99
|
+
- `--budget`: the most it can spend each month, or each `--period` days.
|
|
100
|
+
- `--rate`: the most it can spend in one minute, in dollars.
|
|
139
101
|
|
|
140
|
-
|
|
141
|
-
models and change the choice for tool use, reasoning or spending limits:
|
|
102
|
+
Each takes a number of zero or more, or `none`. phantom refuses a mistyped value such as `5usd` and changes nothing. `--id` takes the key's name, its id, or the first 4 or more characters of its id, as `phantom keys list` shows them.
|
|
142
103
|
|
|
143
|
-
|
|
144
|
-
PHANTOM_KEY_NAME=coding phantom route set --models <model-a>,<model-b>
|
|
145
|
-
PHANTOM_KEY_NAME=coding phantom route test --table
|
|
146
|
-
```
|
|
104
|
+
Revoking a key turns it off for good; its credit stays in the workspace.
|
|
147
105
|
|
|
148
|
-
|
|
149
|
-
`auto` leave explicit model choices alone.
|
|
106
|
+
If phantom can't save a new or rotated key on this computer (a locked Keychain over SSH, for example), it prints the key once and exits with an error. Copy the key before you close the terminal.
|
|
150
107
|
|
|
151
|
-
|
|
152
|
-
(chat, images in, embeddings, rerank, images, video, speech, transcription) and
|
|
153
|
-
the model behind each job:
|
|
108
|
+
## Choose the model
|
|
154
109
|
|
|
155
|
-
|
|
110
|
+
Phantom has three models of its own. `phantom models` shows what each can do (chat, images in, embeddings, rerank, images, video, speech, transcription) and the model behind each job:
|
|
111
|
+
|
|
112
|
+
- `phantom-1` does every job. For each chat request it picks a tier: economy, standard or frontier.
|
|
156
113
|
- `phantom-1:free` is chat on free models at $0, with no card.
|
|
157
114
|
- `phantom-1:zdr` is chat (with images) on providers that keep none of your data.
|
|
158
115
|
|
|
159
|
-
At a terminal, `phantom models` asks which one your agents should use. To pick
|
|
160
|
-
without the menu:
|
|
116
|
+
At a terminal, `phantom models` asks which one your agents should use. To pick without the menu:
|
|
161
117
|
|
|
162
118
|
```bash
|
|
163
119
|
phantom models use phantom-1:zdr
|
|
164
120
|
```
|
|
165
121
|
|
|
166
|
-
`phantom claude`, `phantom codex` and `phantom
|
|
167
|
-
|
|
168
|
-
|
|
122
|
+
`phantom claude`, `phantom codex`, `phantom pi` and the next `phantom setup` start on the model you pick. Agents you set up earlier keep their model until you run `phantom setup` again.
|
|
123
|
+
|
|
124
|
+
### Pick the model in each tier
|
|
169
125
|
|
|
170
|
-
|
|
171
|
-
lineup picks the model in each tier, and a fallback model to try when it fails:
|
|
126
|
+
Your key's lineup sets the model phantom-1 runs in each tier, and a fallback model to try when that one fails:
|
|
172
127
|
|
|
173
128
|
```bash
|
|
174
129
|
phantom lineup --table
|
|
@@ -176,11 +131,20 @@ phantom lineup set --frontier <model> --economy-fallback <model>
|
|
|
176
131
|
phantom lineup reset
|
|
177
132
|
```
|
|
178
133
|
|
|
179
|
-
`lineup`
|
|
180
|
-
|
|
134
|
+
`phantom lineup` lists the models each tier can run. Write `default` in place of a model to put that tier back to its default.
|
|
135
|
+
|
|
136
|
+
### Set rules for `auto`
|
|
181
137
|
|
|
182
|
-
|
|
183
|
-
|
|
138
|
+
A route policy is your key's own rules for which model answers a request for `auto`. It can prefer cheaper models, and switch models for tool use, reasoning or a budget that is running low:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
PHANTOM_KEY_NAME=coding phantom route set --models <model-a>,<model-b>
|
|
142
|
+
PHANTOM_KEY_NAME=coding phantom route test --table
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
A request that names its own model skips the policy, unless you set `--applies-to all`. `phantom route set --sort fast` sends each request to the provider that starts answering soonest, and `--sort default` goes back to cheapest first.
|
|
146
|
+
|
|
147
|
+
## See what you spent
|
|
184
148
|
|
|
185
149
|
```bash
|
|
186
150
|
phantom spend --table
|
|
@@ -188,65 +152,56 @@ phantom spend --from 2026-09-01 --to 2026-09-30
|
|
|
188
152
|
phantom spend --workspace --table
|
|
189
153
|
```
|
|
190
154
|
|
|
191
|
-
|
|
192
|
-
your workspace by name; without it you see the key you run as. The saving is an
|
|
193
|
-
estimate: the same tokens at the frontier model's price today.
|
|
155
|
+
Dates are UTC days, and the default is this month. Without `--workspace` you see the key you run as; with it, every key in your workspace by name. The "saved" figure compares what phantom-1 cost with the same tokens at the frontier model's price today, so it is an estimate.
|
|
194
156
|
|
|
195
|
-
## Commands
|
|
157
|
+
## Commands by task
|
|
196
158
|
|
|
197
159
|
| Task | Commands |
|
|
198
160
|
| --- | --- |
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
| Manage
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
210
|
-
Put phantom flags before agent arguments; use `--` to separate them:
|
|
161
|
+
| Sign in and out | `phantom login`, `phantom logout` |
|
|
162
|
+
| Set up your agents | `phantom setup`, `phantom setup --dry-run`, `phantom setup --restore` |
|
|
163
|
+
| Start an agent for one run | `phantom claude`, `phantom codex`, `phantom pi` |
|
|
164
|
+
| Add credit and check spending | `phantom fund`, `phantom balance`, `phantom spend`, `phantom workspace status` |
|
|
165
|
+
| Manage the workspace's keys | `phantom keys create`, `phantom keys set`, `phantom keys rotate`, `phantom keys revoke` |
|
|
166
|
+
| Manage the keys saved on this computer | `phantom keys saved`, `phantom keys save`, `phantom keys rm` |
|
|
167
|
+
| Pick phantom-1, phantom-1:free or phantom-1:zdr | `phantom models`, `phantom models use <id>` |
|
|
168
|
+
| Pick the model in each tier | `phantom lineup`, `phantom lineup set`, `phantom lineup reset` |
|
|
169
|
+
| Set rules for `auto` | `phantom route` |
|
|
170
|
+
| Use the providers that answer soonest | `phantom route set --sort fast` (`--sort default` for cheapest first) |
|
|
211
171
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
172
|
+
## Output and exit codes
|
|
173
|
+
|
|
174
|
+
At a terminal, commands draw a screen, and choices are pickers (arrow keys, Enter, Esc to go back). When scripts and agents run them through a pipe, they print JSON on stdout and errors on stderr. `--json` prints JSON at a terminal, and `--table` draws the screen in a pipe. phantom refuses a flag it doesn't know.
|
|
175
|
+
|
|
176
|
+
`phantom claude`, `phantom codex` and `phantom pi` run in your terminal and print a spending summary on stderr when the agent exits.
|
|
215
177
|
|
|
216
|
-
|
|
217
|
-
(arrow keys, Enter, Esc to go back). Piped, as scripts and agents run them,
|
|
218
|
-
they print JSON on stdout and errors on stderr; `--json` forces JSON in a
|
|
219
|
-
terminal, and `--table` the screen in a pipe. Unknown flags are refused.
|
|
220
|
-
Agent commands inherit the terminal and print a spending summary on stderr.
|
|
221
|
-
Exit codes: 0 success (and Esc), 1 error, 2 rejected key, 130 Ctrl+C;
|
|
222
|
-
`phantom setup` returns 1 when it could only install the skills (no key yet,
|
|
223
|
-
`"complete": false`). Agent runs return the agent's exit code.
|
|
178
|
+
Exit codes: 0 for success (and for Esc), 1 for an error, 2 for a rejected key, 130 for Ctrl+C. `phantom setup` returns 1 when it could only install the skills because there was no key yet (`"complete": false`). An agent run returns the agent's exit code.
|
|
224
179
|
|
|
225
180
|
<details>
|
|
226
|
-
<summary><strong>Advanced
|
|
181
|
+
<summary><strong>Advanced and older commands</strong></summary>
|
|
227
182
|
|
|
228
|
-
`phantom --help` shows the main
|
|
183
|
+
`phantom --help` shows the main commands. `phantom --help --all` lists every command and flag.
|
|
229
184
|
|
|
230
|
-
The older `phantom key` commands still work.
|
|
231
|
-
`phantom keys list` reads the workspace; `phantom keys saved` lists local copies.
|
|
232
|
-
`phantom keys show` prints a secret for shell integration; keep it out of chat and logs.
|
|
185
|
+
The older `phantom key` commands still work. `phantom keys list` reads the workspace, and `phantom keys saved` lists the keys saved on this computer. `phantom keys show` prints a saved key for shell use, as in `PHANTOM_API_KEY=$(phantom keys show)`; keep it out of chat and logs.
|
|
233
186
|
|
|
234
187
|
</details>
|
|
235
188
|
|
|
236
189
|
<details>
|
|
237
190
|
<summary><strong>Development and contributing</strong></summary>
|
|
238
191
|
|
|
192
|
+
The CLI lives in `cli/` in the Phantom repo, which uses pnpm. Install once at the repo root, then run the checks from `cli/`:
|
|
193
|
+
|
|
239
194
|
```bash
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
195
|
+
pnpm install
|
|
196
|
+
cd cli
|
|
197
|
+
pnpm typecheck
|
|
198
|
+
pnpm test
|
|
199
|
+
pnpm build
|
|
200
|
+
pnpm coverage
|
|
244
201
|
```
|
|
245
202
|
|
|
246
203
|
Report a security problem privately to support@phantom.codes, not in a public issue.
|
|
247
204
|
|
|
248
205
|
</details>
|
|
249
206
|
|
|
250
|
-
---
|
|
251
|
-
|
|
252
207
|
phantom is proprietary, under the [Phantom Proprietary License](LICENSE). It lets you install and run phantom to use Phantom AI, the hosted API it calls.
|
package/dist/agents/command.mjs
CHANGED
|
@@ -81,7 +81,7 @@ export const AGENTS = {
|
|
|
81
81
|
// for this run leaves the user's own files alone. Its key is read from
|
|
82
82
|
// PHANTOM_AGENT_TOKEN when pi calls, so the file holds no secret.
|
|
83
83
|
const file = path.join(tmp, 'phantom-provider.ts');
|
|
84
|
-
const model = { id: startModel(env), name: 'Phantom AI
|
|
84
|
+
const model = { id: startModel(env), name: 'Phantom AI (phantom)', reasoning: true, input: ['text', 'image'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 1_000_000, maxTokens: 64_000 };
|
|
85
85
|
writeFileSync(file, `export default function (pi) {\n pi.registerProvider('phantom', ${JSON.stringify({ baseUrl: `${proxy}/v1`, api: 'openai-completions', apiKey: '$PHANTOM_AGENT_TOKEN', models: [model] })});\n}\n`, { mode: 0o600 });
|
|
86
86
|
return { args: ['-e', file, ...(hasModel(args) ? [] : ['--provider', 'phantom', '--model', startModel(env)]), ...args], env: { ...withoutPhantomKeys(env), PHANTOM_AGENT_TOKEN: token } };
|
|
87
87
|
},
|
|
@@ -134,7 +134,7 @@ export async function agentCommand(input) {
|
|
|
134
134
|
if (a === '--key')
|
|
135
135
|
keyName = value(a);
|
|
136
136
|
else if (a === '--mpp')
|
|
137
|
-
die('--mpp has been removed
|
|
137
|
+
die('--mpp has been removed: an agent run spends your key\'s credit. Run phantom login to sign in, or pick a saved key with --key <name>.');
|
|
138
138
|
else if (a === '--no-browser')
|
|
139
139
|
noBrowser = true;
|
|
140
140
|
else
|
|
@@ -182,5 +182,5 @@ const INSTALL = {
|
|
|
182
182
|
/** The message when an agent's program isn't installed, in plain words, with where to get it. */
|
|
183
183
|
export function notInstalled(bin) {
|
|
184
184
|
const how = INSTALL[bin];
|
|
185
|
-
return `
|
|
185
|
+
return `phantom can't find ${bin} on this computer: it isn't installed, or isn't on your PATH.${how ? ` Install ${how}, then run this again.` : ' Install it, then run this again.'}`;
|
|
186
186
|
}
|
package/dist/cli/app.mjs
CHANGED
|
@@ -46,7 +46,7 @@ function subMenu(which, s) {
|
|
|
46
46
|
return [
|
|
47
47
|
{ label: 'See my keys', value: { run: ['keys'] } },
|
|
48
48
|
{ label: 'New key', hint: 'for a teammate, CI or another computer', value: { run: ['keys', 'create'] } },
|
|
49
|
-
{ label: '
|
|
49
|
+
{ label: 'Cap what a key can spend', value: { run: ['keys', 'set'] } },
|
|
50
50
|
{ label: 'Revoke a key', hint: 'it stops working at once; its credit stays', value: { run: ['keys', 'revoke'] } },
|
|
51
51
|
{ label: 'Rotate a key', hint: 'a new key in its place; the old one stops working', value: { run: ['keys', 'rotate'] } },
|
|
52
52
|
];
|
|
@@ -76,7 +76,7 @@ export function nextSteps(ran) {
|
|
|
76
76
|
'spend --workspace': [['Keys', ['keys']]],
|
|
77
77
|
fund: [['Balance', ['balance']]],
|
|
78
78
|
workspace: [['See my keys', ['keys']], ['Spend by key', ['spend', '--workspace']]],
|
|
79
|
-
keys: [['New key', ['keys', 'create']], ['
|
|
79
|
+
keys: [['New key', ['keys', 'create']], ['Cap what a key can spend', ['keys', 'set']], ['Revoke a key', ['keys', 'revoke']]],
|
|
80
80
|
models: [['Put it in my agents', ['setup']], ['Choose the model in each tier', ['lineup', 'set']]],
|
|
81
81
|
route: [['See what a request would get', ['route', 'test']], ['Choose models', ['lineup', 'set']]],
|
|
82
82
|
'setup --restore': [['Sign out, and forget saved keys', ['logout', '--all']]],
|
package/dist/cli/commands.d.mts
CHANGED
|
@@ -15,5 +15,9 @@ export type CommandDefinition = {
|
|
|
15
15
|
/** The short `--help`'s headings, in the order they print. */
|
|
16
16
|
export declare const HELP_GROUPS: readonly ["Start", "Run", "Money", "Keys", "Routing", "More"];
|
|
17
17
|
export type HelpGroup = (typeof HELP_GROUPS)[number];
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* The definitions used by CLI dispatch, help, and generated documentation.
|
|
20
|
+
* `run()` reads each command's flags from its `help`, so every flag a command
|
|
21
|
+
* takes must appear there as `--name`.
|
|
22
|
+
*/
|
|
19
23
|
export declare const COMMANDS: readonly CommandDefinition[];
|