@paean-ai/zero-cli 0.12.10 → 0.12.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 +53 -8
- package/dist/_cli.js +1145 -1135
- 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-
|
|
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*
|
|
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
|
|
|
@@ -70,7 +70,7 @@ zero auth logout
|
|
|
70
70
|
|
|
71
71
|
## `zero provider` — Third-party API provider
|
|
72
72
|
|
|
73
|
-
Use this when you want Zero to talk to a non-Paean
|
|
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.
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
76
|
# Show currently active provider (if any)
|
|
@@ -95,6 +95,44 @@ zero provider clear
|
|
|
95
95
|
|
|
96
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.
|
|
97
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
|
+
|
|
98
136
|
### Quick switch between providers (cached credentials)
|
|
99
137
|
|
|
100
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:
|
|
@@ -128,11 +166,17 @@ https://open.bigmodel.cn/api/anthropic
|
|
|
128
166
|
```
|
|
129
167
|
|
|
130
168
|
Z.ai's GLM Coding Plan docs also list
|
|
131
|
-
`https://open.bigmodel.cn/api/coding/paas/v4`; that is
|
|
132
|
-
OpenAI-compatible Coding API
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
+
```
|
|
136
180
|
|
|
137
181
|
| Tier | Model | Context |
|
|
138
182
|
|------|-------|---------|
|
|
@@ -228,6 +272,7 @@ Zero stores config in `~/.zero/`. Key environment variables:
|
|
|
228
272
|
|----------|-------------|
|
|
229
273
|
| `ZERO_CLI_AUTH_TOKEN` | API key for the configured provider |
|
|
230
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 |
|
|
231
276
|
| `ZERO_CLI_DEFAULT_OPUS_MODEL` | Model for the "opus" (flagship) tier |
|
|
232
277
|
| `ZERO_CLI_DEFAULT_SONNET_MODEL` | Model for the "sonnet" (standard) tier |
|
|
233
278
|
| `ZERO_CLI_DEFAULT_HAIKU_MODEL` | Model for the "haiku" (fast) tier |
|