@gitlawb/zero 0.1.0 → 0.2.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 +68 -0
- package/bin/zero.js +21 -1
- package/package.json +3 -2
- package/scripts/postinstall.mjs +2 -1
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue"></a>
|
|
9
9
|
<img alt="Go 1.25+" src="https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go&logoColor=white">
|
|
10
10
|
<img alt="25+ providers" src="https://img.shields.io/badge/providers-25+-34E2EA">
|
|
11
|
+
<br>
|
|
12
|
+
<strong>English</strong> | <a href="README_ZH.md">中文</a>
|
|
11
13
|
</p>
|
|
12
14
|
|
|
13
15
|
Zero is an AI coding agent for your local terminal. It can inspect a repository,
|
|
@@ -51,6 +53,31 @@ The npm package installs a small wrapper plus the matching Zero binary for your
|
|
|
51
53
|
platform from GitHub Releases. It supports Linux, macOS, and Windows on x64 and
|
|
52
54
|
arm64.
|
|
53
55
|
|
|
56
|
+
### Bun
|
|
57
|
+
|
|
58
|
+
Bun does not run dependency lifecycle scripts by default, so the `postinstall`
|
|
59
|
+
that fetches the Zero binary is skipped and the first run fails with
|
|
60
|
+
`No native binary found next to the npm wrapper`.
|
|
61
|
+
|
|
62
|
+
The simplest fix is to trust the package after installing, which runs the
|
|
63
|
+
blocked postinstall. This works for project and global installs:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# project install
|
|
67
|
+
bun add @gitlawb/zero
|
|
68
|
+
bun pm trust @gitlawb/zero
|
|
69
|
+
|
|
70
|
+
# global install
|
|
71
|
+
bun add -g @gitlawb/zero
|
|
72
|
+
bun pm -g trust @gitlawb/zero
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Alternatives: allow the postinstall up front by adding
|
|
76
|
+
`"trustedDependencies": ["@gitlawb/zero"]` to your project's package.json
|
|
77
|
+
before `bun add`, or run the installer manually
|
|
78
|
+
(`node node_modules/@gitlawb/zero/scripts/postinstall.mjs`) on Bun versions
|
|
79
|
+
that do not have `bun pm trust`.
|
|
80
|
+
|
|
54
81
|
### Install scripts
|
|
55
82
|
|
|
56
83
|
Linux/macOS:
|
|
@@ -121,6 +148,13 @@ the key in the wizard:
|
|
|
121
148
|
export OPENAI_API_KEY=sk-...
|
|
122
149
|
export ANTHROPIC_API_KEY=...
|
|
123
150
|
export GEMINI_API_KEY=...
|
|
151
|
+
export LONGCAT_API_KEY=...
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
To configure Meituan LongCat (LongCat-2.0) directly, run:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
zero providers setup longcat --set-active
|
|
124
158
|
```
|
|
125
159
|
|
|
126
160
|
For local models, run Ollama or LM Studio and then use `zero setup` or
|
|
@@ -152,6 +186,7 @@ Common slash commands:
|
|
|
152
186
|
| `/spec`, `/plan` | draft and review a plan before building |
|
|
153
187
|
| `/image` | attach an image for vision-capable models |
|
|
154
188
|
| `/resume`, `/rewind` | continue or roll back local sessions |
|
|
189
|
+
| `/loop` | repeat a prompt or custom `/command` on an interval (`/loop 5m /babysit-prs`) or self-paced |
|
|
155
190
|
| `/compact`, `/context` | manage context usage |
|
|
156
191
|
| `/permissions`, `/tools` | inspect available tools and policy |
|
|
157
192
|
| `/add-dir` | allow an extra write directory for this session |
|
|
@@ -249,6 +284,39 @@ zero cron scheduled agent jobs
|
|
|
249
284
|
zero update check for newer releases
|
|
250
285
|
```
|
|
251
286
|
|
|
287
|
+
## Extending Zero
|
|
288
|
+
|
|
289
|
+
### Project and personal instructions
|
|
290
|
+
|
|
291
|
+
Zero appends project-specific guidance to the system prompt from the first
|
|
292
|
+
`AGENTS.md`, `ZERO.md`, or `.zero/AGENTS.md` file found in each directory from
|
|
293
|
+
the git root down to your current working directory (checked in that order
|
|
294
|
+
per directory). Files are injected general-to-specific, capped at 8 KiB per
|
|
295
|
+
file and 32 KiB total.
|
|
296
|
+
|
|
297
|
+
A personal `ZERO.md` under `config.UserConfigDir()/zero/ZERO.md`
|
|
298
|
+
(`$XDG_CONFIG_HOME/zero/ZERO.md` or `~/.config/zero/ZERO.md` on Linux/macOS,
|
|
299
|
+
`%AppData%\Roaming\zero\ZERO.md` on Windows) applies across every workspace, ahead of any project guidelines.
|
|
300
|
+
|
|
301
|
+
### Plugins
|
|
302
|
+
|
|
303
|
+
Plugins are discovered from `~/.config/zero/plugins/<name>/plugin.json` (user
|
|
304
|
+
scope — `$XDG_CONFIG_HOME` or `~/.config` on every OS, independent of the
|
|
305
|
+
`config.UserConfigDir()` path used above) and `<cwd>/.zero/plugins/<name>/plugin.json`
|
|
306
|
+
(project scope — resolved from the current working directory, not the repo
|
|
307
|
+
root), and managed with `zero plugins`. A manifest can declare:
|
|
308
|
+
|
|
309
|
+
- `tools` — custom tools (`command`, `args`, `inputSchema`, and a
|
|
310
|
+
`permission` of `prompt` or `deny`; `allow` is honored only when manifest tool
|
|
311
|
+
auto-approval is enabled)
|
|
312
|
+
- `hooks` — commands run on `beforeTool`, `afterTool`, `sessionStart`, or
|
|
313
|
+
`sessionEnd`
|
|
314
|
+
- `prompts` and `skills` — additional prompt/skill files
|
|
315
|
+
|
|
316
|
+
MCP servers (`zero mcp`) and standalone markdown skills (`zero skills`) use
|
|
317
|
+
the same extension points and can also be wired up outside of a plugin
|
|
318
|
+
manifest.
|
|
319
|
+
|
|
252
320
|
## Appearance And Accessibility
|
|
253
321
|
|
|
254
322
|
| Control | Effect |
|
package/bin/zero.js
CHANGED
|
@@ -54,8 +54,28 @@ const nativePath = join(packageRoot, zeroBinaryName());
|
|
|
54
54
|
const localControlHelpers = localControlHelperManifest(packageRoot);
|
|
55
55
|
|
|
56
56
|
if (!existsSync(nativePath)) {
|
|
57
|
+
const postinstallScript = join(packageRoot, 'scripts', 'postinstall.mjs');
|
|
58
|
+
const ranByBun = process.execPath.includes('bun') || !!process.versions?.bun;
|
|
57
59
|
console.error(
|
|
58
|
-
'[zero] No native binary found next to the npm wrapper
|
|
60
|
+
'[zero] No native binary found next to the npm wrapper.\n' +
|
|
61
|
+
'The platform binary is fetched at install time by a postinstall script,\n' +
|
|
62
|
+
'which did not run (or was skipped) for this install.\n' +
|
|
63
|
+
'\n' +
|
|
64
|
+
'Fix it now by running the installer manually:\n' +
|
|
65
|
+
` node "${postinstallScript}"\n` +
|
|
66
|
+
'\n' +
|
|
67
|
+
(ranByBun
|
|
68
|
+
? 'You installed with Bun, which does not run dependency lifecycle scripts\n' +
|
|
69
|
+
'by default. Trust the package to run the blocked postinstall:\n' +
|
|
70
|
+
' bun pm trust @gitlawb/zero (project install)\n' +
|
|
71
|
+
' bun pm -g trust @gitlawb/zero (global install)\n' +
|
|
72
|
+
'On Bun versions without `bun pm trust`, add\n' +
|
|
73
|
+
' "trustedDependencies": ["@gitlawb/zero"]\n' +
|
|
74
|
+
'to your project package.json and reinstall.\n' +
|
|
75
|
+
'\n'
|
|
76
|
+
: '') +
|
|
77
|
+
'If that fails, build from source: https://github.com/Gitlawb/zero\n' +
|
|
78
|
+
'(go run ./cmd/zero, requires Go 1.25+).',
|
|
59
79
|
);
|
|
60
80
|
process.exit(1);
|
|
61
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlawb/zero",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Zero — a fast, multi-provider terminal coding agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "bin/zero.js",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"os": [
|
|
25
25
|
"linux",
|
|
26
26
|
"darwin",
|
|
27
|
-
"win32"
|
|
27
|
+
"win32",
|
|
28
|
+
"android"
|
|
28
29
|
],
|
|
29
30
|
"cpu": [
|
|
30
31
|
"x64",
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// Env overrides (testing / mirrors / locked-down installs):
|
|
15
15
|
// ZERO_SKIP_DOWNLOAD=1 skip entirely, exit 0 (wrapper will guide if run)
|
|
16
16
|
// ZERO_INSTALL_DRY_RUN=1 print the resolved plan as JSON, no network, exit 0
|
|
17
|
-
// ZERO_INSTALL_PLATFORM=… override process.platform (linux|darwin|win32)
|
|
17
|
+
// ZERO_INSTALL_PLATFORM=… override process.platform (linux|darwin|win32|android)
|
|
18
18
|
// ZERO_INSTALL_ARCH=… override process.arch (x64|arm64)
|
|
19
19
|
// ZERO_REPO=owner/name override the GitHub repo (default Gitlawb/zero)
|
|
20
20
|
// ZERO_GITHUB_BASE_URL=… override the download host (default https://github.com)
|
|
@@ -65,6 +65,7 @@ function warnSkip(message) {
|
|
|
65
65
|
function resolvePlatform(p) {
|
|
66
66
|
switch (p) {
|
|
67
67
|
case 'linux':
|
|
68
|
+
case 'android':
|
|
68
69
|
return 'linux';
|
|
69
70
|
case 'darwin':
|
|
70
71
|
return 'macos';
|