Blog

Gemini CLI vs Codex: Access, Sandboxing and Licence

AI CodingTool Comparisons

Gemini CLI vs Codex comes down to access before features. Since June 18, 2026, Gemini CLI no longer serves free users or Google AI Pro and Ultra subscribers. It's now an open-source agent for companies on a Gemini Code Assist licence or developers with a paid Gemini API key. Codex is included with ChatGPT plans, with the CLI listed for Plus and above, and it reaches well beyond the terminal. Both CLIs are open source under Apache 2.0.

Most "Codex CLI vs Gemini CLI" articles still say Gemini CLI wins on price because it's free. That stopped being true in June. Here's the short version:

  • Pick Codex if you're an individual developer, you already pay for ChatGPT, or you want one agent across terminal, editor, desktop app and cloud
  • Pick Gemini CLI if your company has a Gemini Code Assist Standard or Enterprise licence, or you need an open-source agent you can fork and change
  • Want a no-cost Google agent instead? That's Antigravity CLI now, not Gemini CLI. It isn't open source

Quick Comparison

Gemini CLICodex CLI
Made byGoogleOpenAI
Who can sign inCode Assist Standard/Enterprise orgs, paid Gemini API keys, Vertex AIChatGPT Plus and above, or an OpenAI API key (Free and Go: desktop app only)
Personal Google or AI Pro/Ultra accountMoved to Antigravity CLINot applicable
ModelsGemini only; not tuned for Gemini 4 and laterOpenAI models
Installnpm, npx, Homebrew, MacPortsStandalone installer, npm, Homebrew
EditorsVS Code companion; JetBrains and Zed through ACPVS Code extension and forks; Xcode and JetBrains integrations
Cloud tasksNoYes, codex cloud and Codex web
SandboxOpt-in (--sandbox)On by default (workspace-write)
Context fileGEMINI.mdAGENTS.md
LicenceApache 2.0, accepts pull requestsApache 2.0, no outside code contributions
How you payOrg licence seats or per-token API billingChatGPT plan allowance, credits, or API rates

Who Can Actually Use Each One

This is the section that changed the comparison.

On May 19, 2026, Google posted an important update on transitioning Gemini CLI to Antigravity CLI. It says that on June 18, 2026, Gemini CLI and the Gemini Code Assist IDE extensions stopped serving requests for Google AI Pro and Ultra subscribers and for individuals using Code Assist at no charge. Three routes stayed open:

  • Gemini Code Assist Standard or Enterprise. Google calls access for these organizations "unchanged."
  • Paid API keys. Paid Gemini and Gemini Enterprise Agent Platform API keys still work.
  • Vertex AI on Google Cloud, listed in the repo as an enterprise option.

The Gemini CLI repository now opens with a notice saying the same thing: it's designed for Code Assist Standard and Enterprise licences and Code Assist for GitHub on Google Cloud, with "legacy" paid API and Vertex keys. It also says Gemini CLI isn't tuned for the Gemini 4 series and points those users to Antigravity CLI.

One trap. Some Gemini CLI docs pages still carry pre-June copy. At the time of writing (December 2026), the authentication page still recommends signing in with a personal Google account, and the quotas page still describes a personal free tier, right under a banner that says Gemini CLI was replaced by Antigravity CLI for unpaid and Google One users. Trust the announcement and the banner.

Codex goes the other way. OpenAI's Codex pricing page lists the CLI in its feature table for Plus, Pro, Business, Enterprise and Edu plans and for API keys. On one of those plans you run codex, choose Sign in with ChatGPT, and usage comes out of your plan's allowance. Free and Go are narrower. The Codex help article says Codex is included on both, but the pricing page lists them with one model in the desktop app, subject to rollout, and not with the CLI. The help article adds two more limits: Free and Go don't include Codex Cloud, and allowances run on 5-hour and weekly windows. Type /status in the CLI to see what's left.

So for an individual with no company licence, the real choice is usually Codex vs Antigravity CLI. Our Google Antigravity vs Codex comparison covers that matchup in full.

Install, Sign-In and Models

