Developer Tools

Claude Code vs Codex CLI vs Antigravity: Install Commands And Which To Pick

Install Claude Code, Codex CLI, and Google Antigravity in the terminal, compare the three AI coding agents, and fix command not found and sign-in errors.

Claude Code vs Codex CLI vs Antigravity: Install Commands And Which To Pick editorial image

Updated June 1, 2026. Three prominent terminal coding agents now sit side by side: Anthropic's Claude Code, OpenAI's Codex CLI, and Google's Antigravity CLI, which replaced Gemini CLI in May 2026. If you just want the install line and a decision, here it is, and the rest of this guide is the detail behind it.

The Fastest Install Path For Each

Claude Code's recommended path is its native installer; Codex CLI is quickest via npm or Homebrew. If you go the npm route, the Node.js versions differ: Claude Code wants Node 18 or newer, while Codex's guidance points to Node 22 or newer.

curl -fsSL https://claude.ai/install.sh | bash   # Claude Code (macOS/Linux/WSL); then run: claude
npm install -g @openai/codex                      # Codex CLI (Node 22+); then run: codex

Antigravity CLI installs through Google's own installer rather than npm, so grab the current command from the official Antigravity site (more on why you copy installer commands from the vendor, not a blog, below).

Which one to pick, in one sentence each: choose Claude Code if you want the most careful, review-first agent for real refactoring; choose Codex CLI if you live in ChatGPT and want sandboxed, delegated tasks; choose Antigravity if you want Google's faster, parallel-agent platform. Many developers end up installing two of them and switching by task. They do not conflict, so trying more than one costs nothing but disk space.

What These Three Actually Are

All three run in your terminal, read and edit files, and can run commands, but their personalities differ.

Claude Code is terminal-native and approval-first: it proposes changes and waits for you, which makes it calm to supervise on a codebase you care about. Codex CLI started as a lightweight terminal tool and grew into a family — CLI, IDE, and cloud — built around delegating tasks and getting results back, so it leans async. Antigravity is the most ambitious: an agent-first platform where the CLI shares the same engine as Google's desktop app and can dispatch several agents working in parallel, which is the bet that you would rather steer a small fleet than babysit one worker.

Picture a developer who has a flaky test suite to untangle on Monday and a throwaway scraping script to bang out on Tuesday. The same person reasonably wants the careful, ask-before-it-edits agent for Monday and the fast, just-do-it agent for Tuesday. That is the real reason people install more than one: the question is rarely "which is best" in the abstract, but "which fits the thing in front of me right now."

Our read after watching these tools settle: the install command is the least important part of this decision. All three are a minute to set up. What actually costs you a week is picking the wrong autonomy level for the task, so weight your choice on how much supervision you want, not on setup friction.

Installing Claude Code

Anthropic now treats the native installer as the recommended path, because it needs no Node.js, sets up your PATH for you, and auto-updates in the background. The commands come from claude.ai, a stable first-party domain:

# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

On macOS you can also use Homebrew, and on Windows there is WinGet:

brew install --cask claude-code      # macOS
winget install Anthropic.ClaudeCode  # Windows

If you would rather manage it through Node, the npm package is still fully supported and requires Node.js 18 or newer:

npm install -g @anthropic-ai/claude-code
claude

A few notes that save time:

  • Check your Node version with node --version before the npm route. If Node is old or PATH is fussy, the native installer is the calmer choice.
  • Do not use sudo npm install -g. It causes permission and ownership problems that are annoying to undo; fix your npm prefix instead (see troubleshooting).
  • First run launches a sign-in flow. Claude Code needs a paid Claude plan (Pro, Max, Team, or Enterprise) or a Console/API account; the free Claude.ai plan does not include it.

Updating depends on how you installed: native installs update themselves (or run claude update), Homebrew uses brew upgrade claude-code, and npm uses npm install -g @anthropic-ai/claude-code@latest.

Installing Codex CLI

Codex CLI has the most install options, which is convenient but also where people pick the wrong package.

npm install -g @openai/codex      # npm (needs Node.js 22+)
brew install --cask codex         # Homebrew on macOS
codex --version                   # verify

The trap worth calling out: the package is @openai/codex, with the @openai/ scope. There is an unrelated, ancient codex package on npm from a different project; installing that gives you a tool that has nothing to do with OpenAI. Always include the scope. One more gotcha that bites people: the npm route expects a current Node.js, and Codex's setup guidance points to Node 22 or newer — a step higher than Claude Code's Node 18. An older Node can let the install finish and then fail at runtime, so check node --version first, or use the Homebrew cask or the prebuilt binary, which sidestep Node entirely.

