AI agents
aidev supports multiple AI agents with automatic fallback. The first available agent in the list is used; if it fails, the next one is tried with the previous agent's output as additional context.
aideraider CLI + an LLM API key (OpenAI, Anthropic, etc.)
antigravityGoogle Antigravity CLI (agy or antigravity) in PATH
anthropic-sdkANTHROPIC_API_KEY — runs Claude in-process via the Agent SDK
claudeClaude CLI installed and authenticated
codexOpenAI Codex CLI installed and authenticated
cursorCursor Agent CLI (agent) in PATH
devinDevin CLI installed and authenticated
opencodeOpenCode CLI (npm install -g opencode-ai)
Supported agents
| Agent | Requires |
|---|---|
aider | aider installed with an LLM API key set |
antigravity | Google Antigravity CLI (agy or antigravity) in PATH |
anthropic-sdk | ANTHROPIC_API_KEY set; drives Claude in-process via the Anthropic Agent SDK |
claude | Claude CLI installed and authenticated |
codex | OpenAI Codex CLI installed and authenticated |
cursor | Cursor Agent CLI (agent) in PATH |
devin | Devin CLI installed and authenticated |
opencode | OpenCode CLI installed (npm install -g opencode-ai) |
Claude CLI
The claude agent shells out to the Claude CLI. Install it and authenticate (claude login or set credentials via your environment).
aidev runs:
claude -p "<prompt>" --dangerously-skip-permissions --model <model>If the chosen model is unavailable on your plan, aidev retries with the CLI default and then --model auto.
Environment variables
| Variable | Default | Description |
|---|---|---|
CLAUDE_MODEL | opusplan | Model passed to claude --model. opusplan routes planning to opus and coding to sonnet, saving tokens vs. running opus end-to-end. |
# .env.aidev
AGENTS=claude,cursor
CLAUDE_MODEL=opusplanCursor
The cursor agent uses the Cursor Agent CLI (agent binary) — not the Cursor IDE (cursor.exe). aidev passes the prompt on stdin and runs headless with auto-approval flags.
agent --print --force --trust --workspace <cwd> --model autoWindows: Cursor Agent CLI
On Windows, the Cursor IDE (cursor.exe) is separate from the headless Agent CLI. Install it in PowerShell:
irm 'https://cursor.com/install?win32=true' | iexThen ensure agent is on your PATH and run agent --version to confirm.
Environment variables
Cursor has no aidev-specific env vars. Authentication and model selection are handled by the agent CLI itself.
AGENTS=cursorAnthropic SDK
The anthropic-sdk agent runs Claude in-process via @anthropic-ai/claude-agent-sdk instead of shelling out to the claude CLI. The SDK package must be installed in the project (it ships as a dependency of aidev).
Because the SDK uses the claude_code system prompt preset with cwd set to the project root, it automatically picks up .claude/skills, .claude/commands, and .claude/agents from the repo.
Environment variables
| Variable | Default | Description |
|---|---|---|
ANTHROPIC_API_KEY | — | Single key or comma-separated pool; the runner rotates round-robin across run() calls and retries |
ANTHROPIC_BASE_URL | — | Optional API base URL override |
ANTHROPIC_MODEL | claude-opus-4-6 | Model id passed to the SDK |
ANTHROPIC_SDK_MAX_RETRIES | 3 | Retries after transient SDK errors (connection drops, mid-stream failures). Set to 0 to disable. |
AGENTS=anthropic-sdk
ANTHROPIC_API_KEY=sk-ant-key-1,sk-ant-key-2
ANTHROPIC_MODEL=claude-opus-4-6
ANTHROPIC_SDK_MAX_RETRIES=3ANTHROPIC_MODEL is separate from CLAUDE_MODEL so the SDK runner and Claude CLI runner can target different models.
Aider
aider is an open-source AI pair programming tool that connects to many LLMs. Install it and set an API key for your preferred model:
pip install aider-install
aider-install
export ANTHROPIC_API_KEY=sk-ant-...
# or
export OPENAI_API_KEY=sk-...aidev runs:
aider --message "<prompt>" --yes-always <extra-args>Aider inherits ANTHROPIC_API_KEY and OPENAI_API_KEY from the environment automatically.
Environment variables
| Variable | Default | Description |
|---|---|---|
AIDER_ARGS | — | Extra CLI flags passed to aider (space-separated) |
AGENTS=aider,claude
AIDER_ARGS=--model gpt-4o --no-auto-commits
AIDER_ARGS=--model claude-sonnet-4-6 --no-auto-commitsCodex
The codex agent uses the OpenAI Codex CLI in non-interactive mode.
npm install -g @openai/codex
codex login # or set OPENAI_API_KEYaidev runs:
codex exec --ask-for-approval never --sandbox workspace-write --cd <cwd> "<prompt>"Environment variables
Codex has no aidev-specific env vars. Set OPENAI_API_KEY or authenticate via codex login.
AGENTS=codexOpenCode
The opencode agent uses the OpenCode CLI for non-interactive agent runs.
npm install -g opencode-aiaidev runs:
opencode run --dangerously-skip-permissions --dir <cwd> [--model <model>] "<prompt>"Environment variables
| Variable | Default | Description |
|---|---|---|
OPENCODE_CONFIG_DIR | — | Custom config directory for agents, commands, modes, and plugins |
OPENCODE_MODEL | — | Model in provider/model format (e.g. anthropic/claude-sonnet-4-6) |
AGENTS=opencode
OPENCODE_CONFIG_DIR=/path/to/my/config-directory
OPENCODE_MODEL=anthropic/claude-sonnet-4-6Devin
The devin agent uses the Devin CLI in single-turn print mode. Install and authenticate per Devin's docs.
aidev writes the prompt to a temp file (to avoid command-line length limits) and runs:
devin -p --permission-mode bypass --prompt-file <tmpfile>Environment variables
Devin has no aidev-specific env vars. Authentication is handled by the devin CLI.
AGENTS=devinAntigravity
The antigravity agent uses Google's Antigravity CLI (agy or antigravity on some installs). aidev passes the prompt on stdin and opens the current workspace.
agy --agent --print .Environment variables
Antigravity has no aidev-specific env vars.
AGENTS=antigravity,claudeConfigure agent order
# Claude first, fall back to Cursor
AGENTS=claude,cursor
# Cursor only
AGENTS=cursor
# Aider first, fall back to Claude CLI
AGENTS=aider,claude
# Antigravity first, then Claude
AGENTS=antigravity,claude
# In-process SDK with CLI fallback
AGENTS=anthropic-sdk,claude,cursorSee also Behaviour configuration for the AGENTS variable reference.