@taf0711/splice 0.1.2 → 0.1.4

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 CHANGED
@@ -1,499 +1,267 @@
1
1
  <p align="center">
2
- <img src="docs/assets/splice-logo.png" alt="splice" width="560">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/splice-logo-inverted.svg">
4
+ <img src="docs/assets/splice-logo.svg" alt="splice" width="560">
5
+ </picture>
3
6
  </p>
4
7
 
5
- <p align="center"><strong>A terminal coding agent with a deterministic, multi-stage pipeline.</strong></p>
8
+ <p align="center"><strong>The agent that turns a prompt into a checked change.</strong></p>
6
9
 
7
10
  <p align="center">
8
11
  <a href="https://github.com/Taf0711/splice/actions/workflows/ci.yml?branch=main"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Taf0711/splice/ci.yml?branch=main"></a>
9
12
  <a href="https://www.npmjs.com/package/@taf0711/splice"><img alt="npm version" src="https://img.shields.io/npm/v/@taf0711/splice"></a>
10
13
  <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue"></a>
11
14
  <img alt="Go 1.25+" src="https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go&logoColor=white">
12
- <img alt="25+ providers" src="https://img.shields.io/badge/providers-25+-34E2EA">
13
- <br>
14
- <strong>English</strong> | <a href="README_ZH.md">中文</a>
15
15
  </p>
16
16
 
17
- Splice is an AI coding agent for your local terminal. It inspects a repository,
18
- edits files, runs commands, uses browser and terminal helpers, and keeps
19
- durable local sessions while you choose the model and the permission level.
20
- On top of that engine, Splice layers an orchestrator-mediated, schema-as-contract
21
- pipeline: a request is classified, turned into a typed execution plan, and run
22
- through specialized stages (code writer, static analyzer, test generator,
23
- security auditor, test runner) with a deterministic trajectory monitor that
24
- catches death spirals before they waste tokens.
17
+ Splice is a local-first coding agent for people who want more than a model in a
18
+ shell loop. It can inspect a repository, edit files, run checks, and use the
19
+ model and provider you choose. For substantial work, it classifies the request,
20
+ assembles only the context a stage needs, and routes the change through a
21
+ specialized execution plan.
25
22
 