Gemini CLI installs with npm install -g @google/gemini-cli, runs once with npx @google/gemini-cli, or comes from Homebrew or MacPorts. You authenticate one of three ways:

  • Sign in with Google, with GOOGLE_CLOUD_PROJECT set to your organization's Code Assist project
  • A Gemini API key, billed per token
  • Vertex AI credentials

It runs Gemini models only. Google ships a stable release every Tuesday, with preview and nightly channels alongside. The latest stable at the time of writing is v0.72.0, from December 2, 2026.

Codex CLI installs with OpenAI's standalone installer on macOS, Linux and Windows, or through npm (@openai/codex) or Homebrew. The openai/codex repo recommends ChatGPT sign-in, and an API key works with extra setup. You switch models and reasoning effort with /model. API-key sessions are billed at API rates instead of your ChatGPT allowance.

Terminal Features Side by Side

The two CLIs have more in common than older comparisons suggest.

FeatureGemini CLICodex CLI
Project instructionsGEMINI.mdAGENTS.md (/init writes one)
MCP serversYes, in settings.jsonYes, codex mcp
Packaged add-onsExtensions and Agent SkillsSkills and plugins
SubagentsYes, including remote subagentsYes
Scriptinggemini -p, with JSON outputcodex exec
Saving progressCheckpointing and rewindcodex resume
Web searchBuilt-in web fetch and searchcodex --search

Gemini CLI's docs list a long feature menu: extensions, Agent Skills, auto memory, checkpointing, Git worktrees, hooks, plan mode, subagents and remote subagents, and model routing. Extensions are its packaging format for commands, MCP servers and context.

The Codex CLI docs cover a similar set: skills for repeatable instructions, plugins that connect team tools, subagents for focused work, and /review, which reports findings without touching your working tree.

If you rely on Gemini CLI extensions today, note that they carry over to Antigravity CLI as plugins, but they don't carry over to Codex. MCP servers are the portable part: both tools speak MCP.

Editors, Desktop and Cloud

This is where Codex pulls ahead on reach.

Gemini CLI stays a terminal tool with editor hooks. Its IDE integration is the Gemini CLI Companion extension for VS Code, VS Code forks and Antigravity. It shares your recent files, cursor position and selection with the CLI, and it shows proposed changes in the editor's own diff view. JetBrains IDEs and Zed connect through the Agent Client Protocol.

Codex is one agent across several surfaces:

  • IDE extension for VS Code, Cursor, Windsurf and VS Code Insiders, with separate Xcode and JetBrains integrations
  • Desktop, as Codex inside the ChatGPT desktop app
  • Codex Cloud, where each task gets its own workspace and keeps running while your computer sleeps. You can review the diff and open a pull request when it's done
  • Terminal handoff, with codex cloud to submit a task and apply the result to your local repo

There's no Gemini CLI equivalent of cloud tasks. If you want to hand off a long job and close your laptop, that's a Codex feature (on plans that include Codex Cloud).

Sandboxing and Approvals

The defaults point in different directions.

Codex sandboxes by default. Its sandboxing docs describe platform-native enforcement: Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native sandbox on Windows. The default workspace-write mode lets Codex edit files and run routine commands inside your project, and the default approval policy asks before it steps outside. Full access is something you switch on deliberately.

Gemini CLI sandboxes when you ask. Its sandbox page lists the -s flag, the GEMINI_SANDBOX variable or a settings.json setting. You get a wider choice of backends: macOS Seatbelt, Docker or Podman, a Windows sandbox, gVisor on Linux, and experimental LXC. Trusted folders add a per-folder execution policy on top.

In practice: Codex is safer out of the box on a laptop. Gemini CLI gives a platform team more ways to lock things down, if someone sets it up.

Open Source and Licence

Both repos are Apache 2.0. How open they are differs.

Gemini CLI says it's "fully open source" and welcomes pull requests, so you can fork it, patch it and send changes upstream. That makes it the more auditable choice for teams that need to read and modify their agent.

Codex opens a lot, but not everything. OpenAI's open source page lists the Codex CLI, SDK, App Server, skills and plugins as open source, and marks the IDE extension and Codex Cloud as not open source. It also says the openai/codex repo doesn't accept outside code contributions or pull requests. Issues and bug reports are welcome.

