A terminal-native AI coding assistant built in Rust. Codiv replaces your shell with one that runs commands instantly and handles complex AI tasks in the same interface.
- Dual-mode interface — AI mode for natural language queries, Command mode for direct shell execution, toggled with Tab
- AI-first — starts in AI mode by default; the agent reasons, calls tools, and streams responses
- Multi-model — supports Anthropic, OpenAI, and Google providers via aisdk, with plans for per-role model assignment
- Native tools as subcommands — built-in tools (read, write, edit, glob, grep, bash) are accessible both to the agent in-process and to users from the CLI
codiv (TUI client) codivd (daemon)
┌────────────────┐ ┌──────────────────────┐
│ ratatui + pty │◄─IPC────►│ tokio + aisdk │
│ command index │ bincode │ agent + tool loop │
│ tab completion │ over │ session management │
│ markdown render│ unix │ worker bash sessions │
└────────────────┘ socket └──────────────────────┘
│
┌─────────┴─────────┐
│ codiv-tools │
│ (shared lib crate) │
└───────────────────┘
| Crate | Purpose |
|---|---|
codiv |
TUI client — terminal rendering, bash co-process, dual-mode input, tab completion |
codivd |
Async daemon — AI agent, session management, LLM streaming, tool execution |
codiv-tools |
Shared library — tool implementations (bash, read, write, edit, glob, grep) and agent guides |
codiv-common |
Shared types — IPC messages, config, utilities |
curl -fsSL https://codiv.ai/install.sh | bashThis downloads the latest release, installs codiv and codivd to ~/.local/bin/, and starts the daemon as a system service (launchd on macOS, systemd on Linux).
To install a specific version:
curl -fsSL https://codiv.ai/install.sh | bash -s -- v0.1.0brew tap razorback16/codiv https://github.com/razorback16/codiv.git
brew install codiv
brew services start codivThis installs both codiv and codivd and optionally runs the daemon via brew services.
cargo install --git https://github.com/razorback16/codiv.git codiv
cargo install --git https://github.com/razorback16/codiv.git codivdRequires the Rust toolchain — install via rustup.
git clone https://github.com/razorback16/codiv.git
cd codiv
cargo build --workspace --release
ln -sf "$(pwd)/target/release/codiv" ~/.local/bin/codiv
ln -sf "$(pwd)/target/release/codivd" ~/.local/bin/codivd- An API key for at least one LLM provider (Anthropic, OpenAI, or Google)
# Launch the TUI (default — replaces your shell)
codiv
# Use tools directly from the CLI
codiv read --path ./src/main.rs
codiv grep --pattern "fn main" --path ./src
codiv bash --command "cargo test"
codiv glob --pattern "**/*.rs"
# JSON mode for programmatic use
echo '{"file_path":"./Cargo.toml"}' | codiv read --json-in --json-out
# Tool metadata
codiv read --help
codiv read --agent-guide# Logs to /tmp/codiv-debug.log
codiv --debug
codiv --debug=traceEach built-in tool is available as a codiv subcommand with these common flags:
| Flag | Purpose |
|---|---|
--json-in |
Read JSON input from stdin |
--json-out |
Output result as JSON ({"result": ..., "error": ...}) |
--agent-guide |
Print agent usage guide |
--help |
Print help |
| Command | Description |
|---|---|
codiv read --path <file> [--offset N] [--limit N] |
Read file contents with numbered lines |
codiv write --path <file> --content <text> |
Write content to a file |
codiv edit --path <file> --old-string <old> --new-string <new> |
Find and replace a unique string |
codiv glob --pattern <glob> [--path <dir>] |
Find files matching a pattern |
codiv grep --pattern <regex> [--path <dir>] [--include <glob>] |
Search file contents with regex |
codiv bash --command <cmd> [--timeout <ms>] |
Execute a shell command |
Working terminal client with daemon IPC, dual-mode input, and zero-overhead shell experience.
- Ratatui TUI with persistent bash co-process (portable-pty)
- Command index: PATH scanning + bash/zsh builtins in O(1) hash map
- Dual-mode input: AI mode (default) and Command mode with Tab toggle
- 3-tier tab completion: programmable bash-completion, command, file
- Interactive passthrough for full-screen programs (vim, ssh, python REPL)
- Serde+bincode IPC over Unix domain socket with heartbeat
- Env snapshot protocol and worker bash sessions
AI mode input goes to an agent that reasons and uses tools.
- aisdk integration with streaming LLM access (Anthropic, OpenAI, Google)
- Unified session timeline (shell commands + queries + responses)
- Real-time CommandResult IPC
- Streamdown markdown rendering with syntax highlighting
- Terminal colorscheme detection
- Native tools extracted to shared crate with CLI subcommands
- Tool calling loop (agent reasons, calls tools, continues)
- Risk classification + confirmation prompts for destructive commands
- Env snapshot refresh on
cdandsource - TOML config for API keys and model selection (with hot-reload)
Complex tasks decompose into a dependency graph of Work Items executed concurrently.
- Work Item schema with state machine (pending → running → completed/failed)
- DAG construction from agent planning
- Tokio-based concurrent execution with dependency tracking
- Artifact storage and token/cost budget enforcement
Specialized agent roles with different models assigned per role.
- Roles: Orchestrator, TeamLead, Engineer, Reviewer, Narrator
- Model catalog with per-role assignment (frontier for planning, cheap for memory curation)
- TeamLead dynamic model selection per Work Item
- Reviewer gating on outputs
- Single-writer ownership for concurrent file access
Persistent bounded memory across sessions with project auto-switching.
- SQLite episodic store with configurable retention
- Semantic markdown files (user.md, project.md, topics/)
- Narrator agent for memory consolidation
- Project fingerprint detection and auto-context switching
Unified tool registry — binary tools, MCP bridge, prompt tools, hooks, aliases.
CODIV_TOOLS_PATHdiscovery and progressive loading (Tier 0-3)- MCP bridge (CLI ↔ MCP protocol translation)
- Prompt tool runtime with skill import
- Hooks and aliases in config
Production-grade safety controls and compliance.
- Full audit trail (JSON lines with timestamps, agent roles, model IDs)
- Privacy settings (redact env vars, exclude output from LLM context)
- OS-level sandboxing roadmap (bubblewrap on Linux, seatbelt on macOS)
- Error handling: daemon crash recovery, LLM timeout backoff, IPC reconnection
make build # cargo build --workspace
make test # cargo test --workspace
make release # cargo build --workspace --release
make clean # cargo cleanThis project is licensed under the GNU General Public License v3.0.