# Codex vs Gemini CLI: which terminal agent to pick in 2026

URL: https://agentvera.dev/en/blog/codex-vs-gemini-cli/ · Published: 2026-10-24

Codex vs Gemini CLI: sign-in and pricing, models, reasoning effort, sandbox and approvals, session resume, MCP and install, plus running both in AgentVera.

**In short:**

- Codex is included in every ChatGPT plan, Free included, while Gemini CLI stopped serving unpaid tier and Google One users on June 18, 2026.
- Codex has an OS-level sandbox with read-only, workspace-write and full-access modes; Gemini CLI has four approval modes and an optional sandbox.
- Both CLIs are open source under Apache 2.0, read project instructions from a file and connect to MCP servers.

**Codex vs Gemini CLI comes down to which account you already pay for and how much isolation you want.** Codex is OpenAI’s terminal agent: it signs in with ChatGPT, runs GPT models and sandboxes every command at the OS level. Gemini CLI is Google’s: it signs in with a Google account, a Gemini API key or Vertex AI, runs Gemini models and gives you four approval modes plus an optional sandbox. Both are open source under Apache 2.0, both read a project instructions file, and both connect to MCP servers.

The biggest difference at the time of writing (October 2026) is access. Codex is included in every ChatGPT plan, the free one too. Gemini CLI stopped serving unpaid tier and Google One users on June 18, 2026; those users were moved to Antigravity CLI. This post walks through sign-in and pricing, models, reasoning effort, sandbox and approvals, session resume, MCP and install, then shows how to run both together. No benchmark scores; they change with every model release.

## Codex and Gemini CLI at a glance

| | Codex | Gemini CLI |
| --- | --- | --- |
| Maker | OpenAI | Google |
| License | Apache 2.0 | Apache 2.0 |
| Sign in | ChatGPT account or API key | Google account, `GEMINI_API_KEY` or Vertex AI |
| Free use | Included in ChatGPT Free | Not for unpaid tier since June 18, 2026 |
| Models | OpenAI GPT models | Gemini models (`auto`, `pro`, `flash`, `flash-lite`) |
| Reasoning effort | Per model, set in `/model` or `config.toml` | No effort flag |
| Sandbox | On by default, OS level | Off by default, `--sandbox` to enable |
| Approvals | `--ask-for-approval`, `/permissions` | `--approval-mode` default, auto_edit, plan, yolo |
| Instructions file | `AGENTS.md` | `GEMINI.md` (configurable) |
| Resume | `codex resume`, `/resume`, `codex fork` | `--resume latest`, `--list-sessions` |
| MCP | `codex mcp`, `~/.codex/config.toml` | `gemini mcp add`, `~/.gemini/settings.json` |

## Sign-in and pricing

### Codex

Codex asks you to sign in on first run. **Sign in with ChatGPT** is the recommended path, and usage then counts against your ChatGPT plan. You can also use an OpenAI API key; that bills at standard API rates and leaves out the cloud features.