If "open source" for you means "I can fork it," both qualify. If it means "I can contribute back," only Gemini CLI does.

Gemini CLI vs Codex: Which Should You Choose?

You are...Pick
An individual on ChatGPT Plus or aboveCodex
On a personal Google account or Google AI Pro/UltraAntigravity CLI (Gemini CLI no longer serves you)
At a company with Gemini Code Assist Standard/EnterpriseGemini CLI
Someone who needs to fork and contribute to the agentGemini CLI
Someone who wants a sandbox on by defaultCodex
Handing off long tasks to the cloudCodex
Working mainly in Xcode or JetBrainsCodex (JetBrains also works with Gemini CLI through ACP)
Locked to Gemini models on Google CloudGemini CLI with Vertex AI or a paid API key

Choose Codex if you're an individual developer. The CLI comes with ChatGPT Plus and above, and Codex covers terminal, editor, desktop and cloud and starts sandboxed.

Choose Gemini CLI if your organization already pays for Gemini Code Assist, or you need an Apache 2.0 agent you can change and contribute to. Expect Google's newest models to land in Antigravity CLI first.

Comparing more broadly? Our Gemini CLI vs Claude Code post adds Anthropic's agent to the picture, Gemini CLI alternatives sorts replacements by free access and open source, and OpenAI Codex alternatives goes the other direction.

Where Taku Fits

Gemini CLI and Codex both help you write code. A lot of people don't want to write code at all. They just want to use an AI tool someone else already built.

If you'd rather run a tool someone already built than set one up yourself, that's where Taku comes in. Taku Apps and Sites, built by the best AI minds. Find one, run it, and keep it in your Mac Dock. Taku is in Beta, and the Mac app is available now.

Key Points

  • Access decides it. Since June 18, 2026, Gemini CLI serves Code Assist Standard/Enterprise orgs, paid API keys and Vertex AI, not personal or Google AI Pro/Ultra accounts
  • Codex is included in ChatGPT plans, but OpenAI lists the CLI for Plus and above. Free and Go are listed for the desktop app only and don't include Codex Cloud
  • Reach: Codex spans terminal, IDE, desktop app and cloud. Gemini CLI is a terminal tool with editor companions
  • Safety defaults: Codex sandboxes by default; Gemini CLI's sandbox is opt-in, with more backends
  • Licence: both CLIs are Apache 2.0. Gemini CLI accepts pull requests; openai/codex doesn't
  • The no-cost Google option is Antigravity CLI, which isn't open source

FAQ

Is Gemini CLI still free?

Not for individuals. Since June 18, 2026, it no longer serves free users or Google AI Pro and Ultra subscribers. It works for organizations on Gemini Code Assist Standard or Enterprise and with paid Gemini API keys. Google's Antigravity plans page says Antigravity CLI gives personal accounts a baseline quota instead.

Is Codex CLI free?

The CLI itself is open source. Using it needs a sign-in. OpenAI's pricing page lists the CLI for ChatGPT Plus and above, or you can use an OpenAI API key billed at API rates. Free and Go include Codex only in the desktop app, subject to rollout. Limits vary by plan, so check OpenAI's pricing page.

Which is better, Codex CLI or Gemini CLI?

For most individual developers, Codex, because you can actually sign in with a personal Plus or higher plan and it reaches into editors and the cloud. For companies already on Gemini Code Assist, or teams that want to modify their agent, Gemini CLI.

Can I use my Gemini CLI setup in Codex?

Partly. MCP servers work in both, so you can re-add them with codex mcp. Your GEMINI.md instructions can be copied into an AGENTS.md. Gemini CLI extensions don't carry over to Codex; they carry over to Antigravity CLI as plugins.

Are Gemini CLI and Codex open source?

Both CLIs are Apache 2.0. Codex's IDE extension and cloud aren't open source, and its repo doesn't accept outside code contributions. Gemini CLI accepts pull requests.

What replaced Gemini CLI for personal accounts?

Antigravity CLI, run as agy. On first launch it offers to import your Gemini CLI extensions and settings, and it still reads GEMINI.md and AGENTS.md files.