Skip to content

Repository files navigation

Agent Code

Agent Code

Open-source AI coding agent for the terminal.
Fullscreen TUI, multi-provider, headless & ACP — written in Rust.
Avala AI

crates.ioCIMIT LicenseCoverage

Install · Quickstart · Ways to run · Documentation · Configuration · Layout · Development · License


Agent Code understands your repo, edits files, runs shell commands, searches the web, and drives multi-step engineering work — interactively in a fullscreen TUI, headlessly in scripts and CI, or embedded in editors via the Agent Client Protocol (ACP).

It is MIT licensed, multi-provider by default, and does not send telemetry home unless you opt in.

Install

Prebuilt binaries for macOS, Linux, and Windows:

curl -fsSL https://raw.githubusercontent.com/avala-ai/agent-code/main/install.sh | bash
agent --version

Other options:

MethodCommand
Cargocargo install agent-code
Homebrewbrew install avala-ai/tap/agent-code
Dockerdocker run --rm -it ghcr.io/avala-ai/agent-code
From sourcecargo build --release -p agent-codetarget/release/agent

See Installation for platform notes and data directories.

Quickstart

# Interactive TUI (default) — setup wizard on first launch
agent
# One-shot (headless)
agent -p "fix the failing tests and summarize what changed"# Pick a model / provider
agent --model claude-sonnet-5
agent --model gpt-5.5 --provider openai

Authentication — set a provider API key, or sign in with a subscription:

export ANTHROPIC_API_KEY=… # or OPENAI_API_KEY, XAI_API_KEY, …# or
agent login codex # ChatGPT / Codex subscription
agent login xai # SuperGrok / X Premium (device / OAuth)

In the TUI: type a task and press Enter. Shift+Tab cycles permission modes. Ctrl+C cancels a running turn; Esc never cancels (clears draft / dismisses modals). Full bindings: Keyboard shortcuts.

Ways to run

ModeHowUse when
Interactive TUIagentDaily coding — transcript, modals, queue, tasks pane
Headlessagent -p "…"Scripts, CI, piping
HTTP APIagent --serveLocal clients / Flutter GUI
ACPagent acpIDE integrations (stdio JSON-RPC)
Security scanagent security-scanWhole-repo vulnerability MapReduce

LLM providers

Works with any major API — set one env var and go:

ProviderEnvNotes
AnthropicANTHROPIC_API_KEYClaude models
OpenAIOPENAI_API_KEYGPT / o-series
Azure OpenAIAzure endpoint + key
xAIXAI_API_KEYGrok models
GoogleGOOGLE_API_KEYGemini
DeepSeek, Groq, Mistral, Together, Zhipu, Cohere, Perplexityrespective *_API_KEY
OpenRouterOPENROUTER_API_KEYMulti-model router
Bedrock / VertexAGENT_CODE_USE_BEDROCK / AGENT_CODE_USE_VERTEXCloud Claude
Ollama / local--api-base-url http://localhost:11434/v1OpenAI-compatible

Subscription logins reuse existing sessions when present (~/.codex/auth.json, ~/.grok/auth.json). Details: Authentication.

What you get

  • Fullscreen modern TUI — streaming transcript, permission / plan / question modals, prompt queue, mode badge, tasks pane (TUI docs)
  • 30+ tools — files, search, shell, apply_patch, worktrees, web, LSP, MCP, subagents, monitors, cron, notebooks, …
  • Skills & plugins — reusable workflows (/commit, /review, /plan, …) plus project skills under .agent/skills/
  • Permissions & sandbox — ask / allow / plan / accept_edits, protected dirs, destructive-command guards, optional OS sandbox
  • Sessions — persist, resume, fork, rewind, compact
  • Security-scan — Agentic MapReduce over whole repos (guide)
  • No default telemetry — outbound traffic is the LLM you configure (and MCP servers you add)

Documentation

Start here
User guide indexTiered guide: essentials → features → advanced
QuickstartFirst hour walkthrough
Keyboard shortcutsModern TUI bindings
Slash commandsFull /command list
Configurationconfig.toml, env, flags
SecurityPermissions model & invariants

Online / Mintlify site config: docs/docs.json. Architecture notes: ARCHITECTURE.md.

Configuration

# ~/.config/agent-code/config.toml
[api]
model = "claude-sonnet-5"
[permissions]
default_mode = "ask"# ask | allow | deny | accept_edits | plan
[ui]
theme = "midnight"
[security]
disable_bypass_permissions = true# enterprise: lock YOLO flags

Precedence: CLI flags → environment → project config → user config → defaults.

Repository layout

crates/
lib/ agent-code-lib Engine: providers, tools, query loop, memory, permissions
cli/ agent Binary: TUI, slash commands, ACP, --serve
eval/ agent-code-eval Behavioral evaluation harness
client/ Flutter desktop/web GUI (talks to --serve)
packages/ TypeScript / Dart client packages
docs/ User guides (Mintlify + mdBook sources)
evals/ Eval fixtures

The engine is an embeddable library; the CLI is a thin product surface on top.

Development

Requirements: Rust (see rust-toolchain.toml if present; otherwise recent stable), and for full tool use: git, rg.

git clone https://github.com/avala-ai/agent-code.git
cd agent-code
cargo check --all-targets
cargo test --all-targets
cargo clippy --all-targets -- -D warnings
cargo fmt --all -- --check
cargo run -p agent-code -- # launch TUI
cargo run -p agent-code -- -p "say hi"# headless smoke

See CONTRIBUTING.md, AGENTS.md (agent instructions for this repo), RELEASING.md, and ROADMAP.md.

Security

  • Writes to .git/, .husky/, and node_modules/ are unconditionally blocked
  • Destructive shell patterns warn / block; system paths are protected
  • Plan mode is read-only (except the plan surface)
  • --dangerously-skip-permissions can be globally disabled via config

Details: SECURITY.md and Permissions.

Platforms

PlatformArchInstall
Linuxx86_64, aarch64curl, cargo, brew, binary, Docker
macOSx86_64, Apple Siliconcurl, cargo, brew, binary
Windowsx86_64cargo, binary (.zip)

License

MIT — © Avala AI.

About

An AI-powered coding agent for the terminal, written in pure Rust

Topics

Resources

Contributing

Security policy

Stars

23 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages