Duo
Codex vs Gemini CLI: Which to Pick
Checked 2026-10-31
The verdict
Both are open-source terminal agents under Apache-2.0, from OpenAI and Google. The big difference is who can use them. Codex comes with ChatGPT plans, including the free one. Gemini CLI is now aimed at organizations with Gemini Code Assist licenses, and individuals are sent to Antigravity CLI. If you are one developer without a Google Cloud contract, start with Codex. Checked on 31 October 2026.
Loading poll...
Both are open-source terminal agents under Apache-2.0, from OpenAI and Google. The big difference is who can use them. Codex comes with ChatGPT plans, including the free one. Gemini CLI is now aimed at organizations with Gemini Code Assist licenses, and individuals are sent to Antigravity CLI. If you are one developer without a Google Cloud contract, start with Codex. Checked on 31 October 2026.
The short version
If this is you | Start with |
|---|---|
Solo developer with a ChatGPT account | Codex |
Company on Google Cloud with Code Assist Standard or Enterprise | Gemini CLI |
You want Google's models as an individual | Antigravity CLI, not Gemini CLI |
You want an agent to read, fork and audit | Either (both Apache-2.0) |
You want editor, desktop, web and iOS options from the vendor | Codex |
You have a Gemini API key and want to pick the model per run | Gemini CLI |
What changed for Gemini CLI
Most online comparisons of these two predate a change you need to know. Gemini CLI used to be the free terminal agent with a daily allowance. The notice at the top of its README now says:
- It is designed for Gemini Code Assist Standard or Enterprise licenses and Code Assist for GitHub on Google Cloud.
- Free individual access and Google AI Pro and Ultra access moved to Antigravity CLI on 18 June 2026.
- It is not tuned for the Gemini 4 series or later.
- It should not be used to benchmark Gemini models, because the harness is not tuned for Gemini 4 and later.
The README has a small guide to which Google CLI you need. Antigravity CLI (agy) is the interactive coding terminal for free accounts, Google AI Pro and Ultra accounts, and Google Cloud. A separate Gemini API CLI is a stateless API command line and explicitly not a coding harness. Gemini CLI stays for Code Assist organizations and legacy paid API and Vertex keys.
So the fair comparison now is Codex against Gemini CLI for organizations, and Codex against Antigravity CLI for individuals. The second has its own page in Antigravity vs Claude Code. Our entry for the tool is Gemini CLI, and for Google's newer one, Antigravity.
What Codex is
OpenAI's README says "Codex CLI is a coding agent from OpenAI that runs locally on your computer." It also points to an IDE install for VS Code, Cursor and Windsurf, a desktop app through codex app, and a cloud version on the web. OpenAI's plan page says Plus includes Codex on the web, in the CLI, in the IDE extension and on iOS. The repository is Apache-2.0 licensed. Our entry is OpenAI Codex CLI.
Side-by-side facts
Codex | Gemini CLI | |
|---|---|---|
Vendor | OpenAI | |
Licence | Apache-2.0 | Apache-2.0 |
Who it is for now | Any ChatGPT plan, plus API keys | Code Assist Standard or Enterprise orgs, legacy API and Vertex keys |
Install |
|
|
Sign-in | ChatGPT account or API key | Google account with a paid Code Assist license, Gemini API key, or Vertex AI |
Surfaces | CLI, IDE extension, desktop app, web, iOS | Terminal, VS Code companion |
Project memory |
|
|
MCP | Supported in the CLI | Configured in |
Scripting |
|
|
Release channels | See the repository releases | Weekly stable and preview, daily nightly |
Model choice | OpenAI models |
|
Plans and costs
Codex
OpenAI's pricing page says Codex is part of ChatGPT plans and shares their pricing, credits and usage limits.
Plan | Price | Notes |
|---|---|---|
Free | $0 | Quick tasks, a lightweight model in the desktop app, subject to rollout |
Go | $8 a month | Lightweight coding tasks |
Plus | $20 a month | CLI, IDE, web and iOS; extra usage via ChatGPT credits |
Pro | $100, $200 or $500 a month | No five-hour limit on current Pro plans |
Business | Per seat | No training on business data by default |
Enterprise | Contract | SCIM, EKM, controls |
API key | Per token | For CI and shared environments |
Plus and Standard Business usage is shown as local messages per five-hour window. The ranges depend on the model and OpenAI calls them estimates.
Gemini CLI
There is no consumer plan to buy through it any more. The cost is whatever your organization pays for Code Assist, or per-token charges on a Gemini API key or a Vertex AI project. The README does not publish a per-seat price.
For an individual who wanted Google's models, the README says free access and Google AI Pro and Ultra moved to Antigravity CLI. Google AI Pro is $19.99 a month on Google's pricing, and we covered what it includes in ChatGPT vs Claude vs Gemini.
Installing and signing in
Codex
npm install -g @openai/codex
codexSign in with your ChatGPT account or set an API key. The CLI docs describe resuming sessions, adding images, live web search, delegating focused work to specialised agents, approval modes with a visible sandbox, and a review command that reports prioritised findings without changing the working tree.
Gemini CLI
npx @google/gemini-clior install globally with npm or Homebrew. The README lists three ways in:
- Sign in with Google, for a paid Code Assist license from your organization. Set
GOOGLE_CLOUD_PROJECTfirst. - Gemini API key from Google AI Studio, exported as
GEMINI_API_KEY. The README pitches this for developers who want model control or usage-based billing. - Vertex AI, the enterprise route, with
GOOGLE_API_KEYandGOOGLE_GENAI_USE_VERTEXAI=true.
Pick a model per run with gemini -m <model>. Add folders with --include-directories.
Context, memory and extensions
Both read a project file that tells the agent how to work in your repo. Codex reads AGENTS.md, which has become a common format that several agents share. Gemini CLI reads GEMINI.md. If you use both, keep one file and have the other point to it, or the rules drift.
On extensions, the Gemini CLI README says you can share MCP servers and extensions, and lists an MCP client and server package. Codex lists MCP servers among CLI features and supports skills, as we noted in Claude Code vs Codex. For ready-made servers, start with our best MCP servers page and check each listing for the per-agent install line.
Scripting and CI
Both can run without a human in the loop. Codex has codex exec, and OpenAI documents an API key for automation in shared environments. Gemini CLI has gemini -p for a one-shot prompt, with --output-format json and stream-json for machine-readable output.
For a pipeline, check three things before you commit: how the tool authenticates without a person, what it is allowed to touch, and how you cap spend. On Codex, the API key route is pay per token. On Gemini CLI, the Vertex route runs on a billing account, so your cloud budget alerts cover it.
Privacy and data handling
OpenAI's page says Business plans carry no training on business data by default.
For Gemini CLI, the data terms depend on the route: Code Assist license, Gemini API paid tier or Vertex AI.
Because both are open source, you can read what each sends. Apache-2.0 permits that audit and lets you fork. It does not tell you what the model vendor does with the data once it arrives.
Limits and gotchas
- Gemini CLI is not tuned for Gemini 4 and later, per its own README. If you use it for newer Google models, expect gaps.
- Do not benchmark models with it. The README says the harness produces unrepresentative scores for Gemini 4 and later.
- Codex limits are estimates, not fixed message counts.
- Codex Free depends on rollout for the desktop model.
- Two sign-in worlds in Google's lineup. Gemini CLI, Antigravity CLI and the Gemini API CLI do different jobs. Read the README table before you install.
- Naming drift. Both vendors rename plans and models often. Click through.
Who should pick which
An individual developer
Codex. If you want Google's models, use Antigravity CLI. See Antigravity vs Claude Code for what that product is.
A company on Google Cloud
Gemini CLI, under your Code Assist license, so billing and policy sit with the cloud account you already run. Check whether Codex under ChatGPT Business is also approved by your security team, since many companies allow more than one.
A team that wants one agent across vendors
Neither locks you in. Both read a project file and support MCP. Keep your rules in one AGENTS.md-style file and your tools in MCP servers, and switching agents becomes a small job.
A tinkerer who wants to read source
Both repositories are open under Apache-2.0. Codex ships in more forms, and Gemini CLI has weekly stable releases and daily nightlies.
Moving from one to the other
If your organization is deciding between them, or you are moving off Gemini CLI because of the change above, the move is mostly configuration.
- Instructions. Copy
GEMINI.mdtoAGENTS.md, or keep one and link the other. Remove anything specific to Google's tooling. - MCP servers. Gemini CLI keeps them in
~/.gemini/settings.json. Re-add each one with Codex's own configuration, then test that every tool call works before you trust the setup. - Scripts. Replace
gemini -pcalls withcodex exec. Re-check the output format your scripts parse, since JSON shapes differ between tools. - Auth in CI. Swap the Gemini API key or Vertex credentials for an OpenAI API key, stored the way your pipeline stores other secrets.
- Spend. Set a budget on the new account before the first run, not after.
- Review. Run both on the same ticket for a week and compare the diffs you merge.
A first-hour test for either tool
Pick a bug you already understand, so you can judge the answer. Write the failing test yourself. Ask the agent to make it pass without touching the test. Note how many times it asks permission, whether it ran the tests, and whether the diff is small. Then ask it to explain the change in two sentences. A tool that cannot explain its own diff is a tool you will not trust in review. Repeat on a second, less familiar part of the codebase, because that is where agents show their weaknesses.
Keeping the tool stable
Agents change faster than most developer tools, so pin what you can.
Gemini CLI publishes on three channels according to its README: a weekly stable release, a weekly preview and a daily nightly. For a team, that means choosing a channel on purpose. Stable is the default for work that has to run next Monday. Preview shows you next week's behaviour. Nightly is for the people who maintain your internal setup, not for the rest of the team. If you install through npx @google/gemini-cli, you may pick up a new version on every run, so install globally and upgrade deliberately when you care about repeatability.
Codex installs through a script, npm or Homebrew, and the repository publishes binaries for macOS (arm64 and x8664) and Linux (x8664 and arm64). A CI job that must be reproducible should install a fixed version and cache it, not fetch the latest on each run.
For both, write the version into the same place you record your Node and Python versions, and re-run your standard test task after each upgrade. A harness update can change which tools the agent calls or how it asks for approval, and you want to find that on a Tuesday, not in the middle of a release.
Which route an organization should price first
If your security review already covers | Price this first |
|---|---|
ChatGPT Business or Enterprise | Codex under that plan |
Google Cloud, with Code Assist licences | Gemini CLI under Code Assist |
Neither, and you buy models by API | Codex with an API key, or Gemini CLI with a Gemini API key or Vertex AI |
The plan you already have is the cheapest to approve, because the contract, the data terms and the billing owner exist. A tool that needs a new vendor review costs weeks, whatever its price. That is why the account question outweighs almost every feature on this page.
Common questions
Is Gemini CLI still free? Not for individuals. Its README says free individual access moved to Antigravity CLI on 18 June 2026.
Can I still use a Gemini API key with it? Yes. The README lists a Gemini API key from Google AI Studio as one of three ways in, aimed at people who want model control or usage-based billing.
Do both read the same instruction file? No. Codex reads AGENTS.md and Gemini CLI reads GEMINI.md. One can point to the other.
Which has the larger set of surfaces? Codex: CLI, IDE extension, desktop app, web and iOS. Gemini CLI is a terminal tool with a VS Code companion.
Should I benchmark models with Gemini CLI? The README says not to, because the harness is not tuned for Gemini 4 and later.
Our take
The page title suggests a rivalry, and the facts say otherwise. Google has narrowed Gemini CLI to a role, and the individual user is no longer its audience. That leaves Codex as the more open door for one person, and Gemini CLI as a fit for a company already inside Google Cloud.
We did not test either on a shared task, and we do not rank their output. The README of Gemini CLI itself warns against using its harness to compare models, and we take that as a reason for caution about any quick comparison. The decision that matters is account and billing: which vendor already holds your contract, and which security review you have passed. After that, try both on one real bug and keep the one whose diff you would merge.
Related pages
Questions
Is Gemini CLI still free?
Not for individuals. The project README says free individual access and Google AI Pro and Ultra access moved to Antigravity CLI on 18 June 2026, and that Gemini CLI is designed for Gemini Code Assist Standard or Enterprise licenses.
Are both open source?
Yes. The Codex CLI repository and the Gemini CLI repository are both licensed Apache-2.0.
Which one should an individual developer pick?
Codex, if you want an Apache-2.0 terminal agent with a free entry through ChatGPT. For Google's models as an individual, the README points you to Antigravity CLI instead.
Can Gemini CLI use an API key?
Yes. The README lists a Gemini API key from Google AI Studio and Vertex AI as sign-in routes, for developers who want model control or usage-based billing.
Loading poll...
Reviews
Loading reviews…
Only members can review this page. Sign in