The best open source coding agents in 2026 are OpenCode for a model agnostic terminal agent, Cline for an agent in VS Code or JetBrains that asks before every change, Codex CLI for ChatGPT subscribers, goose for a general purpose local agent, and Aider for git centric pair programming. Gemini CLI is still open source, but Google now aims it at Code Assist business customers. All six have readable source code, edit multiple files and run commands in your project.
"Open source" here means the agent software is published under an OSI approved license. The models behind it are a separate question: most of these tools take any provider's API key, while two are built around one vendor's models. We checked each project's license, docs and releases on October 5, 2026 and again on November 19. If you are open to paid tools, our best AI coding agents roundup adds Claude Code, Cursor and GitHub Copilot, and Claude Code vs Cursor compares the two most popular paid options.
What changed since October (November 19, 2026): OpenCode's main docs now install OpenCode 2. Gemini CLI's README now says it is built for Gemini Code Assist Standard and Enterprise, and not tuned for Gemini 4 models. goose lists more than 85 providers and can load local models itself. Aider has had no commits to its main branch since May 22, 2026.
Quick comparison of open source coding agents
| Agent | License | Main interface | Models | Latest stable (Nov 19) |
|---|---|---|---|---|
| OpenCode | MIT | Terminal, desktop app, web | Any provider, incl. Ollama | 2.3.2 (Nov 18); 1.19.6 for V1 |
| Cline | Apache-2.0 | VS Code, JetBrains, CLI, desktop | Any provider, incl. local | Extension 4.1.26, CLI 3.0.74 (Oct 26) |
| Codex CLI | Apache-2.0 | Terminal, IDE, desktop app | OpenAI (ChatGPT sign in or API key) | 0.170.0 (Nov 18) |
| Gemini CLI | Apache-2.0 | Terminal | Gemini via Code Assist or paid keys | 0.70.0 (Nov 19) |
| goose | Apache-2.0 | Desktop app, CLI, ACP | 85+ providers, local models | 1.60.1 (Nov 18) |
| Aider | Apache-2.0 | Terminal | Most providers | 0.86.2 (Feb 12) |
Versions come from npm, PyPI and each project's GitHub releases.
OpenCode: best model agnostic terminal agent
OpenCode describes itself as an open source coding agent with a terminal interface, desktop app and web app. It is MIT licensed, and its GitHub repository has more than 228,000 stars.
Install: The official docs now install version 2: curl -fsSL https://opencode.ai/v2/install | bash, npm install -g @opencode/cli or brew install anomalyco/tap/opencode-v2. The old opencode.ai/install script and the opencode-ai npm package still give you version 1, and 1.19.6 (November 17) offers the upgrade inside the app.
Why pick it: You can point it at almost any provider with /connect, including Ollama, LM Studio, GitHub Copilot, ChatGPT sign in and aggregators like OpenRouter (when a managed aggregator beats a self hosted gateway is covered in LLM gateway vs OpenRouter). It supports MCP servers, Agent Skills, custom commands, permissions and plugins. For people who don't want to pick a provider, Anomaly sells Zen and OpenCode Go, a $10 a month plan for coding models. Per the changelog, 2.3.0 (November 13) runs subagents in the background by default, and 2.3.1 moves a shell command that hits its timeout to the background instead of killing it.
Watch out for: The project ships several releases a week, so tutorials go stale fast, and 2.0 replaced the plugin and server APIs. Read OpenCode 2.0: what changed before upgrading a team.
Cline: best open source agent inside your editor
Cline is the open source agent for people who want to watch and approve each step. Its docs summarize it as "Read files, write code, run commands, all with your approval." It is Apache-2.0 licensed.
Install: Search "Cline" in the VS Code extensions panel, use the JetBrains plugin, or install the CLI with npm i -g cline for terminal and headless CI use. There is also a desktop app, an SDK and Kanban (npx kanban), a board that runs parallel agents in separate worktrees.
Why pick it: Diffs show up before they are applied, which suits teams new to agents or working in sensitive code. It supports dozens of providers and local runtimes, and it also runs in Cursor, Windsurf, Antigravity, and in Zed and Neovim through ACP. Cline sells usage billed access and ClinePass, a flat $9.99 a month plan for open coding models, but bringing your own key is always an option.
Watch out for: Approving every action is slower for large refactors. You can loosen auto approval, but then you lose the main reason to choose it. The last tagged extension and CLI releases are from October 26, though commits to the repository continue daily.
Codex CLI: best open source agent from a major vendor
OpenAI Codex ships its CLI under Apache-2.0 on GitHub, so you can audit exactly what runs locally. It reads AGENTS.md natively, has a built in /review command, sandboxing and permission controls, and codex exec for scripts and CI.
Install: curl -fsSL https://chatgpt.com/codex/install.sh | sh on Mac or Linux, npm install -g @openai/codex, or brew install --cask codex. The same agent also runs as an IDE extension and, via codex app, as a desktop app.
Why pick it: If you pay for ChatGPT Plus, Pro, Business, Edu or Enterprise, signing in puts the CLI on your plan's usage, and it can hand longer tasks to Codex cloud. How far that usage goes is covered in Codex usage limits.
Watch out for: The code is open, but the agent is built for OpenAI's models and account system. Pick OpenCode or Cline if switching providers matters to you.
Gemini CLI: open source, now for Google Cloud teams
Gemini CLI is Google's Apache-2.0 terminal agent, with Google Search grounding, checkpointing and MCP support. On June 18, 2026, it stopped serving individual accounts: free users and Google AI Pro and Ultra subscribers moved to Antigravity CLI (Google's announcement). Its README now describes it as designed for Gemini Code Assist Standard and Enterprise and Code Assist for GitHub, with paid Gemini API and Vertex keys listed as legacy options.
Install: npx @google/gemini-cli to try it, or npm install -g @google/gemini-cli or brew install gemini-cli.
Why pick it: If your company already has a Code Assist license, you get an open source agent you can audit, extend with MCP servers and run in CI.
Watch out for: The README warns that it isn't tuned for the Gemini 4 series and shouldn't be used to benchmark Gemini models. Google points individuals to Antigravity CLI, whose repository still has no open source license, so it isn't on this list. Our Gemini CLI for Pro users guide covers the switch, and Claude Code vs Codex vs Gemini CLI compares the big vendor CLIs.
goose: best general purpose local agent
goose was created by Block and is now part of the Agentic AI Foundation at the Linux Foundation. It is Apache-2.0 licensed and written in Rust, with a native desktop app for macOS, Linux and Windows and a full CLI.
Why pick it: goose isn't limited to code. Its README pitches research, writing, automation and data analysis alongside software work. It connects to more than 85 providers, can load local models directly without a separate model server, and its provider docs list ACP providers that drive Claude Code or Codex under an existing subscription. Extensions connect it to MCP servers, and goose acp lets your own app use goose as its agent backend.
Watch out for: Code only agents have more coding features, such as built in review commands and git workflows.
Aider: best for git centric pair programming
Aider is the veteran of this list. It is Apache-2.0 licensed, builds a map of your repository to work in large codebases, and commits each change with a descriptive message so you can diff and undo with ordinary git. It also has a "watch" mode, where you write instructions as comments in your code.
Install: python -m pip install aider-install, then run aider-install.
Watch out for: Development has stalled. The latest PyPI release, 0.86.2, dates from February 12, 2026, and the repository has had no commits to main since May 22. It still works for focused, conversational edits, but new model names may need manual settings. Our Aider vs Claude Code and Aider vs OpenCode comparisons show where its approach still wins.
One MCP server in four agents: what we saw
Most of these agents speak the Model Context Protocol, so one server can serve all of them. On November 19 we added the same remote server (Context7's public endpoint) with each CLI's own command and checked where it landed:
| Agent | Command | Saved to |
|---|---|---|
| Codex CLI 0.170.0 | codex mcp add context7 --url <url> | ~/.codex/config.toml |
| OpenCode 2.3.2 | opencode mcp add context7 --url <url> | opencode.json in the project |
| Gemini CLI 0.70.0 | gemini mcp add -s user -t http context7 <url> | ~/.gemini/settings.json |
| Cline CLI 3.0.74 | cline mcp add context7 --transport http --yes <url> | ~/.cline/data/settings/cline_mcp_settings.json |
Two details stood out. Codex detected the server's OAuth support and immediately printed a sign in link. Gemini CLI refused to write project settings until the folder was marked trusted, so we used the user scope. OpenCode writes to the project unless you pass --global. For servers that run on your own machine, see how to run an MCP server locally.
Honorable mentions
- Zed is an open source code editor with its own agent panel. It can also host external agents, such as Gemini CLI or Claude Code, through the Agent Client Protocol.
- Parallel agent apps such as Orca, Emdash and Claude Squad don't write code themselves; they run several of the agents above side by side, each in its own git worktree. We compare them in Conductor alternatives. For a local desktop that watches Claude Code, Codex and OpenCode sessions, plan limits and pull request cost, see Caprock.
- Qwen Code (Apache 2.0) is Alibaba's terminal agent, forked from Gemini CLI and open to any OpenAI compatible endpoint (0.28.0 on npm, November 17). Its 1.0 Preview ships as a native binary with the Qoder harness inside; see Qwen Code 1.0: what changed.
- OpenHands (MIT) is now Agent Canvas, a self hosted control center (
npm install -g @openhands/agent-canvas) that runs its own agent or Claude Code, Codex, Gemini CLI, Pi and OpenCode across local, Docker, VM and cloud backends.
How to choose
- Decide where you want to work. Terminal: OpenCode, Codex CLI, Gemini CLI or Aider. Editor: Cline or Zed. Desktop app: goose, OpenCode, Codex or Cline.
- Decide how much model freedom you need. To switch providers per task or run local models, choose OpenCode, Cline, goose or Aider.
- Decide your autonomy level. Cline and Aider keep you closest to every change. OpenCode, Codex CLI and goose are comfortable running longer multistep tasks.
- Standardize the shared pieces. One AGENTS.md and the same MCP servers work across most of these agents, so switching later costs little. See our AGENTS.md guide, MCP server tutorial and what an agent harness is.
Related guides: E2B vs Daytona vs Modal for cloud sandboxes, the best AI coding assistant for a paid and free shortlist, and Pi coding agent alternatives for minimal harnesses.
From Ahzy Capital (our own products, labeled as such): Get the free AI Agent Cheat Sheet: 24 copy and paste AI agent setups for 8 types of small business, with prompts and workflows. We make and sell these, so they aren't independent picks.
FAQ
What is the best open source alternative to Claude Code?
For a terminal agent that works with any model provider, OpenCode is the closest match. If you'd rather stay in VS Code or JetBrains, Cline is the main alternative. Codex CLI is also open source, but it is built around OpenAI models and ChatGPT sign in.
Is Cline better than OpenCode?
They suit different workflows. Cline runs mainly inside your editor and asks you to approve each file change and command by default. OpenCode is terminal first, with a desktop app and web interface, and is built for longer autonomous runs with background subagents. Both are open source and model agnostic.
Are open source coding agents free?
The software is free. You still pay for the model, through API usage or a subscription the agent can sign in with, unless you run a local model. OpenCode Go ($10 a month) and ClinePass ($9.99 a month) are optional paid model plans from the makers.
Which open source coding agent works best with local models?
Cline, OpenCode, goose and Aider all accept local models. goose can load a local model directly, while OpenCode and Cline connect to runtimes such as Ollama or LM Studio. Codex CLI and Gemini CLI are built around their makers' hosted models.
Is Gemini CLI still free and open source?
It is still Apache-2.0, but free use for personal Google accounts ended on June 18, 2026. It now targets Gemini Code Assist Standard and Enterprise licenses, with paid API and Vertex keys as legacy options.
Is Aider still maintained?
Barely. Its latest PyPI release, 0.86.2, is from February 12, 2026, and the repository has had no commits to main since May 22, 2026. It still runs, but check the repository before adopting it for a team.



