Best Open-Source AI Coding Agents for the Terminal (2026 Roundup)
What Is a Terminal AI Coding Agent?
A terminal coding agent is an AI assistant that lives in your shell instead of inside an editor. You point it at a project folder, describe what you want in plain English, and it reads files, edits code, runs commands and tests, and loops until the task is done or it needs your approval.
In 2026 this category has exploded. Almost every model lab now ships its own CLI, and the open-source projects have grown into serious tools with sandboxes, permission systems, plan modes and support for the Model Context Protocol (MCP). This roundup covers the open-source agents worth installing today, what makes each one different, and how to choose.
Star counts below were read from each project's GitHub page in October 2026 and are rounded.
Quick Comparison
| Agent | Maintainer | License | Stars | Best for |
|---|---|---|---|---|
| OpenCode | Anomaly | MIT | ~212k | Any-model, all-round daily driver |
| Codex CLI | OpenAI | Apache-2.0 | ~128k | ChatGPT subscribers, sandboxed runs |
| Gemini CLI | Apache-2.0 | ~107k | Generous free tier | |
| OpenHands | OpenHands | MIT | ~90k | Self-hosted agents and automations |
| Cline | Cline Bot Inc. | Apache-2.0 | ~68k | Headless CI jobs and scheduled agents |
| Goose | Agentic AI Foundation | Apache-2.0 | ~55k | General workflows beyond code |
| Aider | Aider-AI | Apache-2.0 | ~49k | Git-first pair programming |
| Crush | Charm | FSL-1.1-MIT | ~28k | A polished TUI and model switching |
| Qwen Code | Alibaba (Qwen) | Apache-2.0 | ~27k | Qwen-Coder models |
1. OpenCode
OpenCode bills itself as "The open source coding agent." It is the most-starred project in this list and the closest thing to a default choice if you don't want to be tied to one model vendor: you connect any LLM provider by adding its API key with /connect inside the TUI.
Two built-in agents shape how you work. The build agent has full access for development work, while the plan agent is read-only: it denies file edits by default and asks before running bash commands. Press Tab to flip between them. Running /init in a project generates an AGENTS.md file describing your codebase, which you commit so every future session starts with context.
curl -fsSL https://opencode.ai/install | bash
# or
npm i -g opencode-ai@latest
Besides the terminal UI there is a desktop app (beta) and an IDE extension. Source: github.com/anomalyco/opencode.
2. OpenAI Codex CLI
Codex CLI is OpenAI's "Lightweight coding agent that runs in your terminal." It is written in Rust, open source under Apache-2.0, and you sign in either with a ChatGPT plan or an API key, which makes it an easy pick if you already pay for ChatGPT.
Its standout feature is control. A /permissions command lets you choose when Codex can edit files or run commands without asking and shows the active sandbox and writable folders before you continue. /init creates an AGENTS.md file with instructions for the agent. You can also run local models through Ollama with the --oss flag.
npm install -g @openai/codex
# or
brew install --cask codex
3. Google Gemini CLI
Gemini CLI is Google's Apache-2.0 terminal agent, and its biggest draw is price. Signing in with a personal Google account gives a free tier of 60 requests per minute and 1,000 requests per day, which is plenty for side projects.
It works with Gemini models only, but it has solid sandboxing options and ships new preview and stable releases every week.
npm install -g @google/gemini-cli
# or run it without installing
npx @google/gemini-cli
4. OpenHands
OpenHands has grown from a single agent into "The self-hosted developer control center for coding agents and automations." You run agents locally, in Docker or on your own servers, and switch between local, remote and cloud backends from one interface.
What makes it different is that it can drive other agents too: besides its own, it runs Claude Code, Codex, Gemini, OpenCode and anything that speaks the Agent Client Protocol (ACP). Scheduled and webhook-triggered automations connect to Slack, GitHub, Linear and Notion. It is MIT licensed and works with any LLM.
5. Cline CLI
Cline started as a VS Code extension and now describes itself as "The open source coding agent in your IDE and terminal." The CLI is built for automation: run it interactively, or fully headless in CI with piped input and JSON output.
A few features stand out:
- Scheduled agents with
cline schedule create, using cron syntax. - Multi-agent teams that keep their state across sessions (
--team-name). - Chat connections to Telegram, Slack and others via
cline connect. - MCP server management via
cline mcp.
npm i -g cline
6. Goose
Goose is "your native open source AI agent — desktop app, CLI, and API — for code, workflows, and everything in between." Originally built at Block, it now lives under the Agentic AI Foundation at the Linux Foundation.
Goose is the most general-purpose agent here. Its extensions are MCP servers, so it is just as happy automating research, file chores or API workflows as writing code. It is Apache-2.0 licensed and works with many providers, including local models.
curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash
7. Aider
Aider is the veteran of the group: "AI pair programming in your terminal." It is Git-native. Every change it makes becomes a commit with a sensible message, so undoing a bad edit is a normal git operation.
Aider builds a map of your whole codebase so it works well in larger projects, supports 100+ programming languages, can lint and test its own changes, and even accepts voice requests and images as context. It works with cloud and local LLMs.
python -m pip install aider-install
aider-install
8. Crush
Crush comes from Charm, the team behind some of the nicest terminal UIs around, and it shows. The README calls it "Your new coding bestie, now available in your favourite terminal."
Its strengths are multi-model support (any OpenAI- or Anthropic-compatible API), switching models mid-session without losing context, multiple saved sessions per project, LSP integration for extra code context, and MCP over stdio, http and sse. It runs on macOS, Linux, Windows, Android and the BSDs.
brew install charmbracelet/tap/crush
# or
npm install -g @charmland/crush
One caveat: Crush uses the FSL-1.1-MIT license. The source is public, but it is "source available" rather than OSI-approved open source until each version converts to MIT.
9. Qwen Code
Qwen Code is "The open-source AI coding agent that lives in your terminal" from Alibaba's Qwen team. It began as a fork of Gemini CLI v0.8.2 but has been developed independently since its own v0.1, and it is tuned for the Qwen-Coder models.
npm install -g @qwen-code/qwen-code@latest
# or
brew install qwen-code
What About Claude Code?
Claude Code is one of the most popular terminal agents, but it is not open source. The CLI is proprietary and only runs Claude models, so it doesn't belong in this list. If licensing doesn't matter to you, it is worth trying alongside the tools above.
How to Choose
- You want one tool that works with every model: OpenCode or Crush.
- You already pay for ChatGPT: Codex CLI.
- You want to spend nothing: Gemini CLI's free tier, or any agent with a local model through Ollama.
- You want agents running in CI or on a schedule: Cline CLI or OpenHands.
- You care most about a clean Git history: Aider.
- You want automation beyond code: Goose.
Whichever you pick, add an AGENTS.md file to your repo (see agents.md). Most of these tools read it, so one file of project instructions works across agents.
Safety Tips Before You Let an Agent Loose
- Start in plan or read-only mode until you trust how the agent behaves on your codebase.
- Work on a branch so every change is easy to review and revert.
- Keep secrets out of the project folder. Agents read files and run commands, and
.envfiles are an easy leak. - Review MCP servers before installing them. They can run code and reach the network.
Related Reading
- Kiro IDE launch report: three standout features of the spec-driven AI IDE.
- Paca: the AI-native, open-source alternative to Jira, where agents work tickets like teammates.
- All AI & dev app articles
- Handy while working with agents: the JSON Prettifier and Compare JSON tools for checking agent output and config files.