After install, run codex and sign in with your ChatGPT account, or authenticate with an API key if you would rather pay per use. On the access question, OpenAI's own pages are worth reading rather than trusting a flat summary: Codex is available across ChatGPT tiers, but sustained CLI use realistically wants a paid plan (Plus and up) or an API key with billing, since free access is limited. Check the current plan details in the OpenAI Help Center link below before assuming your account qualifies. There is also an official curl-based installer for macOS and Linux, documented on the Codex CLI page in the sources; the same vendor-copy caution applies to it.

Installing Antigravity CLI

Antigravity is the newcomer of the three and the one to install most carefully, because it does not come from npm. It uses Google's own installer rather than a package manager, so the right move is to follow the official Antigravity download or setup page for the current method. It replaced Gemini CLI on May 19, 2026, per Google's transition announcement, which also says the old Gemini CLI and Gemini Code Assist extensions stop serving requests for consumer Google AI plans and free users on June 18, 2026 — so if you were on Gemini CLI, migrating is not optional for long.

Get the exact install command from that official page rather than from a URL printed in a blog (including this one), which could drift or be typo-squatted. Sign-in uses a Google account.

That is not me dodging the command. It is the correct habit for any installer of this shape, which is the next section.

A Quick Security Note On "curl | bash"

The native installers for these tools often look like curl ... | bash or, on Windows, irm ... | iex. That pattern downloads a script and runs it immediately with your user permissions. It is normal and widely used, but it has a real failure mode: if you paste a URL you copied from a random blog or forum, you are trusting that blog's accuracy and its author's integrity, not the vendor's.

Two habits remove almost all of that risk:

  • Copy the install command only from the vendor's own documentation or download page, over HTTPS, not from third-party write-ups (including this one).
  • If you want to see what you are about to run, download the script first, open it, then execute it, instead of piping straight into the shell.

For the npm tools this matters less, because the package name is the trust anchor and is easy to verify. For the curl-style installers, the URL is the trust anchor, so it is worth getting from the source.

When Each One Fits

If you want…Reach forWhy
Careful edits on a codebase you ownClaude CodeApproval-first flow is easy to supervise; strong on complex refactors
Delegated, sandboxed tasks from a ChatGPT planCodex CLIAsync task model and multiple install paths; reuses your ChatGPT login
Speed and parallel agentsAntigravityShares Google's agent engine; built for fast, parallel work
To not commit to oneAny two of themThey install independently and do not conflict

Deliberately missing from that table: hard benchmark numbers. Public scores for speed, context size, and coding accuracy shift with almost every release, and a number that looks decisive today is often stale within weeks. If a benchmark will decide your choice, check the current figures at the time you read this rather than trusting a frozen table.

Common Install Problems, Fixed

The same handful of issues account for most failed installs across all three tools.

  • "command not found" after a successful npm install. This is the number-one issue, and it is almost always PATH, not a broken install. npm put the binary in its global bin directory, but your shell does not look there. Run npm config get prefix, then make sure that path's bin subfolder is on your PATH in your shell profile, and open a new terminal. On Windows, restart the terminal so PATH changes load.
  • Permission errors during a global npm install. The fix is not sudo. Set npm's prefix to a directory you own (or use a Node version manager), which avoids writing to system folders entirely. The vendor's native installer also sidesteps this since it does not use npm.
  • Old Node.js. Versions matter and they differ: Claude Code's npm package wants Node 18 or newer, while Codex CLI wants Node 22 or newer and can install on an older Node and then fail at runtime. node --version tells you where you stand; upgrade Node, or use a native installer that bundles its own runtime.
  • Sign-in fails or loops. Confirm your account actually has working access: Codex signs in with a ChatGPT account (with sustained use wanting a paid plan or an API key), Claude Code needs a paid Claude plan or a Console/API account, and Antigravity needs a signed-in Google account. If the browser handoff hangs, fully quit the tool and run it again to restart the sign-in. On Windows, if codex or claude dies with "running scripts is disabled on this system," that is PowerShell's execution policy, not the tool.
  • It worked yesterday, not today. Update first before debugging anything deeper: npm install -g <package>@latest, or let the native installer self-update. A surprising share of "sudden" breakage is just a version behind.

The Bottom Line

The installs themselves are short: two npm one-liners and one vendor script. The real decision is fit, not setup. Pick Claude Code for careful quality, Codex CLI if you are already in the ChatGPT ecosystem, and Antigravity for Google's fast parallel-agent approach — and since they coexist cleanly, the cheapest way to decide is to install two and let a week of real work pick the winner. Just copy any curl | bash line from the vendor, not from a blog, including this one.

Source Links