@paean-ai/zero-cli 0.12.9 → 0.12.11

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.
Files changed (3) hide show
  1. package/README.md +74 -8
  2. package/dist/_cli.js +1494 -2476
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  > *Start from zero. Ship from anywhere.*
4
4
 
5
- A geometric, multi-model AI coding agent for the terminal — concentric, focused, and at home in any shell. Drives Anthropic-protocol-compatible LLM APIs (Anthropic Claude, Zhipu GLM, DeepSeek, Volcengine, Alibaba Qwen, Moonshot, and more) from a single, brand-distinct CLI marked by the `⌬` Zero glyph.
5
+ A geometric, multi-model AI coding agent for the terminal — concentric, focused, and at home in any shell. Drives Anthropic Messages and OpenAI Chat Completions-compatible LLM APIs (Anthropic Claude, Zhipu GLM, DeepSeek, Volcengine, Alibaba Qwen, Moonshot, and more) from a single, brand-distinct CLI marked by the `⌬` Zero glyph.
6
6
 
7
- Zero CLI focuses on optimizing the harness layer (context window management, token budgeting, request headers, timeouts, agent runtime) for *third-party* Anthropic-protocol providers. For the official Anthropic Claude models, use Anthropic's official Claude Code — that's where they're tuned best.
7
+ Zero CLI focuses on optimizing the harness layer (context window management, token budgeting, request headers, timeouts, agent runtime) for *third-party* model providers. For the official Anthropic Claude models, use Anthropic's official Claude Code — that's where they're tuned best.
8
8
 
9
9
  ## Install
10
10
 
@@ -33,6 +33,13 @@ zero login
33
33
  zero provider set zai --api-key <YOUR_GLM_API_KEY>
34
34
  ```
35
35
 
36
+ Text-only gateways can declare their affected model IDs during setup:
37
+
38
+ ```bash
39
+ zero provider set byok --api-key <KEY> --base-url <URL> \
40
+ --model dsv4-0731 --non-multimodal-models dsv4-0731
41
+ ```
42
+
36
43
  Then start a session:
37
44
 
38
45
  ```bash
@@ -63,7 +70,7 @@ zero auth logout
63
70
 
64
71
  ## `zero provider` — Third-party API provider
65
72
 
66
- Use this when you want Zero to talk to a non-Paean, Anthropic-protocol-compatible endpoint. Three presets ship out of the box: **z.ai (GLM)**, **Volcengine (Ark)**, **DeepSeek**. All commands are scriptable — no TUI required.
73
+ Use this when you want Zero to talk to a non-Paean endpoint that implements Anthropic Messages or OpenAI Chat Completions. Three cloud presets ship out of the box: **z.ai (GLM)**, **Volcengine (Ark)**, and **DeepSeek**; oMLX is also available for local Anthropic-compatible serving. All commands are scriptable — no TUI required.
67
74
 
68
75
  ```bash
69
76
  # Show currently active provider (if any)
@@ -88,6 +95,44 @@ zero provider clear
88
95
 
89
96
  The API key may also be supplied via the `ZERO_PROVIDER_API_KEY` environment variable (useful in CI). Restart `zero` after changing the provider for the new config to take effect.
90
97
 
98
+ ### OpenAI Chat Completions-compatible endpoints
99
+
100
+ For vLLM, SGLang, New API, and other servers that expose
101
+ `/v1/chat/completions`, configure a BYOK provider with
102
+ `--protocol openai-chat`:
103
+
104
+ ```bash
105
+ zero provider set byok \
106
+ --name NPU \
107
+ --api-key "$ZERO_PROVIDER_API_KEY" \
108
+ --base-url https://provider.example \
109
+ --model dsv4-0731 \
110
+ --protocol openai-chat \
111
+ --non-multimodal-models dsv4-0731
112
+ ```
113
+
114
+ The base URL may be the server root (`https://provider.example`), `/v1`, or a
115
+ provider-specific API prefix. Zero appends the appropriate
116
+ `/chat/completions` path and translates messages, function tools, streamed tool
117
+ arguments, tool results, token usage, reasoning content, and stop reasons at
118
+ the API boundary. The agent loop and JSONL transcript keep their existing
119
+ internal shape.
120
+
121
+ `--protocol auto` is the default. It currently recognizes `dsv4-0731` (also
122
+ with a `[1m]` suffix) and automatically selects OpenAI Chat Completions. Use an
123
+ explicit protocol for other model IDs:
124
+
125
+ ```bash
126
+ zero provider set byok --api-key "$ZERO_PROVIDER_API_KEY" \
127
+ --base-url https://provider.example/v1 \
128
+ --model your-model-id --protocol openai-chat
129
+ ```
130
+
131
+ The equivalent manual override is `ZERO_CLI_API_PROTOCOL=openai-chat`; set it
132
+ to `anthropic` to force Anthropic Messages. OpenAI Responses API is not part of
133
+ this adapter. See [`docs/openai-protocol.md`](./docs/openai-protocol.md) for the
134
+ supported surface and compatibility details.
135
+
91
136
  ### Quick switch between providers (cached credentials)
