Skip to content

talocode/codra

Repository files navigation

Codra Logo

Codra

Open-source, local-first AI coding agent.


Codra is an open-source, local-first AI coding agent built for real software engineering. It helps developers plan, edit, execute, verify, and repair code changes inside their own projects while keeping humans in control.

Install

# Terminal agent (recommended)
npm install -g @talocode/codra-code

# Rust CLI wrapper
npm install -g @talocode/codra

Quick Start

# Test mode (no API key)
codra-code --mock

# Local-first with Ollama
export CODRA_PROVIDER=ollama
export CODRA_MODEL=llama3.1
codra-code start

# With Tera API
codra-code login
codra-code start

# OpenAI-compatible
export CODRA_PROVIDER=openai
export CODRA_API_KEY=your-key
codra-code start

Features

  • Tool-call agent loop — LLM calls tools, observes results, repeats until done
  • Search & replace editing — Exact and regex file patching
  • Auto-compaction — Manages context window at 85% usage
  • Streaming responses — Token-by-token output
  • Per-file locking — Prevents concurrent write conflicts
  • Hook system — Pre/post tool use events
  • Subagent spawning — General-purpose, explore, and plan agents
  • Git workflow — Branch, commit, status tools
  • Session persistence — Conversation history saved locally
  • MCP server support — Connect extended tool servers
  • Skills system — Activate skills that influence agent behavior
  • Tera API integration — First-class support for Tera AI
  • Command sandboxing — Blocked patterns and allowlist
  • History repair — Auto-fix corrupted conversation logs
  • Cost tracking — Token and cost accounting per turn

Providers

Provider Setup
Tera codra-code login
Ollama export CODRA_PROVIDER=ollama
OpenAI export CODRA_PROVIDER=openai + CODRA_API_KEY
OpenAI-compatible export CODRA_BASE_URL + CODRA_API_KEY
Mock codra-code --mock

Architecture

  • Desktop Shell — Tauri 2 (Rust + React)
  • Core Runtimecodra-core (agent loop, tools, state machine)
  • Toolingcodra-tools (fs, git, terminal, search)
  • Browsercodra-browser (CDP-based local browser control)
  • CLIcodra-cli (Rust) + codra-code (Node.js)
  • Daemon — Local HTTP/SSE API server
  • Protocol — Shared Rust/TypeScript types

Development

pnpm install
pnpm dev          # Vite + Tauri dev
cargo check       # Rust checks
cargo test        # Rust tests

Ecosystem

Package Description
@talocode/codra-code Terminal coding agent
@talocode/codra Rust CLI wrapper
codra-desktop Tauri desktop app
codra-daemon Local API server
codra-deploy Deployment layer

Security

  • Code stays on your machine by default
  • Agent actions require approval for destructive operations
  • Secrets never exposed in prompts or logs
  • All file operations and browser sessions run locally

License

Apache-2.0

Contact

Built by Talocode — talocodehq@gmail.com

Sponsor