oxi
CLI coding agent harness — the top-level binary that ties together the oxi workspace.
Overview
oxi is a terminal-based AI coding assistant. It provides an interactive REPL for chatting with LLMs, a session system for persisting and branching conversations, built-in tools (read, write, edit, bash), a skill/template system, and dynamic extension loading.
Architecture
oxi (CLI harness)
├── oxi-ai — Unified LLM API (streaming, providers, context, tools)
├── oxi-agent — Agent runtime (event loop, tool execution, compaction)
└── oxi-tui — Terminal UI framework (components, rendering, themes)
The oxi crate itself handles:
- CLI argument parsing via
clap - Session management (JSONL persistence, forking, tree navigation)
- Settings (
~/.oxi/settings.toml) - Skill loading from
~/.oxi/skills/<name>/SKILL.md - Prompt templates from
~/.oxi/templates/ - Package management (install/uninstall extensions and skills)
- Extension loading (dynamic
.so/.dylib/.dllshared libraries)
Installation
# Build from source
# The binary is at target/release/oxi
Requirements
- Rust 1.80+ (edition 2021)
- An API key for at least one LLM provider (see Provider Setup below)
Quick Start
# Interactive mode (default)
# Single prompt (non-interactive)
# Specify provider and model
# With thinking level
# Load an extension
Interactive Commands
Inside the REPL, type / followed by a command:
| Command | Description |
|---|---|
/help |
Show available commands |
/model |
Show current model |
/model <provider/model> |
Switch model (e.g., openai/gpt-4o) |
/models |
List available models |
/sessions |
List all sessions |
/tree |
Show current session tree |
/fork <entry_id> |
Fork a new session from an entry |
/skill |
List available skills |
/skill <name> |
Activate a skill |
/skill off <name> |
Deactivate a skill |
/template |
List prompt templates |
/template <name> [key=val ...] |
Expand and send a template |
/history |
Show conversation history |
exit / quit |
Exit the REPL |
Provider Setup
oxi reads API keys from environment variables:
| Provider | Environment Variable |
|---|---|
| OpenAI | OPENAI_API_KEY |
| Anthropic | ANTHROPIC_API_KEY |
GOOGLE_API_KEY |
|
| DeepSeek | DEEPSEEK_API_KEY |
| Mistral | MISTRAL_API_KEY |
| Groq | GROQ_API_KEY |
| Cerebras | CEREBRAS_API_KEY |
| xAI | XAI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Azure OpenAI | AZURE_OPENAI_API_KEY |
Add them to your shell profile:
Default Model
The default model is anthropic/claude-sonnet-4-20250514. Override it in settings:
# ~/.oxi/settings.toml
= "openai/gpt-4o"
= "openai"
= "standard"
Or on the command line:
CLI Reference
oxi [OPTIONS] [PROMPT]
Arguments:
[PROMPT] Initial prompt (non-interactive mode)
Options:
-p, --provider <PROVIDER> Provider (e.g., anthropic, openai, google)
-m, --model <MODEL> Model (e.g., claude-sonnet-4-20250514, gpt-4o)
-i, --interactive Force interactive mode
--thinking <LEVEL> Thinking level: none, minimal, standard, thorough
-e, --extension <PATH> Load extension from shared library (repeatable)
-h, --help Print help
-V, --version Print version
Subcommands:
sessions List all sessions
tree [SESSION_ID] Show session tree structure
fork <PARENT_ID> <ENTRY_ID> Fork a session from a specific entry
delete <SESSION_ID> Delete a session
pkg install <SOURCE> Install a package
pkg list List installed packages
pkg uninstall <NAME> Uninstall a package
Settings
Settings are stored at ~/.oxi/settings.toml:
= "standard" # none, minimal, standard, thorough
= "default" # TUI color theme
= "anthropic/claude-sonnet-4-20250514"
= "anthropic"
= 4096
= 0.7
= 100
= true
Skills
Skills are markdown files that inject context into the system prompt. Place them in ~/.oxi/skills/<name>/SKILL.md:
~/.oxi/skills/
├── rust-expert/
│ └── SKILL.md # Activated with /skill rust-expert
└── code-review/
└── SKILL.md # Activated with /skill code-review
Templates
Prompt templates support variable substitution. Place .md files in ~/.oxi/templates/:
Review the following {{language}} code for bugs and improvements:
{{code}}
Use with /template review language=Rust code="fn main() {}".
Sessions
Sessions are persisted as JSONL files in ~/.oxi/sessions/. Each session is a tree of entries that can be listed, inspected, and forked:
# List sessions
# View session tree
# Fork from a specific entry
# Delete a session
Extensions
Extensions are dynamically loaded shared libraries that register custom tools with the agent:
Extensions implement the AgentTool trait from oxi-agent and are registered at startup.
License
MIT