92
137
 
93
138
  Once a preset has been configured at least once with `zero provider set`, its credentials are cached in `userSettings.providerCache`. You can then jump between providers without retyping the API key:
@@ -121,11 +166,17 @@ https://open.bigmodel.cn/api/anthropic
121
166
  ```
122
167
 
123
168
  Z.ai's GLM Coding Plan docs also list
124
- `https://open.bigmodel.cn/api/coding/paas/v4`; that is the dedicated
125
- OpenAI-compatible Coding API endpoint for tools that speak the OpenAI protocol.
126
- Do not paste that URL into Zero's z.ai preset. If you want to use Z.ai's
127
- ordinary/OpenAI-compatible API path, route it through a BYOK endpoint that
128
- implements the Anthropic Messages API.
169
+ `https://open.bigmodel.cn/api/coding/paas/v4`; that is its dedicated
170
+ OpenAI-compatible Coding API prefix. Do not paste that URL into the fixed z.ai
171
+ preset, which intentionally uses Anthropic Messages. Configure it through BYOK
172
+ with `--protocol openai-chat` and the model ID supported by your plan:
173
+
174
+ ```bash
175
+ zero provider set byok --name z.ai-openai \
176
+ --api-key "$ZERO_PROVIDER_API_KEY" \
177
+ --base-url https://open.bigmodel.cn/api/coding/paas/v4 \
178
+ --model your-zai-model-id --protocol openai-chat
179
+ ```
129
180
 
130
181
  | Tier | Model | Context |
131
182
  |------|-------|---------|
@@ -221,13 +272,28 @@ Zero stores config in `~/.zero/`. Key environment variables:
221
272
  |----------|-------------|
222
273
  | `ZERO_CLI_AUTH_TOKEN` | API key for the configured provider |
223
274
  | `ZERO_CLI_BASE_URL` | API base URL (defaults to Paean AI) |
275
+ | `ZERO_CLI_API_PROTOCOL` | Wire protocol override: `anthropic` or `openai-chat`; unset means automatic selection |
224
276
  | `ZERO_CLI_DEFAULT_OPUS_MODEL` | Model for the "opus" (flagship) tier |
225
277
  | `ZERO_CLI_DEFAULT_SONNET_MODEL` | Model for the "sonnet" (standard) tier |
226
278
  | `ZERO_CLI_DEFAULT_HAIKU_MODEL` | Model for the "haiku" (fast) tier |
279
+ | `ZERO_CLI_NON_MULTIMODAL_MODELS` | Comma-separated model IDs that must not receive image/document blocks; use `*` for every model on the configured third-party provider |
227
280
  | `ZERO_PROVIDER_API_KEY` | Fallback key read by `zero provider set` in CI |
228
281
 
229
282
  Legacy `ANTHROPIC_*` equivalents are still honored but the `ZERO_CLI_*` names are preferred.
230
283
 
284
+ For a text-only provider, declare the affected model IDs in user settings (or
285
+ the process environment). Zero then blocks visual `Read` calls, replaces any
286
+ image/document blocks before the API request, and tells the model to use text
287
+ extraction instead:
288
+
289
+ ```json
290
+ {
291
+ "env": {
292
+ "ZERO_CLI_NON_MULTIMODAL_MODELS": "deepseek-v4-flash,dsv4-0731"
293
+ }
294
+ }
295
+ ```
296
+
231
297
  ## License
232
298
 
233
299
  MIT