Documentation
Quickstart
Get up and running in under a minute.
Install
curl -fsSL https://toporic.com/code/tui/install.sh | sh irm https://toporic.com/code/tui/install.ps1 | iex curl -fsSL https://toporic.com/code/tui/install.sh | sh curl -LO https://github.com/ToporicAI/toporic-code/releases/latest/download/toporic-$(uname -s)-$(uname -m).tar.gz Set your API key
toporic set-key --provider anthropic --key sk-ant-... Start coding
cd my-project
toporic Installation
Toporic is distributed as a single static binary. The only runtime dependency is rg (ripgrep) for the search_files tool.
macOS / Linux
chmod +x toporic
sudo cp toporic /usr/local/bin/
# Or user-local
mkdir -p ~/.local/bin && cp toporic ~/.local/bin/
toporic --help Windows
The TUI requires a terminal that supports raw mode — use Windows Terminal or WSL.
search_files tool requires rg (ripgrep). Install via apt install ripgrep, brew install ripgrep, or pacman -S ripgrep.
Setting API keys
Two options — config file (recommended) or environment variables:
# Option A — Save to config (recommended)
toporic set-key --provider anthropic --key sk-ant-...
toporic set-key --provider openai --key sk-...
# Option B — Environment variable (takes priority)
export ANTHROPIC_API_KEY="sk-ant-..." AGENT_API_KEY env var, 3) config file. Keys in config are stored with 600 permissions.
Supported Providers
21+ LLM providers are supported out of the box. Choose one with --provider or set it in config.
anthropic ANTHROPIC_API_KEY openai OPENAI_API_KEY deepseek DEEPSEEK_API_KEY openrouter OPENROUTER_API_KEY ollama — no key needed — minimax MINIMAX_API_KEY groq GROQ_API_KEY together TOGETHER_API_KEY perplexity PERPLEXITY_API_KEY mistral MISTRAL_API_KEY cerebras CEREBRAS_API_KEY fireworks FIREWORKS_API_KEY google GOOGLE_API_KEY cohere COHERE_API_KEY nvidia NVIDIA_API_KEY xai XAI_API_KEY zhipuai ZHIPU_API_KEY tencent-coding-plan TENCENT_CODING_PLAN_API_KEY tencent-tokenhub TENCENT_TOKENHUB_API_KEY alibaba DASHSCOPE_API_KEY kimi KIMI_API_KEY Ollama (local models)
No API key needed. Run Ollama alongside Toporic:
ollama serve &
toporic --provider ollama --model llama3 Default endpoint: http://localhost:11434. Override via providers.ollama.base_url in config.
--provider CLI flag, the Ctrl+, config overlay, or edit ~/.toporic/providers.json.
CLI Reference
toporic # Coding mode (default)
toporic --mode assistant # Conversational
toporic --mode research # Web research
toporic --provider openai --model gpt-4o-mini # Different backend
toporic --resume # Resume latest session
toporic --no-persist # Don't save session All flags
| Flag | Short | Values | Description |
|---|---|---|---|
--mode | -m | coding / assistant / research | Agent mode |
--provider | -p | Provider name | LLM backend |
--model | String | Model override | |
--no-persist | Flag | Skip writing session | |
--resume | Optional UUID | Resume session | |
--auto | Flag | Skip permission prompts | |
--theme | amber / purple / green | Theme preset |
Subcommands
| Command | Options | Description |
|---|---|---|
set-key | --provider <name> --key <value> | Save API key to config |
Override priority
CLI flags → config file → built-in defaults. Environment variables override config file API keys.
Agent Modes
Three modes for different workflows. Switch with --mode flag, config, or Ctrl+, overlay.
Coding --mode coding
Full filesystem, shell, and web access. Reads, writes, edits files; runs commands; searches code; fetches URLs. Sandboxed to Git workspace root. 40-turn memory with compaction.
Assistant --mode assistant
Pure conversation with no tool access. 30-turn memory. Great for questions, explanations, and discussion.
Research --mode research
Web tools only — DuckDuckGo search, URL fetching (SSRF-protected), and REST API calls. No filesystem or shell access. 30-turn memory.
TUI Reference
Layout
The TUI has five zones:
- Title bar — app name, mode badge, spinner, token gauge, cost, git branch
- Sidebar — toggle with
Ctrl+B(≥100 columns, appears to the right). Shows tasks, modified files - Chat area — messages, reasoning blocks, collapsible tool calls
- Input box — multiline entry (up to 5 visible lines)
- Footer — keyboard hints, workspace path, git branch
Tool calls
Tool calls appear as collapsible units: ▸ command_name ✓ (green) or ✗ (red). Press Enter or Space in message focus to expand and see full arguments and results.
Confirm dialog
Before mutating tools (run_command, write_file, etc.), a confirmation popup appears. Y to accept, N / Enter / Esc to reject.
--auto to skip all permission prompts for unattended runs.
Command palette
Press Ctrl+P for a fuzzy-searchable list of actions: change provider, model, theme, language, start new session, and more.
Auto-scroll
Enabled by default. Pause with PageUp, resume with End. The [END] indicator shows when active.
Keybindings
Global
| Tab | Cycle focus (input ↔ messages) |
| Ctrl+P | Open command palette |
| ? | Open help overlay |
| PageUp | Scroll up 10 lines (pauses auto-scroll) |
| PageDown | Scroll down 10 lines |
Input focus
| Enter | Submit input |
| Shift+Enter | Insert newline |
| Alt+Enter | Insert newline (fallback) |
| Ctrl+B | Toggle sidebar |
| ↑ ↓ | Navigate input lines |
Message focus (press Tab)
| ↑ k | Scroll up / prev message |
| ↓ j | Scroll down / next message |
| Enter Space | Expand/collapse tool call |
| End G | Jump to bottom (resume auto-scroll) |
| Home g | Jump to top |
| Esc | Return to input |
Sessions
Every interaction is saved automatically under ~/.toporic/sessions/. Sessions persist across restarts and can be resumed with --resume.
toporic --resum # Latest session
toporic --resume 550e8400-e29b-41d4-a716-446655440000 # By UUID
toporic --no-persist # No disk write
# Start a fresh session from within the TUI
/session new Tools Reference
20+ tools across seven categories. All sandboxed to the Git workspace root.
Filesystem 5 tools
read_file | Read file (max 100KB, sandboxed) |
write_file | Write/create file (auto-creates dirs) |
edit_file | Exact string replace (returns diff) |
list_dir | List directory (flat or recursive) |
delete_file | Delete file (shows contents first) |
Shell 3 tools
run_command | Execute command (30s timeout, 100KB) |
run_command_stream | Streaming variant (stderr: ! prefix) |
search_files | Ripgrep search (needs rg) |
Allowed: cargo git python3 node npm make pytest rg ls cat mkdir rm cp mv grep find curl wget jq tar ...
Web 3 tools
fetch_url | Fetch URL (15s timeout, SSRF-protected) |
web_search | DuckDuckGo search (1–25 results) |
api_call | REST API (1–120s timeout, JSON pretty-print) |
Configuration
Config file: ~/.toporic/config.json
{
"defaults": {
"mode": "coding",
"provider": "anthropic",
"model": "claude-sonnet-4-20250514",
"theme": "amber",
"language": "English",
"models": { "anthropic": "...", "openai": "gpt-4o" }
},
"providers": {
"anthropic": "sk-ant-...",
"openai": "sk-...",
"ollama": { "base_url": "http://localhost:11434", "model": "llama3" }
},
"provider_urls": { "deepseek": "http://localhost:7897" },
"embedding": { "provider": "voyage" }
} CLI flags override config values. Environment variables override API keys. Changes via Ctrl+P command palette are saved to config automatically.
Skills
Skills are reusable instruction bundles (Markdown with YAML frontmatter) that give the agent project-specific context. The agent sees a compact index of all skills every turn.
Discovery paths (priority order)
{workspace_root}/.toporic/skills/— project-local~/.toporic/skills/— user-wide/etc/toporic/skills/— system-wide
Using skills
Invoke a skill explicitly from the TUI input:
/skill my-rules SKILL.md file with optional frontmatter (description, tags, version).
Workspace Initialization
Run /init in the TUI to bootstrap a project workspace. Creates .toporic/skills/ and AGENTS.md. Runs git init if needed. Idempotent — safe to run multiple times.
.toporic/
└── skills/ ← project-local skills
AGENTS.md ← project instructions (read every turn) Use AGENTS.md to give the agent project-specific instructions, conventions, and context — it's read on every turn.
Troubleshooting
Terminal too small
Requires ≥20 columns × 6 rows. Resize and the TUI re-renders on next keystroke.
Shift+Enter not inserting newline
Use Alt+Enter as an alternative.
Ollama not responding
Verify curl http://localhost:11434 and ensure the model is pulled: ollama pull llama3.
Rate limit errors (429)
Auto-retries with exponential backoff (500ms → 1s → 2s, up to 3 attempts). Respects Retry-After header.
Debug logging
RUST_LOG=debug toporic
tail -f ~/.toporic/toporic.log Context limit warning
Footer shows ⚠ Context at 91% — consider /session new. Start a new session or let the agent compact automatically.