Complete reference for Nexus CLI commands and options.
Start the interactive REPL:
bun run dev
# or
nexusOptions:
- None — starts the interactive REPL
Run the interactive setup wizard:
bun run dev setup
# or
nexus setupWhat it does:
- Prompts for provider selection
- Collects API key
- Selects model
- Sets budget
- Offers skill installation
Check configuration and diagnose issues:
bun run dev doctor
# or
nexus doctorChecks:
- Model format
- Budget value
- API key presence
- Nexus home directory
- Required subdirectories
- Bun availability
- Docker availability (if using docker sandbox)
Exit codes:
0— All checks pass1— One or more failures
Slash commands are available within the REPL:
Show available commands:
❯ /help
Clear conversation history:
❯ /clear
Show current model:
❯ /model
List learned skills:
❯ /skills
Options:
view <name>— View a specific skilldelete <name>— Delete a skill
List available modes:
❯ /modes
Switch to a mode:
❯ /mode research
Special modes:
default— Return to default behaviorcoding— Software developmentresearch— Analysis and investigationcode-review— Structured code reviewdevops— Infrastructure and deploymentwriting— Content creation
Show routing and learning statistics:
❯ /stats
Output:
- Routing stats (System 1 vs System 2)
- Skill count and success rates
- Token usage and costs
- Memory usage
Search wiki memory:
❯ /wiki recall "authentication"
Other wiki commands:
/wiki read <page>— Read a wiki page/wiki write <page>— Write a wiki page/wiki search <query>— Search wiki content/wiki list <category>— List pages by category/wiki lint— Health-check the wiki
List available tools:
❯ /tools
Output:
- Built-in tools
- MCP tools (if configured)
- Tool descriptions
Exit Nexus:
❯ /exit
| Variable | Default | Description |
|---|---|---|
NEXUS_MODEL |
anthropic:claude-sonnet-4-20250514 |
Model to use |
NEXUS_BUDGET |
2.0 |
Budget per session in USD |
NEXUS_HOME |
.nexus/ |
Directory for data |
NEXUS_MAX_ITERATIONS |
25 |
Max tool-calling iterations |
NEXUS_MAX_CONTEXT_TOKENS |
128000 |
Max context window |
NEXUS_SANDBOX |
local |
Execution mode |
| Variable | Provider |
|---|---|
ANTHROPIC_API_KEY |
Anthropic |
OPENAI_API_KEY |
OpenAI |
GOOGLE_API_KEY |
|
OPENROUTER_API_KEY |
OpenRouter |
Environment variables for configuration:
ANTHROPIC_API_KEY=sk-ant-...
NEXUS_MODEL=anthropic:claude-sonnet-4-20250514
NEXUS_BUDGET=2.0Advanced configuration:
{
"model": "anthropic:claude-sonnet-4-20250514",
"budget": 2.0,
"maxIterations": 25,
"maxContextTokens": 128000,
"sandbox": "local"
}MCP server configuration:
{
"memory": {
"name": "Memory",
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"enabled": true
}
}Permission configuration:
{
"allowedPaths": ["/path/to/project"],
"deniedPaths": ["/etc", "/system"],
"toolPermissions": {
"shell": { "allowed": true, "approvalRequired": true }
}
}Press Alt+Enter to insert a newline without sending:
❯ Create a script that:
- Reads a CSV
- Filters rows
- Writes results
Press Enter to send.
Press Ctrl+C to interrupt a long-running task.
Use arrow keys to navigate command history.
Tab completion for slash commands and file paths (coming soon).
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Error or failure |
# Start Nexus
bun run dev
# Use a specific model
NEXUS_MODEL=openai:gpt-4o bun run dev
# Set a budget
NEXUS_BUDGET=5.0 bun run dev# Run setup wizard
bun run dev setup
# Check configuration
bun run dev doctor# Use custom home directory
NEXUS_HOME=/path/to/nexus-data bun run dev
# Use Docker sandbox
NEXUS_SANDBOX=docker bun run dev
# Increase iteration limit
NEXUS_MAX_ITERATIONS=50 bun run devSet the appropriate environment variable:
export ANTHROPIC_API_KEY=sk-ant-...Increase the budget or reduce token usage:
NEXUS_BUDGET=5.0 bun run devIncrease the context window:
NEXUS_MAX_CONTEXT_TOKENS=200000 bun run dev- FAQ — Frequently asked questions
- Troubleshooting — Common issues and solutions