Gemini CLI is Google's terminal agent. OpenAI Codex is OpenAI's coding agent, available as a command-line tool, an IDE extension and a cloud service. Both are open source, and both let you ask for changes in plain English.
The short version
| Gemini CLI | OpenAI Codex | |
|---|---|---|
| Made by | OpenAI | |
| What it is | Terminal agent (with a VS Code companion extension) | CLI, IDE extension and cloud service |
| Open source | Yes (Apache 2.0) | Yes |
| Models | Gemini models | OpenAI models |
| Sign-in | Gemini API key, Vertex AI or Gemini Code Assist licence | ChatGPT account (Plus, Pro, Business, Edu or Enterprise recommended) or API key |
| Free plan | Free access unclear (see below) | Unclear. OpenAI lists a Free ChatGPT plan for trying Codex, but check what it includes |
| MCP servers | Yes | Yes |
| Project instructions | GEMINI.md (AGENTS.md if you configure it) | AGENTS.md |
| Install | npm install -g @google/gemini-cli, Homebrew or npx | npm install -g @openai/codex |
Pricing changes. See OpenAI's Codex page and the Gemini CLI repository for current details.
What they have in common
- Plain-English changes across files. Both are agents, not just autocomplete.
- Open source. You can read how each one works.
- MCP. Both can connect to MCP servers (a standard way to plug extra tools into an AI).
- Installed with npm. If you have Node.js, setup is one command either way.
Key differences
Cost to try. Gemini CLI was once known for free use with a Google login. Its README now says free individual access and Google AI Pro / Ultra plans moved to Google's Antigravity CLI on 18 June 2026, which Google's Developers Blog confirms. See our Antigravity CLI getting started guide and Antigravity CLI vs OpenAI Codex. What's left is Gemini API keys, Vertex AI and Gemini Code Assist Standard / Enterprise licences. Google's quota page still shows some free-tier limits, so treat free use as unconfirmed and check Google's docs. For Codex, OpenAI lists a Free ChatGPT plan for exploring it, but it isn't clear what it includes. OpenAI points to a paid ChatGPT account for regular use, and you can also use an API key.
Where you can use it. Codex comes as a CLI, an IDE extension and a cloud service. Gemini CLI is terminal-first, with a companion extension that connects it to VS Code and compatible editors.
Project instructions. Codex reads AGENTS.md. Gemini CLI uses GEMINI.md by default and can be told to read AGENTS.md through its context.fileName setting. If you want one file for several tools, Codex is the simpler fit.
Which AI is behind it. Gemini CLI runs Gemini models. Codex runs OpenAI's. We haven't compared how good each is, and it's worth trying both on your own code.
Do they work together?
Yes. They're separate command-line tools, so you can install both and try the same task in each. Keep a git safety net first: see our git guide.
Who should pick what
- You already pay for ChatGPT: Codex fits naturally.
- You use Google Cloud or Vertex AI: Gemini CLI.
- You want an IDE extension or cloud option too: Codex.
- You want one instructions file shared with other tools: Codex, or set up Gemini CLI to read
AGENTS.md.
Our verdict
Pick the one that matches the account and cloud you already use. For a similar terminal-agent comparison, see Claude Code vs OpenAI Codex.