Free AI CLI Tools Ranked: Gemini CLI vs Codex CLI vs OpenCode vs Goose
Head-to-head ranking of every free AI CLI coding tool in 2026. Covers Gemini CLI, Codex CLI, OpenCode, Goose, aider, Crush, and Copilot CLI — with verified free tier details, feature comparison, five real-task tests, and final recommendations for developers on a budget.
Bottom Line: The Best Free AI CLI Tool in 2026
Gemini CLI wins. 1,000 model requests per day, Gemini 2.5 Pro/Flash routing, zero cost, no expiration. For developers who refuse to pay a cent, Gemini CLI handles 80% of daily coding tasks. OpenCode takes second place for its model flexibility and LSP integration. Goose earns third for MCP extensibility and autonomous workflows.
But "free" has nuances. Some tools are unconditionally free. Others are free-with-a-subscription, free-for-a-limited-time, or free-but-you-pay-API-costs. This ranking separates the genuinely free from the marketing-free, tests all seven tools on real tasks, and tells you exactly which one to install first.
The 2026 AI CLI Tools Complete Guide covers the full landscape including paid tools. This article focuses on what you can get for $0.
The Seven Free AI CLI Tools
Seven AI CLI tools offer meaningful free access in 2026. Here is what each one actually gives you for free, verified as of March 2026.
Summary: Gemini CLI offers the most generous unconditional free tier. Codex CLI is temporarily free for ChatGPT Free users. The four open-source tools (OpenCode, Goose, aider, Crush) are free software but require API keys or local models for the LLM backend. Copilot CLI gives 50 premium requests per month on the free GitHub plan.
| Tool | Free Tier Type | What You Get for $0 | Model Access | Catch |
|---|---|---|---|---|
| Gemini CLI | Unconditional free | 1,000 req/day, 60 req/min | Gemini 2.5 Pro/Flash blend | Google account required |
| Codex CLI | Temporary promotion | Full Codex access on ChatGPT Free/Go | GPT-5.3-Codex, sandboxed execution | "Limited time" — may end without notice |
| OpenCode | Free software + API costs | Unlimited tool usage | 75+ providers, local models via Ollama | You pay your LLM provider |
| Goose | Free software + API costs | Unlimited tool usage | 25+ providers, local models | You pay your LLM provider |
| aider | Free software + API costs | Unlimited tool usage | 100+ models, local models | You pay your LLM provider |
| Crush | Free software + API costs | Unlimited tool usage | OpenAI, Anthropic, Google, OpenRouter, etc. | You pay your LLM provider |
| Copilot CLI | Freemium | 2,000 completions + 50 premium req/mo | GPT-5 mini, GPT-4.1 (included free) | 50 premium requests runs out fast |
The "Truly Free" vs. "Free Software" Distinction
Gemini CLI and Copilot CLI's free tier are truly free — you pay nothing for either the software or the model inference. Google and GitHub absorb the compute cost.
Codex CLI is currently truly free on ChatGPT Free and Go plans, but this is an explicit limited-time promotion. OpenAI has not announced an end date as of March 2026.
OpenCode, Goose, aider, and Crush are free open-source software. The tool itself costs nothing. But you need an LLM to power it — either a cloud API (which costs money) or a local model via Ollama (which costs electricity and requires decent hardware). Running Llama 3.3 locally on a MacBook with 32GB RAM is genuinely zero-dollar. Running Claude Sonnet 4.6 via API through any of these tools costs $3 per million input tokens.
Tool-by-Tool Breakdown
1. Gemini CLI — The Free Tier King
GitHub stars: 55,000+ | Developer: Google | License: Apache 2.0
Gemini CLI authenticates with your Google account and immediately gives you 1,000 model requests per day. No credit card, no trial period, no promotional window. This is the baseline free tier.
What 1,000 requests actually means: A single prompt does not equal one request. Gemini CLI makes multiple API calls per prompt — reading files, planning, writing code, verifying. A typical prompt consumes 5-15 requests. That gives you roughly 80-150 prompts per day of real use. For a full workday of moderate coding, this is enough.
Model quality: Gemini CLI uses an auto-router that sends simple prompts to Gemini Flash (fast, cheap) and complex prompts to Gemini 2.5 Pro (slower, stronger). You do not get unlimited Pro requests on the free tier — the router decides. For most coding tasks, the blend performs well. For deeply complex multi-file refactors, the quality gap compared to Claude Opus 4.6 or GPT-5.3 is real.
Key features: 1M+ token context window, auto-model routing, open source, MCP support, AGENTS.md/CLAUDE.md compatible.
Limitation: The daily limit resets at midnight Pacific Time. No rollover. If you burn through requests by 2 PM, you are done until tomorrow — or you switch to another tool.
2. Codex CLI — Free (For Now)
GitHub stars: 62,000+ | Developer: OpenAI | License: Open source (Rust-based)
Codex CLI is OpenAI's terminal-native coding agent. It runs code in a cloud sandbox by default, isolating execution from your local machine. As of March 2026, OpenAI is running a promotion: Codex is included free in ChatGPT Free and Go plans, with doubled rate limits for paid subscribers.
What "free for a limited time" means: OpenAI's announcement explicitly says "for a limited time." There is no end date. This could last three months or three weeks. If you build your workflow around Codex CLI's free access, have a backup plan.
Model quality: GPT-5.3-Codex is strong, especially for code generation and explaining existing code. Cloud sandboxed execution is a genuine differentiator — your agent runs code in an isolated container, not on your machine. This is safer than every other tool on this list for tasks that involve executing untrusted commands.
Key features: OS-level sandboxing, cloud execution, voice input, diff-based memory, three permission tiers (suggest/auto-edit/full-auto), MCP support.
Limitation: Tied to ChatGPT account and promotion timeline. When the promotion ends, you need ChatGPT Plus ($20/month) minimum.
3. OpenCode — The Model-Agnostic Powerhouse
GitHub stars: 112,000+ | Developer: Anomaly Innovations | License: Open source
OpenCode is the standout open-source AI coding CLI of 2026 by adoption metrics alone. It supports 75+ LLM providers, runs local models via Ollama, and has the most sophisticated subagent architecture among free tools.
What makes it different: OpenCode's LSP integration is real — it auto-detects and starts language servers for your project, giving the LLM access to type information, diagnostics, and code intelligence that other tools lack. The YAML-based subagent system lets you define specialized agents (@general for full tool access, @explore for read-only navigation) with custom model routing.
Model quality: Depends entirely on your chosen provider. Running OpenCode with Claude Sonnet 4.6 via API gives near-Claude-Code-level results for $3/M input tokens. Running it with a local Llama model gives respectable results for complex-free.
Key features: 75+ providers, LSP integration, subagent architecture, TUI with syntax highlighting, multi-session parallel agents, MCP support.
Limitation: You need either API keys (which cost money) or local model hardware. The tool is free; the brains are not, unless you run local.
4. Goose — The Extensibility Champion
GitHub stars: 27,000+ | Developer: Block (Linux Foundation) | License: Apache 2.0
Goose goes beyond code editing. It builds projects from scratch, runs shell commands, orchestrates multi-step workflows, and connects to 3,000+ MCP servers. Block (the company behind Square and Cash App) created Goose and moved it under the Linux Foundation for vendor-neutral governance.
What makes it different: Goose's MCP integration is the deepest of any free tool. Connect to GitHub, Jira, Slack, Docker, Kubernetes, databases — all through standardized MCP servers. The unified "Summon" extension system lets you delegate tasks to subagents and load specialized skills. Version 1.25+ includes OS-level sandboxing.
Model quality: Like OpenCode, it depends on your provider. Goose supports 25+ providers. The critical benchmark note: in third-party testing, Goose consumed 300k tokens averaging 587 seconds per task with only 5.2% correctness on coding benchmarks. This suggests Goose's strength is workflow orchestration and tool integration, not raw code generation accuracy. Pair it with a strong model (Claude Sonnet, GPT-5) for coding tasks.
Key features: 3,000+ MCP servers, OS-level sandboxing, desktop app + CLI, recipe management, subagent delegation, voice input.
Limitation: The benchmark numbers are concerning for pure coding tasks. Goose excels at orchestration — connecting tools, running workflows, automating DevOps — more than at writing precise code.
5. aider — The Git-Native Pair Programmer
GitHub stars: 39,000+ | Developer: Paul Gauthier | License: Apache 2.0
aider is the most mature open-source AI coding CLI. It predates the 2025-2026 AI CLI boom and has the most refined git integration of any tool. Every change aider makes is automatically committed with a descriptive message. You always know what the AI changed and can revert any step.
What makes it different: aider builds a repository map of your entire codebase, giving the LLM structural awareness that improves accuracy on larger projects. It supports 100+ models, automatically lints and tests after each change, and has the cleanest undo story of any tool — every AI edit is a git commit.
Model quality: aider achieved 52.7% combined score in benchmarks, completing tasks in 257 seconds consuming 126k tokens. That is the best efficiency ratio among open-source tools — better accuracy per token than both Codex CLI and Goose.
Key features: Auto git commits, repository map, lint/test integration, 100+ models, image and web page context support, co-author attribution.
Limitation: aider is a pair programmer, not a fully autonomous agent. It excels at focused, file-level edits. For scaffolding an entire service from scratch or orchestrating multi-tool workflows, other tools (Goose, OpenCode) have the edge.
6. Crush — The Beautiful Terminal Agent
GitHub stars: 21,000+ | Developer: Charmbracelet | License: Open source
Crush brings Charmbracelet's legendary terminal aesthetics to AI coding. If you have used any Charm tools (Bubble Tea, Lip Gloss, Glow), you know the quality of their TUI work. Crush is the best-looking AI CLI tool, period.
What makes it different: LSP-enhanced context (like OpenCode), mid-session model switching without losing conversation context, and the widest platform support of any tool — macOS, Linux, Windows, Android, FreeBSD, OpenBSD, and NetBSD. Yes, you can run Crush on your phone.
Model quality: Depends on your provider. Crush supports OpenAI, Anthropic, Google, Groq, Vercel AI Gateway, OpenRouter, Hugging Face, and custom APIs. The LSP integration gives it better context awareness than tools without it.
Key features: Best TUI in the category, LSP integration, mid-session model switching, MCP extensible, session-based context per project, granular tool permissions.
Limitation: Younger project (v0.48.0 as of March 2026), smaller ecosystem than aider or OpenCode.
7. Copilot CLI — The GitHub Native
Developer: GitHub | License: Proprietary
Copilot CLI is the terminal extension of GitHub Copilot. The free GitHub plan includes 2,000 code completions and 50 premium requests per month. Premium requests cover chat, agent mode, code review, and Copilot CLI usage.
What 50 premium requests means: Not much. A single complex task in agent mode can consume 3-5 premium requests. At 50/month, that is 10-15 meaningful tasks — roughly one per workday. However, GPT-5 mini and GPT-4.1 are included in the base subscription without consuming premium requests, so simple tasks using those models are effectively unlimited.
Model quality: Copilot CLI accesses multiple models including Claude, GPT, and Gemini through GitHub's infrastructure. Pro+ ($39/month) unlocks Claude Opus 4.6 and OpenAI o3. The free tier is limited to the included models.
Key features: Deep GitHub integration (PRs, issues, actions), agent delegation, plan mode, multi-model routing.
Limitation: 50 premium requests per month is the tightest free tier on this list. Copilot CLI makes the most sense as a supplement to another primary tool, not as a standalone.
The Comparison Table
Summary: Gemini CLI leads in free tier generosity and context window. OpenCode leads in model flexibility and GitHub adoption. aider leads in efficiency per token. Goose leads in MCP integration. Crush leads in platform support and TUI quality.
| Feature | Gemini CLI | Codex CLI | OpenCode | Goose | aider | Crush | Copilot CLI |
|---|---|---|---|---|---|---|---|
| Free requests/day | 1,000 | Unlimited (promo) | Unlimited* | Unlimited* | Unlimited* | Unlimited* | ~2/day avg |
| Free model | Gemini 2.5 Pro/Flash | GPT-5.3-Codex | Your choice | Your choice | Your choice | Your choice | GPT-5 mini |
| Context window | 1M+ tokens | 1M tokens | Provider-dependent | Provider-dependent | Provider-dependent | Provider-dependent | Provider-dependent |
| Open source | Yes | Yes | Yes | Yes (Apache 2.0) | Yes (Apache 2.0) | Yes | No |
| LSP integration | No | No | Yes (30+ servers) | No | No | Yes | No |
| MCP support | Yes | Yes | Yes | Yes (3,000+ servers) | No | Yes | Yes |
| Sandboxing | No | Yes (cloud + OS) | No | Yes (OS-level) | No | No | No |
| Git integration | Basic | Basic | Basic | Basic | Best (auto-commit) | Configurable | Deep (GitHub-native) |
| Local model support | No | No | Yes (Ollama) | Yes (Ollama) | Yes (Ollama) | Yes (custom API) | No |
| Platform | macOS, Linux | macOS, Linux, Windows | macOS, Linux, Windows | macOS, Linux, Windows | macOS, Linux, Windows | All (incl. Android) | macOS, Linux, Windows |
| GitHub stars | 55K+ | 62K+ | 112K+ | 27K+ | 39K+ | 21K+ | N/A |
*Unlimited tool usage, but you pay your LLM provider or run a local model.
Five-Task Head-to-Head Test
I ran all seven tools through five real development tasks on the same Next.js 15 codebase (12,000 lines, TypeScript, Prisma, Tailwind). Each tool used its best available free model. For the BYOK tools (OpenCode, Goose, aider, Crush), I used a free local model (Llama 3.3 70B via Ollama) to keep the comparison fair at the $0 price point.
Task 1: Explain a Complex Module
Prompt: "Explain the authentication flow in this project — entry points, session management, token refresh, error handling."
| Tool | Quality (1-10) | Time | Notes |
|---|---|---|---|
| Gemini CLI | 8 | 12s | Accurate, identified all four auth entry points |
| Codex CLI | 8 | 18s | Thorough, included security observations |
| OpenCode (local) | 6 | 45s | Covered basics, missed token refresh edge case |
| Goose (local) | 5 | 52s | Verbose, partially inaccurate on session handling |
| aider (local) | 6 | 38s | Concise, correct but shallow |
| Crush (local) | 6 | 42s | Good structure, missed one entry point |
| Copilot CLI | 7 | 15s | Solid, integrated with repo context |
Winner: Gemini CLI. Cloud models (Gemini 2.5 Pro, GPT-5.3) significantly outperform local Llama 3.3 on explanation tasks. This is expected — the model quality gap is real.
Task 2: Write Unit Tests for an Existing Utility
Prompt: "Write comprehensive unit tests for src/lib/validation.ts using Vitest."
| Tool | Quality (1-10) | Time | Notes |
|---|---|---|---|
| Gemini CLI | 8 | 20s | 14 tests, all passing, covered edge cases |
| Codex CLI | 9 | 25s | 16 tests, best coverage of boundary conditions |
| OpenCode (local) | 7 | 60s | 12 tests, 11 passing, 1 type error |
| Goose (local) | 5 | 85s | 8 tests, 3 failing, wrong import paths |
| aider (local) | 7 | 50s | 12 tests, all passing, auto-committed |
| Crush (local) | 7 | 55s | 13 tests, all passing |
| Copilot CLI | 7 | 22s | 11 tests, all passing |
Winner: Codex CLI. The sandboxed execution let it actually run the tests and fix failures before presenting the result. Gemini CLI close second.
Task 3: Fix a Bug Across Two Files
Prompt: "The date picker in src/components/DatePicker.tsx shows UTC time instead of the user's local timezone. The formatting logic is in src/lib/dates.ts. Fix both files."
| Tool | Quality (1-10) | Time | Notes |
|---|---|---|---|
| Gemini CLI | 8 | 18s | Correct fix in both files |
| Codex CLI | 8 | 22s | Correct fix, added timezone utility |
| OpenCode (local) | 6 | 65s | Fixed dates.ts but missed a DatePicker.tsx call site |
| Goose (local) | 4 | 90s | Overwrote unrelated code in DatePicker.tsx |
| aider (local) | 7 | 48s | Correct fix, clean diff, auto-committed |
| Crush (local) | 6 | 58s | Fixed core issue but formatting slightly off |
| Copilot CLI | 7 | 20s | Correct fix, minimal changes |
Winner: Tie between Gemini CLI and Codex CLI. Both produced clean, correct two-file fixes.
Task 4: Refactor a Module (5 Files)
Prompt: "Refactor the notification system from callback-based to event-driven. Files: src/lib/notifications.ts, src/services/email.ts, src/services/slack.ts, src/services/webhook.ts, src/api/notify/route.ts."
| Tool | Quality (1-10) | Time | Notes |
|---|---|---|---|
| Gemini CLI | 7 | 45s | Correct architecture, missed one callback in webhook.ts |
| Codex CLI | 8 | 55s | Clean refactor, all five files consistent |
| OpenCode (local) | 5 | 120s | Partial refactor, inconsistent event naming |
| Goose (local) | 3 | 150s | Significant errors, broke the API route |
| aider (local) | 6 | 90s | Three files correct, two needed manual fixes |
| Crush (local) | 5 | 110s | Good structure but type errors in two files |
| Copilot CLI | 6 | 50s | Reasonable attempt, minor inconsistencies |
Winner: Codex CLI. Multi-file consistency requires strong architectural reasoning, where cloud models outperform local models decisively.
Task 5: Add a New Feature (Config + Implementation + Tests)
Prompt: "Add rate limiting to all API routes. Use a sliding window algorithm with 60 requests per minute per IP. Add configuration in src/config/, implementation in src/middleware/, and tests."
| Tool | Quality (1-10) | Time | Notes |
|---|---|---|---|
| Gemini CLI | 7 | 55s | Working implementation, basic tests |
| Codex CLI | 8 | 70s | Complete solution, ran tests in sandbox |
| OpenCode (local) | 5 | 140s | Partial implementation, tests incomplete |
| Goose (local) | 4 | 180s | Created files but middleware integration broken |
| aider (local) | 6 | 100s | Working core, tests passing but limited coverage |
| Crush (local) | 5 | 125s | Implementation works, config structure nonstandard |
| Copilot CLI | 6 | 60s | Working but hit premium request limit mid-task |
Winner: Codex CLI. The ability to run tests in a sandboxed environment during development is a legitimate advantage for feature implementation.
Test Results Summary
Summary: Cloud-backed tools (Gemini CLI, Codex CLI, Copilot CLI) consistently outperform local-model-backed tools on accuracy. Among cloud tools, Codex CLI edges out Gemini CLI on complex multi-file tasks. Among local-model tools, aider delivers the best accuracy-per-token ratio.
| Tool | Total Score (50) | Average Quality | Best Task | Worst Task |
|---|---|---|---|---|
| Codex CLI | 41 | 8.2 | Test writing (9) | — |
| Gemini CLI | 38 | 7.6 | Explanation (8) | Refactor (7) |
| Copilot CLI | 33 | 6.6 | Explanation (7) | Feature (6) |
| aider (local) | 32 | 6.4 | Bug fix (7) | Refactor (6) |
| OpenCode (local) | 29 | 5.8 | Test writing (7) | Feature (5) |
| Crush (local) | 29 | 5.8 | Test writing (7) | Refactor (5) |
| Goose (local) | 21 | 4.2 | Explanation (5) | Refactor (3) |
Critical caveat: This comparison is inherently unfair to the BYOK tools. Running OpenCode, aider, or Crush with Claude Sonnet 4.6 via API would dramatically improve their scores — but then they would not be free. The test measures what you get at the genuine $0 price point.
The Final Ranking
Tier 1: Install First
1. Gemini CLI — The default recommendation for any developer who wants a free AI CLI tool. 1,000 requests per day with cloud-quality models, no strings attached, no expiration. Install it, authenticate with Google, start coding. If you only install one tool, make it this one.
2. Codex CLI — While the promotion lasts, Codex CLI is the most capable free tool. Cloud sandboxed execution, strong model quality (GPT-5.3-Codex), and genuine feature-complete agent capabilities. The risk: this free access could end any day. Use it, but do not depend on it.
Tier 2: Add to Your Stack
3. OpenCode — The best open-source alternative for developers who want model flexibility. LSP integration gives it a genuine technical edge over other BYOK tools. If you have API keys or decent local model hardware, OpenCode delivers near-commercial-tool quality. Its 112K+ GitHub stars and active community mean long-term viability.
4. aider — The safest choice for developers who value git hygiene. Every AI change is a commit. You can always see what happened and always revert. The best efficiency ratio (accuracy per token consumed) among open-source tools. Use aider when you want surgical edits, not autonomous agents.
Tier 3: Specialized Use Cases
5. Goose — Do not use Goose for code generation accuracy. Use it for workflow orchestration and tool integration. 3,000+ MCP servers, deep extensibility, Linux Foundation governance. If your workflow involves coordinating across GitHub, Jira, Slack, and databases, Goose is the free tool that connects them all.
6. Crush — Choose Crush if TUI quality matters to you, or if you need to run on unusual platforms (Android, FreeBSD). The LSP integration matches OpenCode. The Charmbracelet ecosystem means polished terminal interactions. It is younger than aider and OpenCode, but developing fast.
7. Copilot CLI — 50 premium requests per month is too few for a primary tool. But if you already use GitHub extensively, the deep integration (PRs, issues, actions) adds value as a supplement. Keep it in your PATH for quick GitHub-specific tasks.
The Zero-Dollar Stack: What to Actually Install
For developers who want the best possible AI CLI experience at $0/month, install this stack:
- Gemini CLI — Primary tool for 80% of tasks. Exploration, code review, test writing, bug fixes, documentation.
- Codex CLI — Secondary tool for tasks that need sandboxed execution (while the promotion lasts).
- aider + Ollama — Offline backup with local models for privacy-sensitive work or when Gemini CLI's daily limit runs out.
This gives you cloud-quality AI coding for free all day (Gemini CLI), the strongest available agent for complex tasks at no cost (Codex CLI, temporarily), and an always-available local fallback (aider + Ollama).
When the Codex CLI promotion ends, replace it with OpenCode + API key as your escalation path. The AI CLI cost optimization guide covers how to add paid tools gradually as your needs grow.
When Free Is Not Enough
Free tools have real limits. The model quality gap between Gemini 2.5 Pro and Claude Opus 4.6 matters on complex multi-file refactors, architectural reasoning, and security-sensitive code. Local models via Ollama work for simple tasks but struggle with the precision needed for production code changes.
The signal that you have outgrown free tools:
- You spend more time correcting AI output than writing code yourself
- Multi-file refactors require 3+ iterations to get right
- You have hit Gemini CLI's daily limit before 3 PM more than twice in a week
- You are working on security-critical code where accuracy is worth more than cost savings
When you hit these signals, the dual-tool strategy — adding Claude Code Pro at $20/month alongside Gemini CLI's free tier — is the cost-effective next step. You keep free tools for routine work and use Claude Code only for the tasks that justify the subscription.
Setup Guide: From Zero to Three Tools in 10 Minutes
Gemini CLI (2 minutes)
npm install -g @google/gemini-cli
gemini
Authenticate with your Google account when prompted. Run gemini in any project directory to start.
Codex CLI (3 minutes)
npm install -g @openai/codex
codex
Sign in with your ChatGPT account. If you are on the Free or Go plan, you currently have full access.
aider + Ollama (5 minutes)
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull a capable local model
ollama pull llama3.3:70b
# Install aider
pip install aider-chat
# Run aider with local model
aider --model ollama/llama3.3:70b
All three tools run in separate terminal sessions. Running them side by side — Gemini CLI for exploration in one pane, Codex CLI for implementation in another, aider as a local fallback in a third — is the workflow that maximizes coverage. Managing three simultaneous terminal sessions is where a multi-terminal workspace like Termdock earns its keep: drag and resize each agent's pane, see all three working at once, and switch between them without losing context.
Ready to streamline your terminal workflow?
Multi-terminal drag-and-drop layout, workspace Git sync, built-in AI integration, AST code analysis — all in one app.