# AI Coding Agents in 2026: The Open-Source & CLI Edition

> Cursor and Windsurf vs the open-source agents — Cline, Aider, Codex CLI, Roo Code, and more. Who should bring their own model, and when to stay in the terminal.

The open-source and CLI coding agents trade polish for control: bring your own model (or run one locally), keep your code on your terms, and script the agent into CI. Cline and Roo Code live in VS Code; Aider and Codex CLI live in the terminal; Cursor and Windsurf are the proprietary editors you'd give up for them. Choose by where you work and how much you value model and data control.

The proprietary AI editors — [Cursor](/tools/cursor), [Windsurf](/tools/windsurf), [GitHub Copilot](/tools/github-copilot) — are the most polished way to get AI into your day. But a large and fast-growing tier of **open-source and CLI agents** wins on a different axis: **control.** You bring your own model (or run one locally), your code goes only where you choose, and you can script the agent into CI. This guide compares that tier and helps you decide when it's the right call. For the proprietary editors head-to-head, see [Cursor vs Claude Code vs Copilot vs Windsurf](/guides/prompting/cursor-vs-claude-code-vs-copilot-vs-windsurf-2026).

## Why pick an open-source / CLI agent

- **Bring your own model (BYO).** Point the agent at Anthropic, OpenAI, Google, OpenRouter, AWS Bedrock, or a local runtime. You're not locked to one provider's models or roadmap.
- **Data control.** Your source is sent only to the provider you configure — or never leaves your machine if you run a local model.
- **Cost on your terms.** Pay a provider per token, lean on a free tier, or run locally for no per-token cost.
- **Scriptable.** Terminal agents run headlessly, so the same agent that helps you interactively can run in CI or a batch job.
- **No lock-in.** Open licenses (most are Apache-2.0 or MIT) and MCP support mean your tools and workflows are portable.

The cost is polish: you won't get the same seamless tab-completion and onboarding as Cursor, and you'll do more configuration.

## The field, by form factor

### In your editor (VS Code extensions)

- **[Cline](/tools/cline)** — an open-source autonomous agent that runs as a VS Code extension. It plans, edits files, and runs commands with **human-in-the-loop approvals** on every change, is fully **BYO-model** (including local via Ollama/LM Studio), supports **MCP**, and shows edits as diffs. Also available for JetBrains and as a CLI.
- **[Roo Code](/tools/roo-code)** — an open-source VS Code agent (originally a Cline fork) built around **customizable modes** (code, architect, ask, debug), each with its own behavior and tools. Same BYO-model, MCP-friendly philosophy, with more knobs for tailoring the agent's role.
- **[Continue](/tools/continue)** — an open-source assistant for VS Code and JetBrains focused on **composable** autocomplete and chat with deep customization. It leans more "building block you configure" than "hands-off agent," which is exactly what some teams want.

### In your terminal (CLI agents)

- **[Aider](/tools/aider)** — a terminal pair-programmer that's **git-native**: it edits files on disk and **commits each change** with a descriptive message, so every step is reviewable and `git revert`-able. It builds a repo map for context and is **model-agnostic**.
- **[Codex CLI](/tools/codex-cli)** — OpenAI's open-source, Rust-based terminal agent with a **two-layer security model** (sandbox modes plus approval policies). It defaults to workspace-scoped writes and no network, supports **model switching** and **MCP**, and has a headless `codex exec` for CI. Unlike Aider, it **doesn't auto-commit** — it leaves staging to you.
- **[Gemini CLI](/tools/gemini-cli)** — Google's open-source terminal agent, notable for a **generous free tier**, large context windows, and MCP support.
- **[Goose](/tools/goose)** — an open-source, extensible agent that runs **locally** (CLI and desktop), BYO-model and MCP-first, aimed at developers who want an on-machine autonomous agent.

## How to choose

- **You live in VS Code and want approvals on every step** → **Cline** (or **Roo Code** if you want role-based modes).
- **You live in the terminal and want git as the safety net** → **Aider**. Auto-commits make every step reversible.
- **You live in the terminal and want sandboxed execution + model switching** → **Codex CLI**. Strong guardrails, headless mode for CI.
- **You want the lowest cost to start** → **Gemini CLI** (free tier) or any BYO agent pointed at a **local model** via Ollama/LM Studio.
- **You want a configurable assistant, not a hands-off agent** → **Continue**.
- **You want a local-first, extensible agent** → **Goose**.

### When the proprietary editors still win

If you value a frictionless inner loop — best-in-class tab completion, zero configuration, polished multi-file review — **Cursor** and **Windsurf** are still the smoother experience, at the cost of model/data control and a paid plan. And if you want a deeply agentic, programmable workflow but don't want to manage model keys and configuration yourself, [Claude Code](/tools/claude-code) sits between the two worlds: a first-party terminal agent with MCP, subagents, and hooks.

> [!TIP]
> The choice isn't permanent. Because nearly all of these speak **MCP**, the custom tools and data sources you build for one agent move to the next. Invest in your MCP servers and `AGENTS.md`/`CLAUDE.md` context, and switching agents becomes cheap.

> [!NOTE]
> "Open source" refers to the agent, not the model. You still need a model behind it — a hosted API key, a free tier, or a local model you run yourself.

New to running a model locally or wiring up your own keys? The MCP and configuration guides in the [Guides](/guides) section cover the setup these agents share.

---

_Source: https://agentscamp.com/guides/prompting/ai-coding-agents-cli-2026 — Guide on AgentsCamp._
