Gemini CLI vs Codex: free and open against paid and sandboxed

These two terminal agents are separated by one fact each. Gemini CLI is free at a volume most people never exhaust. Codex confines itself with operating-system facilities a model cannot argue with. Almost every other difference follows from those two.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Gemini CLI is Apache 2.0 and free with a personal Google account at 60 requests per minute and 1,000 per day, with a 1M token context window. Codex needs a paid ChatGPT plan from $20/mo and adds an OS-enforced sandbox with three capability modes and four approval policies. Pick Gemini CLI for cost and context, Codex for unattended runs you are not watching.

What you need to know
  • Gemini CLI is free: 60 requests/min, 1,000/day on a personal Google account.
  • Codex requires a paid ChatGPT plan. There is no free tier.
  • Only Codex has an OS-enforced sandbox that a prompt cannot talk past.
  • Gemini CLI ships a 1M token context window on the free tier.
  • Both do MCP, both run headless, both read a repo context file. The names differ.

Side by side

Checked against vendor documentation, August 2026.

Gemini CLICodex CLI
Cost to startFree, personal Google accountPaid ChatGPT plan, from $20/mo
LicenceApache 2.0Open source, vendor-run models
Free tier60 req/min, 1,000 req/dayNone
Context window1M tokensLarge, model-dependent
SandboxOpt-in: Docker image or Seatbelt profileOn by default, OS-enforced
Approval control3 modes4 policies, independent of the sandbox
Repo context fileGEMINI.mdAGENTS.md
Config file~/.gemini/settings.json~/.codex/config.toml
MCP serversYesYes
Headlessgemini -p, JSON outputcodex exec
Written inTypeScript, on NodeRust
WindowsNativeWindows 11 via WSL2

The free tier, in numbers

Gemini CLI is the only serious terminal agent with a free tier that is a product rather than a trial. Signing in with a personal Google account gives you 60 requests per minute and 1,000 requests per day, with Gemini 3 models and a 1M token context window, as of August 2026.

What each authentication route gives you, August 2026.

RouteLimitWhen to use it
Google account sign-in60/min, 1,000/dayAlmost everyone. No key to manage.
Gemini API key1,000/day on Gemini 3, then billedYou want to pin a specific model
Vertex AIScalable, enterprise controlsCompliance, data residency, org billing

A thousand requests a day is not a marketing number that collapses under real use. A request is one turn, so a busy day of interactive agent work on a large repository is a few hundred. You have to be running long unattended loops before that ceiling is the thing that stops you.

Installing both, August 2026.
# Gemini CLI
npm install -g @google/gemini-cli
# or: brew install gemini-cli
# or run it once: npx @google/gemini-cli

# Codex CLI
npm install -g @openai/codex
# or: brew install codex

gemini --version
codex --version

Containment is where Codex is alone

Codex separates two things most tools conflate: what the agent is capable of, and when it stops to ask. The first is enforced by the operating system, using Seatbelt on macOS and Landlock plus seccomp on Linux. A model cannot be persuaded past it, because the model is not the thing enforcing it.

Codex: two independent dials.

SettingValuesEnforced by
sandbox_moderead-only, workspace-write, danger-full-accessThe kernel
approval_policyuntrusted, on-failure, on-request, neverYour attention

Gemini CLI: approval modes, with the sandbox opt-in.

SettingValuesNotes
--approval-modedefault, auto_edit, yolo--yolo is the legacy spelling of the third
SandboxDocker image, or a macOS Seatbelt profileEnabled automatically with yolo

Gemini CLI does have containment, and it is real: a prebuilt gemini-cli-sandbox container, a project-level .gemini/sandbox.Dockerfile when you need your own toolchain inside it, and named macOS Seatbelt profiles selected with SEATBELT_PROFILE (permissive-open is the default, through to strict-proxied). The difference is posture. Codex is confined unless you opt out; Gemini CLI is unconfined unless you opt in or turn on yolo, which enables the sandbox for you precisely because that mode stops asking.

