Research reportai-agents
Terminal AI coding agents: open, portable, or locked in?
We verified the license, model portability and pricing of six terminal AI coding agents — Claude Code, Codex CLI, Gemini CLI, Aider, OpenCode and Goose.
“Is it open source?” is the wrong first question to ask about a terminal AI coding agent. We pulled the license, model support and billing model for six of the most-used terminal coding agents — Claude Code, OpenAI’s Codex CLI, Google’s Gemini CLI, Aider, OpenCode and Goose — straight from their repositories and pricing pages on 16 July 2026. The result: “open source,” “runs on the model you choose,” and “free to run” are three separate things, and almost every buyer treats them as one.
The one-paragraph answer
Of the six terminal coding agents we checked, five are open source — every one except Anthropic’s Claude Code, which is closed. But only three of them let you point the agent at whatever model you want: Aider, OpenCode and Goose. The other two open-source tools are vendor clients — OpenAI’s Codex CLI is Apache-2.0 licensed yet authenticates against OpenAI, and Google’s Gemini CLI is Apache-2.0 yet runs on Gemini. So the license tells you almost nothing about whether you can bring your own model, avoid a subscription, or run locally for zero inference cost. Those are the questions that actually decide cost and lock-in, and they don’t line up with the open-source badge the way most comparison posts imply.
The matrix (verified 16 July 2026)
Every field below was read from the tool’s own repository, README or pricing page on the date above. Star counts are a rough popularity proxy, not a quality score.
| Agent | License | Runs on | How you pay | GitHub stars |
|---|---|---|---|---|
| Claude Code | Proprietary (closed) | Claude models only | Claude Pro / Max subscription, or Anthropic API | not applicable (closed) |
| Codex CLI | Apache-2.0 | OpenAI models only | ChatGPT paid plan, or OpenAI API key | 98.8k |
| Gemini CLI | Apache-2.0 | Gemini models only | Free tier, Gemini API key, or Vertex AI | 106k |
| Aider | Apache-2.0 | Any model (bring your own key) | Your chosen model’s API, or a local model | 47.4k |
| OpenCode | MIT | Any provider (bring your own key) | Your chosen model’s API, or a local model | 186k |
| Goose | Apache-2.0 | 15+ providers, incl. local | Your chosen model’s API/subscription, or a local model | 51.3k |
Sources per row: claude.com/pricing; github.com/openai/codex and the ChatGPT/Codex pricing docs; the Gemini CLI README; github.com/Aider-AI/aider; github.com/sst/opencode with the OpenCode docs; github.com/block/goose.
Read down the “Runs on” column and the split is obvious. Three tools take whatever model you give them; three run one company’s models. That is the line that matters, and it cuts straight through the license column.
Open source doesn’t mean portable
The clearest example is OpenAI’s Codex CLI. It is genuinely open source — Apache-2.0, 98.8k stars, and about 97% Rust in the repository. You can read every line and fork it. What you cannot do is run it against Claude or a local model: the quickstart signs you in with ChatGPT and the alternative is an OpenAI API key. Google’s Gemini CLI is the same shape — Apache-2.0 and openly developed (546 releases, latest v0.50.0 dated 8 July 2026), but it runs on Gemini.
Meanwhile Anthropic’s Claude Code, the tool many developers reach for by default, is closed source and locks you to Claude. Openness and lock-in are not opposites here; Codex CLI is open and locked at the same time.
The tools that are open and portable are the community-built ones. Aider “can connect to almost any LLM, including local models,” using a bring-your-own-key model. OpenCode’s docs put it plainly: “you can use any LLM provider by configuring their API keys.” Goose “works with 15+ providers — Anthropic, OpenAI, Google, Ollama, OpenRouter, Azure, Bedrock, and more,” and can also ride your existing Claude, ChatGPT or Gemini subscription. If avoiding lock-in is the goal, portability is the column to read, and only these three deliver it.
What “free” actually means, tool by tool
“Free” is doing a lot of quiet work in this category, and it means something different in each row.
- Free software, you pay the model. Aider, OpenCode and Goose cost nothing to install. Your bill is whatever the model you attach charges — which can be a few dollars of API usage, an existing subscription, or literally zero if you point them at a local model through Ollama.
- Free tier, hosted by the vendor. Gemini CLI is the outlier that gives you free inference: sign in with a personal Google account and you get 60 requests per minute and 1,000 requests per day on Gemini 3 with a 1M-token context window, per its README. That is generous, but it is Google-hosted, not portable — you are on Google’s models and Google’s quota.
- Bundled into a subscription. Claude Code comes with Claude Pro (from $17/month on the annual plan, $20 monthly) or Max (from $100/month), or you pay per token on the Anthropic API. Codex CLI is included with ChatGPT paid plans — Plus is $20/month with CLI access, Pro is from $100/month for 5x–20x more Codex usage — or you use an OpenAI API key and “pay only for the tokens Codex uses.”
So the cheapest path depends entirely on what you already have. If you pay for ChatGPT or Claude anyway, the matching CLI adds no marginal cost. If you want a genuinely free run with no account tie, a local model behind Aider, OpenCode or Goose is the only route to $0 — and Gemini CLI’s free tier is the easiest zero-cost start if you don’t mind staying on Gemini.
How to choose without reading ten listicles
Three questions settle it, in order:
- Do you need to switch models — or avoid depending on one vendor? If yes, you want a portable client: Aider, OpenCode or Goose. None of the three vendor-native CLIs will do this, open source or not.
- Are you already paying for ChatGPT or Claude? If yes, Codex CLI or Claude Code respectively is the lowest-friction option — the subscription quota usually beats per-token API pricing for daily work, and there’s nothing extra to buy.
- Do you want zero inference cost? Point a portable client at a local model, or start on Gemini CLI’s free hosted tier and accept the Gemini lock-in.
Notice what didn’t make the list: the GitHub star count and this week’s benchmark score. Terminal-Bench, the public benchmark for exactly these tools, runs live leaderboards (versions 2.0 and 2.1 are current), and the top spot rotates with each new model release — so a score we printed today would be stale before you finished reading. Check the leaderboard when you care about raw capability; check the “Runs on” column when you care about being stuck.
One more thing worth watching: ask an AI assistant “what’s the best terminal coding agent” and the answer shifts by engine and by month, because which sources each engine cites is its own moving target — the one our sister index CitedIndex tracks.
Methodology & sources
This is a facts-only comparison. Every value in the matrix was read live on 16 July 2026 from the tool’s own repository, README or pricing page — no benchmark estimates, no invented figures. Licenses and star counts come from each GitHub repository; model support comes from each project’s documentation; pricing comes from the vendors’ own pages. Where a fact moves fast (exact prices, model versions, star counts), we date it rather than pin it as permanent, and we describe pricing by its model — subscription, free tier, or bring-your-own-key — because that structure outlasts any single price change. This is the same standard we apply to every listing; see how we research AI agents and our methodology.
Primary sources: Claude pricing · OpenAI Codex CLI repo · ChatGPT/Codex pricing docs · Gemini CLI repo · Aider repo · OpenCode repo and docs · Goose repo · Terminal-Bench leaderboard.
To see the agents we track sorted and compared on their own pages, start with the index or our best AI agents and side-by-side comparisons.