26
- ```bash
27
- splice
28
- splice exec "fix the failing test in ./pkg"
29
- splice exec --output-format stream-json < turns.jsonl
30
- ```
31
-
32
- ## Why Splice
33
-
34
- - **Use the model you want.** Bring OpenAI, Anthropic, Gemini, Groq, OpenRouter,
35
- DeepSeek, Mistral, xAI, Qwen, Kimi, GitHub Models, Ollama, LM Studio, or any
36
- OpenAI- or Anthropic-compatible endpoint.
37
- - **A pipeline, not just a chat.** A request is classified into a tier, turned
38
- into a typed execution plan, and run through specialized stages whose inputs
39
- and outputs are Go structs with `Validate()` methods. The orchestrator is the
40
- foreman: agents never pass data to each other directly, and summaries flow
41
- forward, not raw outputs.
42
- - **Deterministic-first.** Anything answerable with code (ripgrep, AST, Bandit,
43
- pytest, git diff) is answered with code. The LLM is the last resort. The
44
- context builder pulls real file, directory, and grep results from Zero's tool
45
- registry so a stage prompt sees the workspace, not a guess.
46
- - **Trajectory-aware.** A deterministic scorer watches every iteration. Hard
47
- limit, budget exhaustion, state-hash cycles, oscillation, regression, and
48
- confidence collapse each escalate explicitly instead of looping silently.
49
- - **Stay in control.** File writes, shell commands, network access, and
50
- out-of-workspace writes go through Splice's permission and sandbox policy.
51
- - **Works in the terminal.** The TUI has model and provider pickers, image
52
- input, slash commands, live plan and tool rendering, scrollback, themes, and
53
- resume and fork support.
54
- - **Works without the TUI.** `splice exec` is scriptable, supports text, JSON,
55
- and stream-JSON I/O, isolated worktrees, spec-first runs, and meaningful exit
56
- codes for CI.
57
- - **Keeps context local.** Sessions are stored on disk, searchable, resumable,
58
- and never uploaded as telemetry by Splice.
59
- - **Extensible when you need it.** Use MCP servers, skills, plugins, hooks, and
60
- specialist subagents from the same CLI.
61
-
62
- ## Install
63
-
64
- Install via `npm install -g @taf0711/splice` (downloads the matching GitHub Release binary) or download archives directly from [GitHub Releases](https://github.com/Taf0711/splice/releases).
23
+ ## Start in three commands
65
24
 
66
25
  ```bash
67
26
  npm install -g @taf0711/splice
68
27
  splice
69
28
  ```
70
29
 
71
- The npm package will install a small wrapper plus the matching Splice binary for
72
- your platform from GitHub Releases. It will support Linux, macOS, and Windows
73
- on x64 and arm64.
74
-
75
- ### Bun (planned)
76
-
77
- Bun does not run dependency lifecycle scripts by default, so the `postinstall`
78
- that fetches the Splice binary is skipped and the first run fails with
79
- `No native binary found next to the npm wrapper`.
80
-
81
- The simplest fix is to trust the package after installing, which runs the
82
- blocked postinstall. This works for project and global installs:
30
+ Then describe the change. For a direct, scriptable run:
83
31
 
84
32
  ```bash
85
- # project install
86
- bun add @taf0711/splice
87
- bun pm trust @taf0711/splice
88
-
89
- # global install
90
- bun add -g @taf0711/splice
91
- bun pm -g trust @taf0711/splice
33
+ splice exec "fix the failing test in ./pkg"
92
34
  ```
93
35
 
94
- Alternatives: allow the postinstall up front by adding
95
- `"trustedDependencies": ["@taf0711/splice"]` to your project's package.json
96
- before `bun add`, or run the installer manually
97
- (`node node_modules/@taf0711/splice/scripts/postinstall.mjs`) on Bun versions
98
- that do not have `bun pm trust`.
36
+ The first launch opens setup for a provider and model. See
37
+ [Install](docs/INSTALL.md) for source builds, platform notes, and the optional
38
+ memory sidecar.
99
39
 
100
- ### Install scripts (planned)
40
+ ## One-line install
101
41
 
102
- Linux/macOS:
42
+ Use the Bash installer on Linux or macOS:
103
43
 
104
44
  ```bash
105
45
  curl -fsSL https://raw.githubusercontent.com/Taf0711/splice/main/scripts/install.sh | bash
46
+ wget -qO- https://raw.githubusercontent.com/Taf0711/splice/main/scripts/install.sh | bash
106
47
  ```
107
48
 
108
- Windows PowerShell:
49
+ Use the plain PowerShell form on Windows:
109
50
 
110
51
  ```powershell
111
52
  irm https://raw.githubusercontent.com/Taf0711/splice/main/scripts/install.ps1 | iex
112
53
  ```
113
54
 
114
- ### From source (works today)
115
-
116
- Source builds require Go 1.25+.
117
-
118
- ```bash
119
- git clone https://github.com/Taf0711/splice.git
120
- cd splice
121
- go run ./cmd/splice
122
- ```
55
+ Use the PowerShell argument form to set a version:
123
56
 
124
- If you are testing before the first public release, build from source:
125
-
126
- ```bash
127
- go build -o splice ./cmd/splice
57
+ ```powershell
58
+ & ([scriptblock]::Create((irm https://raw.githubusercontent.com/Taf0711/splice/main/scripts/install.ps1))) -Version 0.1.4
128
59
  ```
129
60
 
130
- On Linux, build the sandbox helper too if you want native sandboxing:
61
+ ## Why Splice exists
62
+
63
+ Most coding agents have one long conversation responsible for understanding,
64
+ editing, testing, and deciding whether to continue. Splice separates those
65
+ jobs without turning them into a noisy agent swarm.
66
+
67
+ - **A typed pipeline.** Stages exchange validated Go structures, not loose chat
68
+ transcripts. The orchestrator decides what each stage receives and what runs
69
+ next.
70
+ - **Deterministic first.** Repository reads, search, AST checks, static analysis,
71
+ tests, diffs, and exit codes come from local tools. The model is used where
72
+ judgment is needed, not where a command is more reliable.
73
+ - **Trajectory awareness.** The run monitor detects hard limits, repeated state,
74
+ oscillation, regression, and collapsing confidence. A stuck run surfaces the
75
+ problem instead of spending tokens forever.
76
+ - **Least context by default.** The original request is distilled before it
77
+ reaches later stages. Each stage receives a small summary and the evidence it
78
+ actually needs.
79
+ - **Zero's safety substrate.** File writes, shell commands, network access, and
80
+ additional write roots still pass through Zero's permissions, sandbox, hooks,
81
+ and tool registry.
82
+ - **Local by default.** Sessions and optional memory stay on disk. Splice does
83
+ not add telemetry or require a hosted coordinator.
84
+
85
+ ## The Splice loop
131
86
 
132
- ```bash
133
- go build -o splice-linux-sandbox ./cmd/splice-linux-sandbox
134
- go build -o splice-seccomp ./cmd/splice-seccomp # optional compatibility wrapper
87
+ ```text
88
+ request
89
+ │
90
+ ▼
91
+ classify ──► typed execution plan ──► focused context
92
+ │
93
+ ▼
94
+ write ──► analyze ──► test ──► audit
95
+ │
96
+ ▼
97
+ trajectory decision
98
+ continue, escalate, or stop
135
99
  ```
136
100
 
137
- Put `splice` and `splice-linux-sandbox` in the same directory on `PATH`
138
- (`~/.local/bin` is a good default). macOS does not need an extra helper binary.
139
- Windows source builds can use the main `splice.exe` as their sandbox helper;
140
- release archives will still ship standalone Windows helper executables.
141
-
142
- More install details: [docs/INSTALL.md](docs/INSTALL.md).
101
+ The pipeline has five request tiers, from trivial to architectural. A normal
102
+ run may use a model-backed code writer and test generator, while static
103
+ analysis, security checks, and test execution stay deterministic and local.
104
+ Every stage has a contract and validation. Malformed output is an error with
105
+ its offending field, not an empty fallback.
143
106
 
144
- ## First Run
107
+ ## Choose your mode
145
108
 
146
- Start the TUI:
109
+ ### Interactive
147
110
 
148
111
  ```bash
149
112
  splice
150
113
  ```
151
114
 
152
- The setup wizard helps you pick a provider and model. You can also configure
153
- providers from the command line:
154
-
155
- ```bash
156
- splice setup
157
- splice providers list
158
- splice models list
159
- splice doctor
160
- ```
161
-
162
- For API providers, set the matching environment variable before setup or enter
163
- the key in the wizard:
164
-
165
- ```bash
166
- export OPENAI_API_KEY=sk-...
167
- export ANTHROPIC_API_KEY=...
168
- export GEMINI_API_KEY=...
169
- export LONGCAT_API_KEY=...
170
- ```
171
-
172
- To configure Meituan LongCat (LongCat-2.0) directly, run:
173
-
174
- ```bash
175
- splice providers setup longcat --set-active
176
- ```
115
+ Use the TUI when you want a live conversation, provider and model pickers,
116
+ permission prompts, plan review, themes, image input, session resume, or forked
117
+ exploration.
177
118
 
178
- For local models, run Ollama or LM Studio and then use `splice setup` or
179
- `splice providers detect`. Model-backed pipeline stages require tool-calling
180
- support. If a model omits the required typed tool call or returns invalid JSON,
181
- Splice gives it up to two corrective retries and then reports an actionable
182
- error. Splice never falls back from a local model to a cloud provider.
119
+ A new session starts in design mode. Describe the work, use `/crystallize` to
120
+ turn the conversation into a typed plan, then `/approve` to execute it. If the
121
+ plan is already in your head, use `/exec <prompt>` and go straight to the
122
+ pipeline.
183
123
 
184
- ### Your first prompt: planning vs execution
124
+ These controls set the appearance:
185
125
 
186
- A fresh interactive session starts in **planning mode** (design). Describe
187
- what you want to build; Splice runs a design conversation, then `/crystallize`
188
- turns it into a typed plan and `/approve` hands it to the execution pipeline.
189
- This two-phase flow is for work that benefits from a plan first.
190
-
191
- To skip planning and run a prompt straight through the pipeline, use
192
- `/exec <prompt>` in the TUI or `splice exec "<prompt>"` headlessly:
193
-
194
- ```bash
195
- splice exec "fix the failing test in ./pkg"
196
- ```
197
-
198
- `/exec` is the escape hatch when you already know what you want and do not
199
- need a planning step. Type `/design` to re-enter planning mode.
200
-
201
- ## Daily Use
202
-
203
- ### Interactive TUI
204
-
205
- ```bash
206
- splice
207
- ```
208
-
209
- Useful controls:
210
-
211
- | Control | Action |
126
+ | Control | Effect |
212
127
  |---|---|
213
- | `Enter` | send the prompt |
214
- | `/` | open slash-command suggestions |
215
- | `Shift+Tab` | cycle permission mode |
216
- | `Ctrl+B` | show/hide the sidebar |
217
- | `Ctrl+C` | cancel or exit |
128
+ | `NO_COLOR=<anything>` | disables color output |
129
+ | `SPLICE_THEME=<name>` | selects the startup theme (`auto`, `dark`, `light`, or a color theme like `dracula`, `nord`, `gruvbox`, `tokyo-night`, `catppuccin`, `one-dark`, `solarized-dark`, `rose-pine`, `everforest`, `solarized-light`) |
130
+ | `--theme <name>` | selects the TUI theme from the CLI (same names) |
131
+ | `/theme` | opens the theme picker inside the TUI (live preview; `/theme <name>` switches directly) |
132
+ | `SPLICE_NO_FADE=1` | disables streaming fade animation |
218
133
 
219
- Common slash commands:
134
+ Meaning does not rely on color alone. Diffs, permissions, and statuses also use
135
+ text or glyph markers.
220
136
 
221
- | Command | Purpose |
222
- |---|---|
223
- | `/model`, `/provider` | switch the active model/provider |
224
- | `/stages` | route the model-backed code writer and test generator, plus defaults and escalation |
225
- | `/spec`, `/plan` | draft and review a plan before building |
226
- | `/image` | attach an image for vision-capable models |
227
- | `/resume`, `/rewind` | continue or roll back local sessions |
228
- | `/loop` | repeat a prompt or custom `/command` on an interval (`/loop 5m /babysit-prs`) or self-paced |
229
- | `/compact`, `/context` | manage context usage |
230
- | `/permissions`, `/tools` | inspect available tools and policy |
231
- | `/add-dir` | allow an extra write directory for this session |
232
- | `/theme`, `/doctor`, `/config` | adjust appearance and inspect setup |
233
-
234
- ### Headless `exec`
137
+ ### Headless
235
138
 
236
139
  ```bash
237
140
  splice exec "explain internal/agent/loop.go"
238
- splice exec --model claude-sonnet-4.5 "refactor the config loader"
239
141
  splice exec --use-spec "add rate limiting to the API client"
240
- splice exec --worktree "try the migration in an isolated worktree"
241
- splice exec --worktree --merge-back "run it isolated, then merge the result back"
142
+ splice exec --worktree "try the migration in isolation"
143
+ splice exec --worktree --merge-back "run isolated, then merge the result back"
242
144
  splice exec --plan design-plan.json
243
- splice exec --resume
244
- splice exec --fork <session-id> "try the other approach"
245
145
  ```
246
146
 
247
- `--plan` executes a design plan JSON file: tasks are ordered topologically by
248
- their dependencies and each task runs as its own pipeline run, failing fast on
249
- the first task that does not complete. `--merge-back` (requires `--worktree`)
250
- commits the worktree's work, pins a `splice/<name>` recovery branch, and merges
251
- into the source repo with `--no-ff`; a dirty source tree or a merge conflict
252
- never forces anything, and the recovery branch survives every non-merged case.
253
-
254
- Programmatic use:
147
+ `splice exec` supports text, JSON, and stream-JSON input and output, isolated
148
+ git worktrees, resumable sessions, and meaningful exit codes for automation.
149
+ For a streaming client:
255
150
 
256
151
  ```bash
257
- splice exec --input-format stream-json --output-format stream-json < turns.jsonl
152
+ splice exec \
153
+ --input-format stream-json \
154
+ --output-format stream-json < turns.jsonl
258
155
  ```
259
156
 
260
- The stream-JSON contract is documented in
157
+ The event contract lives in
261
158
  [docs/STREAM_JSON_PROTOCOL.md](docs/STREAM_JSON_PROTOCOL.md).
262
159
 
263
- ## The Pipeline
264
-
265
- Splice's distinguishing layer is the deterministic pipeline in
266
- `internal/splice/`. It is ported from the Flug paradigm (Flug is the archived
267
- Python predecessor) and built new in Go on top of Zero's engine.
268
-
269
- The flow:
270
-
271
- 1. **Classify.** `ClassifyRequest` inspects the request and assigns one of five
272
- tiers (trivial, light, standard, substantial, architectural) using
273
- keyword and risk-domain detection with rune-count thresholds that match the
274
- Python source.
275
- 2. **Plan.** `BuildExecutionPlan` turns the tier into a typed `ExecutionPlan`
276
- with per-stage `TokenBudget` allocations. Unknown tiers fail loudly with an
277
- error, matching Python's `KeyError`.
278
- 3. **Fulfill context.** Before a stage runs, its `ContextRequest` is fulfilled
279
- deterministically through `FulfillContextRequest`, which calls Zero's real
280
- `tools.Registry` (`read_file`, `list_directory`, `grep`). All six legal query
281
- types are handled; payloads are text, truncation is rune-safe, and a failed
282
- tool becomes an errored `ContextItem` rather than a silent empty payload.
283
- 4. **Run stages.** Each pipeline stage is a typed Go function in
284
- `internal/splice/stages/`. The code writer and test generator call the
285
- configured provider. Static analysis, security audit, and test execution are
286
- model-free and run through deterministic local tools. The `splicerun.Run`
287
- orchestrator drives them under Zero's full callback contract (streaming,
288
- usage, tool call/result pairs, permission events) and is wired into headless
289
- `splice exec`.
290
- 5. **Monitor trajectory.** `ComputeIterationState` builds a state vector from
291
- stage outputs; `EvaluateTrajectory` scores it and decides continue,
292
- escalate, rollback, step back, or surface to user. Repeated state hashes
293
- escalate as a cycle, including empty hashes, so an orchestrator bug surfaces
294
- loudly instead of looping.
295
- 6. **Iterate or abort.** The orchestrator acts on the trajectory decision.
296
- Failures are typed, not swallowed: a malformed stage payload names the data
297
- key and offending index.
298
-
299
- Everything in `internal/splice/` is deterministic Go with full test coverage:
300
- JSON round-trip tests cover every `Validate()`-bearing struct, and the context
301
- builder has an end-to-end test against the real tool registry.
302
-
303
- ## Safety Model
304
-
305
- Splice is designed to make side effects visible.
306
-
307
- - Workspace reads are allowed by default.
308
- - File writes are limited to the workspace unless you grant another directory.
309
- - Shell commands, network access, destructive commands, and elevated actions are
310
- permission-gated.
311
- - `--add-dir <path>` and `/add-dir <path>` grant additional write roots without
312
- giving the agent the whole filesystem.
313
- - Unsafe and autonomous modes are explicit opt-ins.
314
- - Secrets are redacted from tool output and logs where Splice controls the
315
- surface.
316
-
317
- Example:
318
-
319
- ```bash
320
- splice --add-dir ../docs-site
321
- splice exec --add-dir ../shared "update both repos"
322
- ```
160
+ ## Providers and local models
323
161
 
324
- Sandbox behavior can be inspected with:
162
+ Bring the provider that fits the job. Splice supports OpenAI, Anthropic,
163
+ Gemini, Groq, OpenRouter, DeepSeek, Mistral, xAI, Qwen, Kimi, GitHub Models,
164
+ Ollama, LM Studio, and OpenAI- or Anthropic-compatible endpoints.
325
165
 
326
166
  ```bash
327
- splice sandbox policy
328
- splice sandbox grants list
167
+ splice setup
168
+ splice providers list
169
+ splice models list
170
+ splice doctor
329
171
  ```
330
172
 
331
- ## Web And Local Control
173
+ Set a provider key before setup or enter it in the wizard:
332
174
 
333
- Splice includes local file, search, edit, and shell tools, `web_fetch` for
334
- public URLs, and MCP support for additional tools.
335
-
336
- For local dev servers, use shell commands such as `curl` through `exec_command`
337
- so the normal sandbox and permission policy applies. Long-running commands stay
338
- attached to a background terminal session and can be listed or stopped from the
339
- TUI.
340
-
341
- The npm package will also include browser and terminal helper packages used by
342
- local browser and terminal tools. Source builds can use the same helpers when
343
- they are on `PATH` or configured in Splice's local-control settings.
344
-
345
- ## Common Commands
346
-
347
- ```text
348
- splice interactive TUI
349
- splice exec one-shot or scripted agent run
350
- splice setup first-run provider setup
351
- splice auth OAuth/login helpers for supported providers
352
- splice login subscription login helpers for supported providers
353
- splice models model registry and capabilities
354
- splice providers provider profiles and detection
355
- splice doctor setup, key, and connectivity checks
356
- splice context context-budget report
357
- splice repo-map deterministic repository map
358
- splice repo-info local repository summary
359
- splice search | find search local session history
360
- splice sessions inspect, resume, fork, and rewind sessions
361
- splice spec manage spec-mode drafts
362
- splice specialist manage specialist subagents
363
- splice skills manage markdown instruction skills
364
- splice plugins manage plugins
365
- splice hooks manage lifecycle hooks
366
- splice mcp manage MCP servers and tools
367
- splice serve --mcp expose Splice tools over MCP stdio
368
- splice sandbox inspect sandbox policy and grants
369
- splice worktrees prepare isolated git worktrees
370
- splice verify detect and run local verification checks
371
- splice changes inspect and commit local git changes
372
- splice usage token usage and estimated cost
373
- splice cron scheduled agent jobs
374
- splice update check for newer releases
375
- splice upgrade apply a newer release
175
+ ```bash
176
+ export OPENAI_API_KEY=sk-...
177
+ export ANTHROPIC_API_KEY=...
178
+ export GEMINI_API_KEY=...
376
179
  ```
377
180
 
378
- ## Extending Splice
379
-
380
- ### Project and personal instructions
381
-
382
- Splice appends project-specific guidance to the system prompt from the first
383
- `AGENTS.md`, `SPLICE.md`, or `.splice/AGENTS.md` file found in each directory
384
- from the git root down to your current working directory (checked in that order
385
- per directory). Files are injected general-to-specific, capped at 8 KiB per
386
- file and 32 KiB total.
387
-
388
- A personal `SPLICE.md` under
389
- `config.UserConfigDir()/splice/SPLICE.md`
390
- (`$XDG_CONFIG_HOME/splice/SPLICE.md` or `~/.config/splice/SPLICE.md` on
391
- Linux/macOS, `%AppData%\Roaming\splice\SPLICE.md` on Windows) applies across
392
- every workspace, ahead of any project guidelines.
393
-
394
- ### Plugins
181
+ Local models work through Ollama or LM Studio. Model-backed stages require tool
182
+ calling. If a provider returns an invalid typed payload, Splice retries the
183
+ correction and then reports an actionable error. It does not silently switch a
184
+ local run to a cloud provider.
395
185
 
396
- Plugins are discovered from
397
- `~/.config/splice/plugins/<name>/plugin.json` (user scope, `$XDG_CONFIG_HOME`
398
- or `~/.config` on every OS, independent of the `config.UserConfigDir()` path
399
- used above) and `<cwd>/.splice/plugins/<name>/plugin.json` (project scope,
400
- resolved from the current working directory, not the repo root), and managed
401
- with `splice plugins`. A manifest can declare:
186
+ ## Safety is part of the workflow
402
187
 
403
- - `tools` — custom tools (`command`, `args`, `inputSchema`, and a
404
- `permission` of `prompt` or `deny`; `allow` is honored only when manifest
405
- tool auto-approval is enabled)
406
- - `hooks` — commands run on `beforeTool`, `afterTool`, `sessionStart`, or
407
- `sessionEnd`
408
- - `prompts` and `skills` — additional prompt and skill files
188
+ Splice makes side effects visible instead of hiding them behind an autonomous
189
+ mode:
409
190
 
410
- MCP servers (`splice mcp`) and standalone markdown skills (`splice skills`)
411
- use the same extension points and can also be wired up outside of a plugin
412
- manifest.
413
-
414
- ## Appearance And Accessibility
415
-
416
- | Control | Effect |
417
- |---|---|
418
- | `NO_COLOR=<anything>` | disables color output |
419
- | `ZERO_THEME=<name>` | selects the startup theme (`auto`, `dark`, `light`, or a color theme like `dracula`, `nord`, `gruvbox`, `tokyo-night`, `catppuccin`, `one-dark`, `solarized-dark`, `rose-pine`, `everforest`, `solarized-light`) |
420
- | `--theme <name>` | selects the TUI theme from the CLI (same names) |
421
- | `/theme` | opens the theme picker inside the TUI (live preview; `/theme <name>` switches directly) |
422
- | `ZERO_NO_FADE=1` | disables streaming fade animation |
423
-
424
- > Note: the theme environment variables still use the `ZERO_` prefix from the
425
- > upstream engine. A rename to `SPLICE_` is planned but not yet applied; both
426
- > names will be accepted during a transition.
427
-
428
- Meaning does not rely on color alone; diffs, permissions, and statuses also use
429
- text or glyph markers.
430
-
431
- ## Development
191
+ - workspace reads are allowed by default;
192
+ - writes stay inside the workspace unless you grant another root;
193
+ - shell commands, network access, destructive actions, and elevated actions are
194
+ permission-gated;
195
+ - `--add-dir <path>` grants a specific additional write root;
196
+ - unsafe and autonomous modes are explicit opt-ins;
197
+ - sandbox policy and grants can be inspected before a run.
432
198
 
433
199
  ```bash
434
- go test ./...
435
- go run ./cmd/splice-release build
436
- go run ./cmd/splice-release smoke
437
- go run ./cmd/splice-perf-bench
200
+ splice sandbox policy
201
+ splice sandbox grants list
202
+ splice exec --add-dir ../shared "update both repositories"
438
203
  ```
439
204
 
440
- Cross-compile examples:
205
+ Read [SECURITY.md](SECURITY.md) for the threat model and reporting process.
441
206
 
442
- ```bash
443
- go run ./cmd/splice-release build --goos linux --goarch amd64
444
- go run ./cmd/splice-release build --goos windows --goarch amd64 --output dist/splice.exe
445
- ```
207
+ ## A small CLI surface for big workflows
446
208
 
447
- The deterministic pipeline layer lives in `internal/splice/` and is pure Go
448
- with no provider SDK imports. Its packages:
449
-
450
- - `internal/splice/schemas/` — typed stage and pipeline structs with
451
- `Validate()` methods.
452
- - `internal/splice/classifier.go` — request-to-tier classification.
453
- - `internal/splice/planner.go` — tier-to-execution-plan, intent distillation.
454
- - `internal/splice/budget.go` — per-tier token budgets.
455
- - `internal/splice/trajectory.go` — iteration state, scoring, trajectory
456
- decisions.
457
- - `internal/splice/context.go` + `registry_runner.go` — deterministic context
458
- fulfillment through Zero's tool registry.
459
- - `internal/splice/stages/`: the stage agents (code writer, static analyzer,
460
- test generator, security auditor, test runner, design conversation, plan
461
- critic) with embedded prompts.
462
- - `internal/splice/run.go`: the `splicerun.Run` orchestrator loop.
463
- - `internal/splice/design_runner.go`: `RunDesignPlan`, topological task
464
- sequencing for `splice exec --plan`.
465
-
466
- Adjacent Splice-specific pieces: `internal/worktrees/` adds `MergeBack` on top
467
- of Zero's worktree lifecycle, `memd/` is the memory sidecar (its own Go module,
468
- binary `splice-memd`, SQLite/FTS5 over a Unix socket), and `internal/memd/` is
469
- the sidecar's HTTP client (complete).
209
+ | Command | What it is for |
210
+ |---|---|
211
+ | `splice` | Interactive TUI |
212
+ | `splice exec` | One-shot and scripted runs |
213
+ | `splice setup` | First-run provider setup |
214
+ | `splice providers` / `models` | Provider profiles and model capabilities |
215
+ | `splice doctor` | Setup and connectivity checks |
216
+ | `splice spec` | Spec-mode drafts |
217
+ | `splice sessions` | Resume, fork, and inspect sessions |
218
+ | `splice specialist` | Specialist subagents |
219
+ | `splice skills` / `plugins` / `hooks` | Extend the agent locally |
220
+ | `splice mcp` | Configure MCP servers and tools |
221
+ | `splice worktrees` | Prepare isolated git worktrees |
222
+ | `splice verify` | Find and run repository checks |
223
+ | `splice update` / `upgrade` | Keep the binary current |
470
224
 
471
225
  ## Documentation
472
226
 
473
- - [Install](docs/INSTALL.md)
227
+ - [Install Splice](docs/INSTALL.md)
474
228
  - [Update flow](docs/UPDATE.md)
475
229
  - [Stream-JSON protocol](docs/STREAM_JSON_PROTOCOL.md)
476
230
  - [Specialists](docs/SPECIALISTS.md)
477
231
  - [GitHub Action](docs/GITHUB_ACTION.md)
478
232
  - [Benchmarks](docs/BENCHMARK.md)
479
233
  - [Performance](docs/PERFORMANCE.md)
480
- - [Agent evals](docs/AGENT_EVALS.md)
234
+ - [Agent evaluations](docs/AGENT_EVALS.md)
235
+ - [OAuth logins and subscriptions](docs/oauth-subscriptions.md)
481
236
 
482
- ## Contributing
237
+ ## For contributors
483
238
 
484
- Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md), run the
485
- relevant tests, and open a focused pull request.
239
+ Splice-specific pipeline code lives in `internal/splice/`. It is pure Go and
240
+ keeps provider SDKs out of the pipeline layer. The optional memory sidecar is a
241
+ separate module in `memd/` and communicates over a Unix socket.
486
242
 
487
- Security reports should follow [SECURITY.md](SECURITY.md).
243
+ ```bash
244
+ go test ./...
245
+ go vet ./...
246
+ gofmt -l .
247
+ cd memd && go test ./...
248
+ ```
488
249
 
489
- ## License
250
+ Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a change. The project is
251
+ currently using an issue-first contribution policy.
490
252
 
491
- Splice is released under the [MIT License](LICENSE).
253
+ ## Built on Zero's Engine
254
+
255
+ Splice is built on top of [Gitlawb's Zero Engine](https://github.com/gitlawb/zero),
256
+ an open-source MIT-licensed terminal coding agent. Zero provides the TUI,
257
+ provider adapters, sessions, tools, sandbox, permissions, worktrees, MCP,
258
+ skills, plugins, and hooks. Splice keeps that foundation and adds the
259
+ orchestrator-mediated pipeline, typed stage contracts, deterministic checks,
260
+ trajectory monitoring, and the optional memory sidecar.
492
261
 
493
- ## Attribution
262
+ Upstream Zero code retains its original copyright and license. See
263
+ [LICENSE](LICENSE) and [SECURITY.md](SECURITY.md).
494
264
 
495
- Splice is built on top of [Gitlawb's Zero CLI](https://github.com/gitlawb/zero),
496
- an open-source MIT-licensed terminal coding agent. Splice extends Zero's engine
497
- with a deterministic, orchestrator-mediated multi-stage pipeline paradigm ported
498
- from the archived Flug prototype. All upstream Zero code retains its original
499
- copyright and license.
265
+ ## License
266
+
267
+ Splice is released under the [MIT License](LICENSE).
package/bin/splice.js CHANGED
@@ -82,9 +82,9 @@ if (!existsSync(nativePath)) {
82
82
 
83
83
  const env = { ...process.env };
84
84
  if (localControlHelpers) {
85
- env.ZERO_LOCAL_CONTROL_HELPERS = localControlHelpers;
85
+ env.SPLICE_LOCAL_CONTROL_HELPERS = localControlHelpers;
86
86
  } else {
87
- delete env.ZERO_LOCAL_CONTROL_HELPERS;
87
+ delete env.SPLICE_LOCAL_CONTROL_HELPERS;
88
88
  }
89
89
 
90
90
  const child = spawnSync(nativePath, process.argv.slice(2), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taf0711/splice",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Splice — a fast, multi-provider terminal coding agent.",
5
5
  "type": "module",
6
6
  "module": "bin/splice.js",
@@ -12,12 +12,12 @@
12
12
  // crafted archive cannot write outside the package (no zip-slip).
13
13
  //
14
14
  // Env overrides (testing / mirrors / locked-down installs):
15
- // ZERO_SKIP_DOWNLOAD=1 skip entirely, exit 0 (wrapper will guide if run)
15
+ // SPLICE_SKIP_DOWNLOAD=1 skip entirely, exit 0 (wrapper will guide if run)
16
16
  // SPLICE_INSTALL_DRY_RUN=1 print the resolved plan as JSON, no network, exit 0
17
17
  // SPLICE_INSTALL_PLATFORM=… override process.platform (linux|darwin|win32|android)
18
18
  // SPLICE_INSTALL_ARCH=… override process.arch (x64|arm64)
19
19
  // SPLICE_REPO=owner/name override the GitHub repo (default Taf0711/splice)
20
- // ZERO_GITHUB_BASE_URL=… override the download host (default https://github.com)
20
+ // SPLICE_GITHUB_BASE_URL=… override the download host (default https://github.com)
21
21
 
22
22
  import {
23
23
  chmodSync,
@@ -42,11 +42,11 @@ const pkg = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));
42
42
  const VERSION = pkg.version;
43
43
 
44
44
  const REPO = process.env.SPLICE_REPO || 'Taf0711/splice';
45
- const BASE = (process.env.ZERO_GITHUB_BASE_URL || 'https://github.com').replace(/\/+$/, '');
45
+ const BASE = (process.env.SPLICE_GITHUB_BASE_URL || 'https://github.com').replace(/\/+$/, '');
46
46
  // The .sha256 is fetched from the same origin as the archive, so TLS authenticity
47
47
  // is the only real integrity control — require https unless explicitly overridden
48
48
  // for local testing (e.g. a localhost mirror in tests).
49
- const ALLOW_INSECURE = process.env.ZERO_ALLOW_INSECURE_DOWNLOAD === '1';
49
+ const ALLOW_INSECURE = process.env.SPLICE_ALLOW_INSECURE_DOWNLOAD === '1';
50
50
  const MAX_DOWNLOAD_BYTES = 512 * 1024 * 1024;
51
51
 
52
52
  function fail(message) {
@@ -86,8 +86,8 @@ function resolveArch(a) {
86
86
  }
87
87
  }
88
88
 
89
- if (process.env.ZERO_SKIP_DOWNLOAD === '1') {
90
- warnSkip('ZERO_SKIP_DOWNLOAD=1 set — skipping native binary download.');
89
+ if (process.env.SPLICE_SKIP_DOWNLOAD === '1') {
90
+ warnSkip('SPLICE_SKIP_DOWNLOAD=1 set — skipping native binary download.');
91
91
  }
92
92
 
93
93
  const rawPlatform = process.env.SPLICE_INSTALL_PLATFORM || process.platform;
@@ -141,6 +141,7 @@ const optionalBinaries =
141
141
  : platform === 'linux'
142
142
  ? ['splice-linux-sandbox', 'splice-seccomp']
143
143
  : [];
144
+ optionalBinaries.push(platform === 'windows' ? 'splice-memd.exe' : 'splice-memd');
144
145
 
145
146
  if (process.env.SPLICE_INSTALL_DRY_RUN === '1') {
146
147
  process.stdout.write(
@@ -174,7 +175,7 @@ async function download(url) {
174
175
  if (!ALLOW_INSECURE && !url.startsWith('https://')) {
175
176
  fail(
176
177
  `refusing insecure download origin for ${url}: only https:// is allowed ` +
177
- `(set ZERO_ALLOW_INSECURE_DOWNLOAD=1 to override for local testing).`,
178
+ `(set SPLICE_ALLOW_INSECURE_DOWNLOAD=1 to override for local testing).`,
178
179
  );
179
180
  }
180
181
  let response;