Context files and config

Both read a markdown file from the repository so you are not re-explaining your conventions every session. The mechanism is the same idea with different names, and if you run both you will end up maintaining both.

Gemini CLICodex CLI
Repo instructionsGEMINI.mdAGENTS.md
User settings~/.gemini/settings.json~/.codex/config.toml
Project settings.gemini/settings.json, overrides userPer-project config plus CLI overrides
One-off overrideFlagscodex -c key=value
Custom commandsYes, plus extensionsYes

Headless and CI

Both run without a TUI, which is what a pipeline needs. The shapes differ slightly and the licensing differs a lot.

Non-interactive runs.
# Gemini CLI: prompt in, structured output back
gemini -p "summarise the failing tests in this repo"
gemini -p "list every TODO with its file" --output-format json

# Codex: exec subcommand, read-only for an analysis job
codex exec --sandbox read-only "explain the auth flow"

Which for which job

If you arePickWhy
Trying agentic coding at allGemini CLIIt costs nothing and it is a real agent
A student or on a side projectGemini CLIThe free tier is the whole answer
Asking whole-repo comprehension questionsGemini CLI1M tokens in one pass
Already paying for ChatGPTCodexYou already own it
Letting an agent run while you do something elseCodexThe sandbox is enforced, not requested
Exploring a repository you do not trustCodexread-only plus never: free rein, zero write capability
On Windows without WSLGemini CLICodex wants WSL2 on Windows 11
Running several agents in parallel worktreesEitherBoth are one process per checkout

Running both

There is very little argument against having Gemini CLI installed even if Codex is what you pay for. It covers two cases the paid agent cannot: a second opinion when the first one is going in circles, and continuing to work after you have exhausted a subscription window.

  1. Write AGENTS.md first and point GEMINI.md at it, so both agents read the same conventions.
  2. Give each agent its own git worktree. Two agents in one checkout will overwrite each other, and the failure is silent.
  3. Keep Codex on workspace-write plus on-request, which is the default and is correct.
  4. Send whole-repo questions to Gemini and edit-and-verify loops to Codex. That split plays to each one directly.

Questions people ask

Yes. Signing in with a personal Google account gives 60 requests per minute and 1,000 per day with Gemini 3 models and a 1M token context window, as of August 2026. The tool itself is Apache 2.0.

No. Codex requires a paid ChatGPT plan, starting at Plus at $20 a month, or an OpenAI API key billed per token. There is no free Codex tier.

For cost and for whole-repository questions, Gemini CLI. For work you leave running unattended, Codex, because its sandbox is enforced by the operating system rather than by a prompt.

It has one, but it is opt-in rather than the default. Gemini CLI can run inside a prebuilt Docker image or under a named macOS Seatbelt profile, and it enables the sandbox automatically in yolo mode. Codex sandboxes every session unless you choose danger-full-access.

Not by default. Codex reads AGENTS.md and Gemini CLI reads GEMINI.md. Writing AGENTS.md and symlinking GEMINI.md to it keeps one source of truth.

Gemini CLI, at 1M tokens on the free tier as of August 2026. That is what makes single-pass questions about an entire repository practical rather than a series of summaries.

Gemini CLI installs natively through npm or Homebrew. Codex documents Windows 11 support through WSL2, so on Windows the Codex path involves a Linux environment.

Both run headless, with codex exec and gemini -p. Licensing is the constraint rather than capability: a ChatGPT subscription covers one person working interactively, so automation belongs on an API key. Check the Gemini free tier terms before automating against it.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Gemini CLI on GitHub
  2. OpenAI Codex documentation
  3. ChatGPT plans and pricing
  4. AGENTS.md specification
Try it

Free and paid,
one workbench.

Continuum runs Gemini CLI and Codex side by side, each in its own worktree, with a live quota gauge per account.

free app · your subscriptions · local-first