Minimal coding agent CLI — wire your model to the repo
Project description
Wire0
Minimal coding agent CLI. Wire your model to the repo.
Wire0 is a small Python REPL that connects an OpenRouter model to your workspace with eight tools — file search, read/write/patch, foreground shell, and detached background shells. It streams responses, runs tools in parallel, and caches prompts for long sessions.
Requirements
- Python 3.11+
- An OpenRouter API key
Quick start
pip (recommended)
pip install wire0
wire0
Windows (from source)
git clone https://github.com/as9coder/wire0.git
cd wire0
.\setup.bat
macOS / Linux (from source)
git clone https://github.com/as9coder/wire0.git
cd wire0
chmod +x setup.sh && ./setup.sh
Manual install from clone
pip install .
# or editable:
pip install -e .
API key — prompted on first run, or set anytime with /key. Saved to ~/.wire0/config.json. The OPENROUTER_API_KEY environment variable overrides the saved key.
If you used the old Agent0 name, Wire0 auto-imports
~/.agent0/config.jsonon first run.
Run
wire0 # workspace = current directory
wire0 D:\myproject # workspace = specific path
wire0 --plain # skip welcome screen
Dev launcher (editable install from clone):
.\run.ps1
CLI
| Input | Action |
|---|---|
/key |
Prompt for OpenRouter API key (hidden input) |
/key sk-or-... |
Set key inline |
/model |
Show current OpenRouter model id |
/model provider/model |
Switch model (any OpenRouter id, saved to config) |
/context or /ctx |
Show context usage (limit + filled tokens from OpenRouter) |
/clear |
Reset conversation and cache session |
/exit |
Quit |
| Ctrl+C (idle) | Quit with styled farewell |
| Ctrl+C (agent running) | Interrupt current turn — CLI stays open |
Prompt history is stored in ~/.wire0_history.
/context fetches the model's context limit from OpenRouter's models API and counts current prompt tokens via a minimal usage probe (~1 output token).
Environment
| Variable | Default | Description |
|---|---|---|
OPENROUTER_API_KEY |
— | Overrides saved key |
WIRE0_MODEL |
openrouter/owl-alpha |
OpenRouter model id |
WIRE0_CACHE_TTL |
1h |
Prompt cache TTL (ephemeral) |
WIRE0_TUI |
1 |
Set to 0 to disable welcome screen |
Tools
All tools accept batch arguments — the agent is instructed to pass arrays of paths, patches, or commands in a single call rather than looping one item per turn.
| Tool | Purpose |
|---|---|
grep |
Regex search across files/dirs (include="*.py", ignore_case) |
list_dir |
List directory contents |
read_file |
Read files with line numbers (offset, limit) |
patch_file |
Surgical edit — replace unique old string with new |
write_file |
Create or overwrite files (new files only; prefer patch for edits) |
delete_path |
Delete files or directories |
shell_run |
Foreground shell — one persistent session, merged transcript |
bg_shell |
Detached shell — long-running servers, survives CLI exit |
shell_run vs bg_shell
shell_run— sync work: tests, builds, git, installs. One session per CLI lifetime. Batch withcommands=["npm install","npm test"]. Call with no commands to refresh a still-running command. Not for servers.bg_shell— async work: dev servers, docker, watch mode. Actions:start,output,list,kill. Jobs live in~/.wire0/background/and persist after you exit Wire0.
How it works
Each turn:
- Workspace path and file tree (names only) are injected into the system prompt.
- The model streams a response; tool calls run in parallel (up to 8 workers).
- Tool results are appended and the loop continues until the model stops calling tools.
- OpenRouter prompt caching keeps system instructions, tool schemas, and session stable across turns.
The TUI shows a braille spinner while thinking, tool names while working, streamed assistant text, and dim cache stats when available.
Troubleshooting
ModuleNotFoundError: No module named 'wire0'
The wire0 command exists but the package install is broken. From the repo folder:
.\repair.bat
Or manually:
pip install /path/to/wire0 --force-reinstall
wire0 not recognized
Add Python's Scripts folder to your PATH, or run:
python -m wire0
Development
pip install -e ".[dev]"
python -m unittest discover -s tests -v
CI runs tests on Ubuntu and Windows with Python 3.11 and 3.12.
Publish to PyPI (maintainers)
$env:TWINE_PASSWORD = "pypi-..." # token from pypi.org/manage/account/token/
.\publish.ps1
Or add PYPI_API_TOKEN to GitHub repo secrets — pushes to v* tags auto-publish via .github/workflows/publish.yml.
Project layout
wire0/
cli.py # REPL, commands, Ctrl+C interrupt
llm.py # OpenRouter streaming + tool loop
tools.py # Tool implementations and JSON schemas
context.py # /context — OpenRouter usage + limits
logo.py # ASCII wordmark
shell.py # Foreground shell session
bg_shell.py # Detached background jobs
cache.py # OpenRouter prompt caching
workspace.py # Workspace path + file tree
config.py # API key + model in ~/.wire0/config.json
spinner.py # Braille status indicator
tui_experimental.py # Optional welcome screen
setup.bat / setup.sh # One-click install
repair.bat / repair.ps1 # Fix broken global install
Config on disk
| Path | Contents |
|---|---|
~/.wire0/config.json |
OpenRouter API key and saved model |
~/.wire0/background/ |
Background job registry and logs |
~/.wire0_history |
CLI prompt history |
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wire0-0.1.1.tar.gz.
File metadata
- Download URL: wire0-0.1.1.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2396413a6323c24ba7ac4d0535c0e08e142cc6bd794c04f77a6d24eaaa98ee2
|
|
| MD5 |
4d546e86008924d0a81154200be0603e
|
|
| BLAKE2b-256 |
7daf7200aca6b9a5075e9606f45d989a32fc55aaca6a4e1ab501ef57eff1d216
|
File details
Details for the file wire0-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wire0-0.1.1-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdd0c7f9d0bfb3f4d2fc096ebec6ba0b7af512ac42ac475426e05294ba5216f6
|
|
| MD5 |
42f4851a66e6c1e8a0a14f1f563d39ec
|
|
| BLAKE2b-256 |
96104d7240e4fc0006e6120e96d08bcbb6120c96fc3b917bac34b348caf59dab
|