CLI Reference
buildwithnexus is a single static binary — a fast coding agent that lives in your terminal. It plans, reads and edits files, and runs commands, asking before each change. Run it with the full name or the short alias bwn.
npm install -g buildwithnexus
buildwithnexus # or: bwn
Running with no arguments opens the interactive REPL. Pass a subcommand to go headless.
Top-Level Commands
| Command | Description |
|---------|-------------|
| buildwithnexus | Open the interactive REPL |
| buildwithnexus run <task> | Execute a task headlessly (agentic BUILD loop) |
| buildwithnexus plan <task> | Plan into approved steps, then execute |
| buildwithnexus brainstorm <idea> | Free-form chat, no tools |
| buildwithnexus continue | Resume the most recent session |
| buildwithnexus resume <id> | Resume a specific session by id |
| buildwithnexus sessions | List saved sessions |
| buildwithnexus init | Configure keys, providers, and local models |
| buildwithnexus providers | List built-in providers and their status |
| buildwithnexus doctor | Diagnose setup (keys, tools, connectivity) |
| buildwithnexus version | Show version |
Modes
The same three modes are available from subcommands and from inside the REPL.
The REPL
Running buildwithnexus with no arguments drops you into an interactive shell that renders inline on the normal terminal screen — so native scroll, select, and copy all work. Edits show inline colored diffs, and tokens stream as they arrive.
Slash Commands
| Command | Description |
|---------|-------------|
| /help | Show available commands |
| /clear | Clear the screen |
| /new | Start a fresh session |
| /resume | Pick a saved session to restore and continue |
| /init | Run setup (keys, providers, local-model detection) |
| /exit | Leave the REPL (/quit also works) |
| /model [name] | Hot-swap the AI model mid-session; persists to settings |
| /compact | Compress the transcript to free up token budget |
| /review | AI code review of the current git diff |
| /commit | AI-drafted conventional commit message for staged changes |
| /pr | AI-drafted pull request title and description |
| /schedule <delay> <task> | Run a task once in the background after a delay (e.g. 5s, 2m, 1h) |
| /loop <interval> <task> | Run a task repeatedly in the background at a fixed interval |
| /workflows | List and manage background workflows; c<id> to cancel, i<id> to inspect output |
| /btw <context> | Inject silent context into the next agent turn without interrupting |
| /config | Configure hooks, memory, and commands via AI |
| /memory | View and edit session memory |
| /skills | List available skills and custom slash commands |
Shell Mode
Prefix a line with ! to run it directly in your shell without leaving the REPL.
! git status
! cargo test
Input Editor
The input line is a full editor, not a plain prompt.
Permission Modes
Mutating tools are gated. Pick how aggressively buildwithnexus is allowed to act.
Guardrails hold in every mode: file tools are confined to the working directory, sensitive paths (~/.ssh, .env, *.pem, the key store) and catastrophic commands always prompt, API keys are never sent to a non-HTTPS endpoint, and key-like tokens are redacted from surfaced errors.
Headless & Automation
Every mode has a headless subcommand. Add --json to emit one structured event per line — ideal for scripts and CI.
buildwithnexus run "add a --verbose flag to the CLI"
buildwithnexus plan "migrate the test suite to vitest"
buildwithnexus run "summarize recent changes" --json
{"type":"tool_call","name":"read_file","input":{"path":"src/main.rs"}}
{"type":"tool_result","name":"read_file","content":"fn main() {…","is_error":false}
{"type":"assistant","text":"Added the --verbose flag."}
{"type":"finish","summary":"Added the --verbose flag."}
Models & Providers
Use a remote model via API key, or a local model on your machine. Eight built-in providers span two wire protocols.
Run buildwithnexus init to configure keys and detect local models, or buildwithnexus providers to see what's available.
Sessions
Every run's transcript is saved under ~/.buildwithnexus/sessions. Resume from the CLI or from inside the REPL with /resume. When the context nears the model's window it auto-compacts so long sessions keep going.
buildwithnexus sessions # list saved sessions
buildwithnexus continue # resume the most recent
buildwithnexus resume <id> # resume a specific session