At the time of writing (October 2026), OpenAI lists Codex in ChatGPT Free ($0), Go ($8/month), Plus ($20/month), Pro (from $100/month), Business ($20 per user per month billed annually, $25 monthly), Edu and Enterprise. Higher plans give higher usage limits. Check the current numbers on [OpenAI’s Codex pricing page](https://learn.chatgpt.com/docs/pricing "Codex pricing").

### Gemini CLI

Gemini CLI offers three ways in: **Sign in with Google**, a **Gemini API key** in `GEMINI_API_KEY`, or **Vertex AI** for Google Cloud projects. Paid Gemini Code Assist licenses also need `GOOGLE_CLOUD_PROJECT` set.

The catch is the June 2026 change. Google’s notice in the repository says unpaid tier and Google One users were moved to Antigravity CLI on June 18, 2026, and that Gemini CLI is not optimized for Google’s newest models. So at the time of writing, Gemini CLI is a tool for paid API keys, Vertex AI and Code Assist Standard or Enterprise. API usage is billed per token; see [Google’s Gemini API pricing](https://ai.google.dev/gemini-api/docs/pricing "Gemini API pricing") for current rates. If you were on the free tier, read [Gemini CLI vs Claude Code](/en/blog/gemini-cli-vs-claude-code/ "Gemini CLI vs Claude Code") for the details of the move.

## Models and reasoning effort

Codex runs OpenAI’s GPT models. Pick one with `--model` (or `-m`) at launch or `/model` inside a session; `/model` also sets the reasoning effort when the model supports it. To make it stick, set `model` and `model_reasoning_effort` in `~/.codex/config.toml`, or in a project’s `.codex/config.toml`.

Gemini CLI’s `--model` (`-m`) defaults to `auto` and takes the aliases `pro`, `flash` and `flash-lite` as well as full model names. It has no reasoning-effort flag; you choose a faster or a stronger model instead.

## Sandbox and approval modes

### Codex

Codex separates two things: what a command **can** touch (the sandbox) and when it **asks** you (approvals).

- `--sandbox read-only`: it can read, but not write or reach the network.
- `--sandbox workspace-write`: it can edit inside the workspace.
- `--sandbox danger-full-access`: no sandbox.
- `--ask-for-approval on-request` or `never` controls the prompts, and `/permissions` switches between presets such as Auto and Read Only in a running session.

The sandbox is enforced by the OS: Seatbelt on macOS, bubblewrap and seccomp on Linux, a native sandbox on Windows. `--add-dir` gives write access to one more folder. `--dangerously-bypass-approvals-and-sandbox` turns everything off and is meant only for a dedicated, isolated machine.

### Gemini CLI

Gemini CLI’s `--approval-mode` has four values:

- `default`: asks before edits and commands.
- `auto_edit`: applies file edits without asking, still asks for other tools.
- `plan`: read-only planning.
- `yolo`: approves everything. The old `--yolo` flag still exists but is deprecated in favor of `--approval-mode=yolo`.

The sandbox is off by default. `--sandbox` (`-s`) turns it on, and you can choose a backend such as Seatbelt on macOS or a Docker or Podman container. Gemini CLI also has checkpointing, so you can roll back file changes an agent made. For a wider view of these risks, see [AI coding agent security](/en/blog/ai-coding-agent-security/ "AI coding agent security").

## Session resume

- **Codex:** `codex resume` opens a picker, `codex resume --last` continues the latest session, and `/resume` does it from inside a session. `codex fork` starts a new branch from a past session, so you can try two directions from the same point.
- **Gemini CLI:** `gemini --resume latest` continues the last session, `--resume 5` picks one by index, and `--list-sessions` lists the sessions of the current project.

## Instruction files and MCP

Codex reads **`AGENTS.md`** in your repo, and `/init` writes a starter one. Gemini CLI reads **`GEMINI.md`**, but `context.fileName` in `settings.json` can be set to `["AGENTS.md", "GEMINI.md"]`. Keep shared rules in `AGENTS.md` and both agents follow them.

Both speak the [Model Context Protocol](/en/blog/what-is-mcp-server/ "What is an MCP server?"). In Codex, `codex mcp add`, `list`, `remove` and `authenticate` manage servers, stored in `~/.codex/config.toml`. In Gemini CLI, `gemini mcp add <name> <command>` adds a stdio server, stored under `mcpServers` in `~/.gemini/settings.json`. Same servers, two config files.

## Install

```bash
# Codex
npm install -g @openai/codex
brew install --cask codex
curl -fsSL https://chatgpt.com/codex/install.sh | sh

# Gemini CLI
npm install -g @google/gemini-cli
brew install gemini-cli
npx @google/gemini-cli   # try without installing
```

On Windows, Codex also has a PowerShell installer: `irm https://chatgpt.com/codex/install.ps1 | iex`.

## Strengths, honestly

**Codex** is strongest when you already pay for ChatGPT: no extra bill, limits that scale with your plan, a sandbox that is on by default, and `codex exec` for scripts and CI. Its read-only and workspace-write modes make it a safe agent to leave running.

**Gemini CLI** is strongest for teams already on Google Cloud: Vertex AI and Code Assist licenses fit straight in, the sandbox can run in a container, and `auto_edit` is a handy middle ground between asking for everything and asking for nothing. Its weak spot right now is access: personal accounts have moved to Antigravity CLI.

## Codex and Gemini CLI in AgentVera

AgentVera is a desktop app for macOS, Windows and Linux that runs 18 terminal coding agent CLIs side by side in real terminals, in a grid per project, with your existing logins. [Codex](/en/agents/codex/ "Codex in AgentVera") and [Gemini CLI](/en/agents/gemini-cli/ "Gemini CLI in AgentVera") are both in the New agent dialog; Gemini CLI stays dimmed until you install it.

| Need | In AgentVera |
| --- | --- |
| Sign in | Codex uses your existing login; each added account gets its own `CODEX_HOME`. Gemini CLI uses its own Google login or `GEMINI_API_KEY` |
| Pick a model | Codex models are read live with `codex debug models`; for Gemini CLI, leave it empty for the default or pick one, passed with `--model` |
| Reasoning effort | Codex: a slider with the levels the model offers. Gemini CLI: none |
| Permissions | Ask, Auto or Full access per agent, limited to the levels each CLI supports |
| Keep sessions | Codex continues from its local history and can fork with `codex fork`; Gemini CLI starts with its own `--session-id` and reopens with `--resume` |
| Shared tools | AgentVera’s [MCP servers](/en/features/mcp-manager/ "MCP manager") and its browser attach to both on every launch |
| Separate folders | Each agent in its own [git worktree](/en/blog/git-worktree-parallel-agents/ "Git worktrees for parallel agents") |
| Check the work | [Automatic code review](/en/features/code-review/ "Automatic code review"): at turn end, the Claude model you choose reviews the turn’s commits or all changes |
| Chain agents | [Flows](/en/features/flows/ "Flows"): both can be a source or a target (Pro and Team) |

A flow is where the pair pays off. Say Codex writes and Gemini CLI reviews: when Codex finishes its turn, its last reply goes into your template (`{{output}}`, `{{source}}`, `{{target}}`) and is sent to Gemini CLI. If Gemini CLI is busy, the flow waits; a turn limit stops the loop. You can add Condition, Wait, Transform, Notify or Human approval nodes in between, and approve from Telegram when you are away.

Codex also gets the extras that only some CLIs support: [account switching](/en/features/account-switching/ "Account switching") with account chains that move to the next account when the 5-hour or weekly limit runs out (Pro and Team), the remaining limits of each account, a Lean context profile, and running in Docker. Gemini CLI has no extra-instructions flag, so AgentVera’s Role field doesn’t reach it; put the rules in `AGENTS.md` or `GEMINI.md`.

### A simple setup

1. Put shared rules in `AGENTS.md` and add it to Gemini CLI’s `context.fileName`.
2. Open a Codex agent and a Gemini CLI agent in the same project, each in its own worktree.
3. Register your MCP servers once in AgentVera so both get them.
4. Turn on automatic code review in project settings.
5. On Pro or Team, add a flow from Codex to Gemini CLI with a review prompt and a turn limit.

The grid, worktrees, code review and the MCP manager are on the free plan. [Download AgentVera](/en/download/ "Download AgentVera") and compare both on your own repo. For more pairs, see [Claude Code vs Codex](/en/blog/claude-code-vs-codex/ "Claude Code vs Codex") and [the best AI coding CLI tools](/en/blog/best-ai-coding-cli-tools/ "Best AI coding CLI tools").

## Which to choose

Pick **Codex** if you have a ChatGPT plan, want a sandbox that is on by default and like strict read-only or workspace-write modes. Pick **Gemini CLI** if your team pays for Gemini through Google Cloud or a Code Assist license and you want container sandboxes. If you are on a free Google account, look at Antigravity CLI instead. And if you have access to both, run them side by side and let one check the other.

## Frequently asked questions

**Is Codex or Gemini CLI free?** At the time of writing (October 2026), Codex is included in ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise, with usage limits that grow with the plan. Gemini CLI no longer serves unpaid tier and Google One users since June 18, 2026; it works with paid Gemini API keys, Vertex AI and Gemini Code Assist Standard or Enterprise.

**Which one has the stronger sandbox?** Codex sandboxes every command at the OS level by default (Seatbelt on macOS, bubblewrap and seccomp on Linux, a native sandbox on Windows) and lets you pick read-only, workspace-write or danger-full-access. Gemini CLI runs without a sandbox unless you turn it on with `--sandbox`, but it offers several backends, including Docker and Podman.

**Can Codex and Gemini CLI share one instructions file?** Yes. Codex reads `AGENTS.md`. Gemini CLI reads `GEMINI.md` by default, but its `context.fileName` setting can include `AGENTS.md`, so one file can serve both.

**How do I resume a session?** In Codex, run `codex resume` (or `codex resume --last`), or use `/resume` inside a session; `codex fork` branches a past session. In Gemini CLI, run `gemini --resume latest` or `--resume` with a session index, and `--list-sessions` shows what you can pick.

**Can I run Codex and Gemini CLI side by side?** Yes. In AgentVera each agent runs in its own real terminal in a per-project grid, each with its own login, and you can give each one its own git worktree. A flow can send Codex’s last reply to Gemini CLI for review (flows are on Pro and Team).

---

**About AgentVera.** AgentVera is a desktop app for macOS, Windows and Linux, built by Solviera Teknoloji. It runs 18 AI coding agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor, Antigravity, opencode, Hermes, Qwen Code, Kimi Code, Kiro, Amp, Droid, Goose, Vibe, Crush, Aider, Cline) side by side, per project, in real terminals with the user's own CLI installs and logins. The free plan has unlimited agents. Download: https://agentvera.dev/en/download/ · Pricing: https://agentvera.dev/en/pricing/
