AI pair programming in your terminal — modular core (snippet tools, bounded agent loop, permissions)
pip install coderai-agent==0.5.1 Copy PIP instructions
Autonomous AI Pair Programming & Multi-Agent Swarm in Your Terminal
Overview • Benchmarks • Quickstart • Interactive CLI • Agent Roles & Swarms • Core Tools • Security • Configuration • Development • License
CoderAI is an autonomous terminal AI software engineering platform, agentic execution engine, and multi-agent swarm designed for high reliability, deterministic tool execution, token efficiency, and developer velocity. It couples a session runtime (coderai.soul.session.manager), a terminal interface (coderai.ui.shell), and a hybrid Kahneman System 1 (Jev / TypeSafe) + System 2 (CoderAI Deep Review) compound reasoning harness for ultra-fast, high-precision code review.
See Runtime architecture for execution boundaries and Verification for the shared checks and release gates.
CoderAI was independently evaluated on the Martian Code Review Benchmark across 50 real-world pull requests across 5 production enterprise repositories (cal.com, keycloak, grafana, sentry, discourse), competing against 30 leading commercial and open-source AI code review tools.
CoderAI placed Rank 5 in the World, achieving top-tier precision and balanced recall while outperforming general-purpose generative models and established commercial review bots:
# Clone the repository git clone https://github.com/adityaanilraut/CoderAI.git cd CoderAI # Install in editable mode pip install -e . # Verify installation coderai --version # or using shorthand alias cai --version Install with Development Dependencies .venv/bin/python -m pip install -e ".[dev,jev]" -e sdks/coderai-sdk Quickstart 1. Configure Providers, API Keys & Models (Interactive Setup) You can run the interactive setup wizard directly from the command line or from within CoderAI:
# Interactive setup wizard coderai setup # Or configure non-interactively coderai setup --provider deepseek --key sk-... --setup-model deepseek-v4-pro coderai setup --provider gemini --key AIzaSy... --setup-model gemini-3.7-flash coderai setup --base-url http://localhost:11434/v1 --setup-model qwen2.5-coder:32b --provider ollama # Test active provider connectivity coderai setup --test # View configured keys & endpoints status table coderai setup --status Alternatively, you can export environment variables in your shell or .env file:
export OPENAI_API_KEY="sk-..." export DEEPSEEK_API_KEY="sk-..." export GEMINI_API_KEY="AIzaSy..." export ANTHROPIC_API_KEY="sk-ant-..." 2. Launch Interactive REPL coderai # or cai Inside the REPL, you can type /setup at any time to add or update API keys, switch default models, or configure local LLM endpoints.
coderai --plan 4. Run a One-Shot Task coderai "Refactor auth middleware to support JWT refresh tokens" One-shot prompts default to the core tool preset. Use --preset to select one of:
coderai --yes "Run unit tests and fix any failing assertions in tests/test_core.py" 6. Launch with Specialized Agent Roles # Launch interactive session with a specific role coderai --agent architect coderai --agent tdd-guide # Launch with custom role specification file coderai --agent-file .coderai/agents/code-reviewer.md Interactive CLI & Slash Commands When running coderai, you enter an interactive REPL featuring an ASCII banner, real-time token status bar, thinking block display, live diff rendering, and command autocompletion.
CoderAI includes full readline and fuzzy autocompletion:
Mention workspace files directly anywhere in your prompts:
coderai> Explain the architecture in @coderai/soul/session/manager.py and how it connects to @coderai/soul/approval.py CoderAI automatically detects referenced files and attaches their contents to the prompt context. Specific line ranges can also be targeted with @file.py:10-30 or @file.py:L25.
CoderAI supports dynamic discovery of specialized markdown agent specifications (.coderai/agents/*.md, .agents/agents/*.md, ~/.agents/agents/*.md), as well as decentralized multi-agent swarms:
CoderAI incorporates a hybrid Kahneman System 1 + System 2 compound review harness (coderai/triage/, coderai/jev/). While generative autoregressive models (System 2) excel at deep syntactic, semantic, and concurrency reasoning, they suffer from verbosity and uncalibrated confidence—frequently hallucinating speculative warnings or pedantic nitpicks that cause developer fatigue.
To resolve this, CoderAI pairs System 2 with Jev (jev-system-one via TypeSafe), a specialized non-autoregressive System 1 model providing sub-second diff screening and calibrated probability gating:
┌─────────────────────────────────────────────────────────────────────────────┐ │ Tier 1: System 1 Diff Triage (Jev screen_diff_hunk) │ │ • Sub-100ms screening of git diff hunks │ │ • Bypasses inert files (lockfiles, assets, build metadata) │ │ • Flags high-risk hunks and concentrates System 2 attention │ ├─────────────────────────────────────────────────────────────────────────────┤ │ Tier 2: System 2 Deep Reasoning Review (CoderAI + Frontier LLM) │ │ • Multi-file AST, semantic, and concurrency analysis │ │ • Catches API contract violations, dead allocations, and race conditions │ │ • Drafts concrete findings with file/line references and failure mechanisms│ ├─────────────────────────────────────────────────────────────────────────────┤ │ Tier 3: Pre-Flight Precision Gate (Jev gate_candidate_comment) │ │ • Non-autoregressive calibrated confidence verification │ │ • Questions: is_actionable_bug, is_speculative_or_nit, will_developer_accept│ │ • Blocks ungrounded hallucinations, hypothetical edge cases, and noise │ │ • Delivers a +13% Precision lift (58.2% Precision vs 30-35% for peer bots) │ └─────────────────────────────────────────────────────────────────────────────┘ Core Capabilities & Implementation Details: Non-Autoregressive Fast Inference: Single-shot system_one(state, questions) execution without streaming or tool overhead for instantaneous code triage (~0.5s). Calibrated Tunables: Configurable via environment variables or settings: CODERAI_JEV_GATE_THRESHOLD (default 0.40–0.50): Minimum is_actionable_bug probability required for approval. CODERAI_JEV_SPECULATIVE_THRESHOLD (default 0.65): Maximum ceiling for speculative/nit warnings before rejection. CODERAI_JEV_ACCEPT_THRESHOLD (default 0.50): Minimum predicted senior developer acceptance probability. Fail-Safe Fallback: Guaranteed graceful degradation to standard System 2 execution upon timeout or network latency. LRU In-Memory Caching: Bounded thread-safe caching (CODERAI_JEV_CACHE_SIZE) with hit/miss telemetry and hash-keyed lookups. Setup: pip install 'coderai-agent[jev]' and set TYPESAFE_API_KEY (env, .env, or /setup). Without either, /review operates in standalone System 2 mode. Data egress & Security: When Jev is active, /review sends each changed file's diff (up to CODERAI_JEV_MAX_DIFF_CHARS) and each drafted comment to the TypeSafe API, separately from your chat model provider. Secret-looking paths (.env*, *.pem, *.key, *credential*, *secret*, SSH keys) are never sent; they are always reviewed and their comments always shown. Read more in docs/jev-system-one.md. Core Tools CoderAI provides a rich, versatile tool surface:
CoderAI follows a defense-in-depth, fail-closed security model.
Settings are resolved in order of precedence: CLI arguments > Environment variables > Project config (.coderai/settings.json) > User config (~/.coderai/settings.json).
{ "model": "gpt-6-luna", "temperature": 0.2, "thinkingEnabled": true, "reasoningEffort": "max", "toolsPreset": "core", "permissions": { "preset": "workspace-write", "allow": ["read-in-cwd", "query-git-log"], "ask": [ "write-in-cwd", "write-out-cwd", "delete-in-cwd", "mutate-git-log", "network", "mcp" ], "deny": ["delete-out-cwd"] }, "mcpServers": { "sqlite": { "command": "uvx", "args": ["mcp-server-sqlite", "--db-path", "./app.db"] }, "remote-docs": { "url": "https://mcp.example.com/sse", "transport": "sse", "headers": { "Authorization": "Bearer token" } } } } Environment Variables Variable Description OPENAI_API_KEY / CODERAI_API_KEY LLM provider API key OPENAI_BASE_URL / CODERAI_BASE_URL API endpoint URL (OpenAI, DeepSeek, Ollama, etc.) CODERAI_MODEL Default model identifier CODERAI_TOOLS_PRESET Tool preset (full, core, shell_edit) CODERAI_PERMISSION_PRESET Permission preset (read-only, workspace-write, danger-full-access) CODERAI_THINKING_ENABLED Enable reasoning/thinking tokens (true / false) CODERAI_REASONING_EFFORT Reasoning effort (off, low, medium, high, max) CODERAI_RG_PATH Explicit ripgrep path (validated PATH executable or Python fallback otherwise) CODERAI_DEBUG_LOG_ENABLED Enable verbose engine debug logging Migration Notes Project configuration and tracked agent content now use lowercase .coderai; rename .coderAI directories before upgrading. Workspace skills use the singular filename SKILL.md; rename legacy SKILLS.md files. Use --prompt (or a positional prompt) instead of the removed --message flag. --preset, --tools-preset, and --permission are aliases for the same tool-preset slot; pass only one. Tool presets accept only full, core, or shell_edit. Settings JSON uses the documented camelCase keys (baseURL, apiKey, thinkingEnabled, reasoningEffort, and toolsPreset); environment overrides use CODERAI_*. Development # Format code make format # Run linter make lint # Run type checks make typecheck # Run main, offline SDK and wire suites (one process per file) make test # Full local/CI verification, including the resolved dependency audit make check # Run offline engine self-check .venv/bin/python scripts/self_check.py # Clean build artifacts make clean Development commands use .venv/bin/python by default. The test-suite audit documents the completed local audit and retained contracts. See the verification contract for check scopes, required Jev/SDK coverage, tool pins and audit policy.
CoderAI builds upon and adapts architectural concepts, protocol designs, and patterns from pioneering open-source agentic projects:
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.




