Skip to content

synapt-dev/codi-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

codi-rs

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.

Features

  • πŸ€– 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

Quick Start

# Clone the repository
git clone https://github.com/laynepenney/codi-rs.git
cd codi-rs

# Build
cargo build --release

# Run
cargo run

Installation

From Source

git clone https://github.com/laynepenney/codi-rs.git
cd codi-rs
cargo install --path .

Prerequisites

  • Rust 1.85 or later
  • At least one AI provider API key (Anthropic, OpenAI, or Ollama for local)

Configuration

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

Usage

# Start interactive session
codi

# Run with specific provider
codi --provider openai --model gpt-4o

# Run with local model
codi --provider ollama --model llama3.2

Documentation

Status

Core feature parity with the TypeScript CLI is complete. See docs/ROADMAP.md for ongoing work.

Completed Phases

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

Features

Providers

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.

Agent Loop

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?;

Tools

Built-in tools include:

  • read_file - Read file contents
  • write_file - Write or overwrite files
  • edit_file - Edit files with search/replace
  • glob - Find files by pattern
  • grep - Search file contents
  • bash - Execute shell commands
  • list_directory - Browse directories
  • rag_search - Semantic code search
  • symbol_index - Find and navigate code symbols

Terminal UI

Full ratatui-based interface with:

  • Session management
  • Streaming responses
  • File browser with preview
  • Command palette
  • Git integration
  • Diff viewer

Development

# Run tests
cargo test

# Run benchmarks
cargo bench

# Build for production
cargo build --release

# Run linter
cargo clippy

# Format code
cargo fmt

See CONTRIBUTING.md for detailed contribution guidelines.

License

Codi is dual-licensed under:

  • AGPL-3.0 - Open source license (see LICENSE)
  • Commercial License - For proprietary use (see LICENSING.md)

Security

For security issues, please email security@layne.pro instead of using the issue tracker.

See SECURITY.md for more details.

Community


Built with ❀️ and πŸ¦€ in Rust

About

Rust implementation of Codi - AI coding assistant with TUI, multi-agent orchestration, and RAG

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages