Codi - Your AI coding wingman, reimagined in Rust.
A high-performance terminal AI assistant supporting Claude, OpenAI, Ollama, and more. Built with Rust for speed, safety, and reliability.
- π€ Multi-Provider Support - Claude, OpenAI, Ollama, and OpenAI-compatible APIs
- π οΈ Powerful Tool System - File operations, shell commands, grep, glob, and more
- π§ RAG System - Semantic code search with vector embeddings
- π Symbol Index - Tree-sitter based code navigation
- π₯ Multi-Agent - Parallel workers with IPC permission bubbling
- π₯οΈ Terminal UI - Rich ratatui-based interactive interface
- β‘ High Performance - Native speed with Rust's zero-cost abstractions
# Clone the repository
git clone https://github.com/laynepenney/codi-rs.git
cd codi-rs
# Build
cargo build --release
# Run
cargo rungit clone https://github.com/laynepenney/codi-rs.git
cd codi-rs
cargo install --path .- Rust 1.85 or later
- At least one AI provider API key (Anthropic, OpenAI, or Ollama for local)
Set your API keys:
export ANTHROPIC_API_KEY=sk-ant-...
# or
export OPENAI_API_KEY=sk-...Or create a .codi.yaml config file:
provider: anthropic
model: claude-sonnet-4-20250514
auto_approve:
- read_file
- glob
- grep# Start interactive session
codi
# Run with specific provider
codi --provider openai --model gpt-4o
# Run with local model
codi --provider ollama --model llama3.2- ROADMAP.md - Feature roadmap and architecture
- CONTRIBUTING.md - How to contribute
- SECURITY.md - Security policies and reporting
- CHANGELOG.md - Version history
Core feature parity with the TypeScript CLI is complete. See docs/ROADMAP.md for ongoing work.
| Phase | Description | Status |
|---|---|---|
| 0 | Foundation - types, errors, config, CLI shell | β Complete |
| 1 | Tool layer - file tools, grep, glob, bash | β Complete |
| 2 | Provider layer - Anthropic, OpenAI, Ollama | β Complete |
| 3 | Agent loop - core agentic orchestration | β Complete |
| 4 | Symbol index - tree-sitter based code navigation | β Complete |
| 5 | RAG system - vector search with embeddings | β Complete |
| 6 | Terminal UI - ratatui based interface | β Complete |
| 7 | Multi-agent - IPC-based worker orchestration | β Complete |
use codi::{anthropic, openai, ollama, create_provider_from_env};
// Auto-detect from environment
let provider = create_provider_from_env()?;
// Or use specific provider
let claude = anthropic("claude-sonnet-4-20250514")?;
let gpt = openai("gpt-4o")?;
let local = ollama("llama3.2");Supported Providers:
- Anthropic - Full Claude API with streaming, tool use, vision
- OpenAI - GPT models with streaming and tool use
- Ollama - Local models, no API key required
- Any OpenAI-compatible API - Azure, Together, Groq, etc.
use codi::agent::{Agent, AgentConfig, AgentOptions};
use codi::tools::ToolRegistry;
use std::sync::Arc;
let provider = anthropic("claude-sonnet-4-20250514")?;
let registry = Arc::new(ToolRegistry::with_defaults());
let mut agent = Agent::new(AgentOptions {
provider,
tool_registry: registry,
system_prompt: Some("You are a helpful assistant.".to_string()),
config: AgentConfig::default(),
callbacks: Some(callbacks),
});
// Chat with streaming
agent.chat("Hello!", |chunk| {
print!("{}", chunk);
}).await?;Built-in tools include:
read_file- Read file contentswrite_file- Write or overwrite filesedit_file- Edit files with search/replaceglob- Find files by patterngrep- Search file contentsbash- Execute shell commandslist_directory- Browse directoriesrag_search- Semantic code searchsymbol_index- Find and navigate code symbols
Full ratatui-based interface with:
- Session management
- Streaming responses
- File browser with preview
- Command palette
- Git integration
- Diff viewer
# Run tests
cargo test
# Run benchmarks
cargo bench
# Build for production
cargo build --release
# Run linter
cargo clippy
# Format code
cargo fmtSee CONTRIBUTING.md for detailed contribution guidelines.
Codi is dual-licensed under:
- AGPL-3.0 - Open source license (see LICENSE)
- Commercial License - For proprietary use (see LICENSING.md)
For security issues, please email security@layne.pro instead of using the issue tracker.
See SECURITY.md for more details.
- GitHub Issues: https://github.com/laynepenney/codi-rs/issues
- Discussions: https://github.com/laynepenney/codi-rs/discussions
Built with β€οΈ and π¦ in Rust