Skip to main content

Gemini CLI vs OpenCode

Gemini CLI now serves Google's enterprise and paid API customers and runs Gemini models. OpenCode is free for anyone and runs almost any model, Gemini included.

Gemini CLI and OpenCode are open source terminal coding agents. Each reads your repository, edits files and runs commands until a task is done. Google builds Gemini CLI under Apache 2.0. OpenCode is an MIT-licensed agent from Anomaly that connects to almost any provider. Facts on this page were checked against each tool's own docs and repository as of December 4, 2026.

What Changed With Gemini CLI​

On June 18, 2026, Google moved free users and Google AI Pro and Ultra subscribers from Gemini CLI to Antigravity CLI, which runs as agy. Gemini CLI's repository now describes it as designed for Gemini Code Assist Standard and Enterprise licenses and Code Assist for GitHub. It also works with a paid Gemini API key or Vertex AI. The repository says Gemini CLI is not tuned for the Gemini 4 series.

If you used Gemini CLI on a personal Google account, compare OpenCode with Antigravity CLI instead. Claude Code vs Gemini CLI and Antigravity CLI covers the move in detail.

Decision Table​

Gemini CLIOpenCode
LicenseApache 2.0MIT
Who can use itGemini Code Assist Standard or Enterprise, paid Gemini API keys, Vertex AIAnyone. Free with your own provider
ModelsGemini modelsAny provider in the models.dev catalog, plus local models
Default approvalsAsks before each tool callAllows every action except reading .env files
OS sandboxOptional, off unless you pass --sandboxNone
Best forTeams with a Code Assist licenseAnyone who switches models or runs local ones

At a Glance​

Gemini CLIOpenCode
Sign-inGoogle account with a Code Assist license, Gemini API key, or Vertex AIAPI keys for any models.dev provider, or ChatGPT, GitHub Copilot and Claude plan sign-in
SubscriptionsCode Assist licensesOpenCode Go $10, Go Plus $40 per month
Approval modesdefault, auto_edit, plan, and yolo from the command line onlyOrdered allow, ask and deny rules per action and resource
Sandbox methodsSeatbelt on macOS, Docker or Podman, a Windows sandbox, gVisor or LXC on LinuxNone. Shell commands run with your user's access
Project instructionsGEMINI.mdAGENTS.md, falling back to CLAUDE.md
ExtensionsExtensions and MCP servers in settings.jsonSkills, plugins and MCP servers
Headless and CIgemini -p, with --output-format jsonopencode run
Local modelsNot documentedOllama, LM Studio, vLLM

Access and Models​

Gemini CLI is now an enterprise tool. A Code Assist Standard or Enterprise license works through a Google account sign-in with GOOGLE_CLOUD_PROJECT set. A Gemini API key from AI Studio gives usage-based billing, and Vertex AI works through a Google Cloud project. The repository lists no free tier for individuals.

OpenCode charges nothing for the agent. It reads its provider list from models.dev, so you can run Gemini, Claude, GPT or open-weight models in the same tool. It signs in with a ChatGPT Plus or Pro plan, a GitHub Copilot account, or a Claude plan through a local Claude Code login. OpenCode Go is an optional $10 monthly subscription to a curated list of models tested for agentic coding.

Approvals and Sandboxing​

The defaults point in opposite directions. Gemini CLI's default mode asks before each tool call. auto_edit approves file edits and still asks about other tools. YOLO mode approves everything and can only be turned on from the command line, and the security.disableYoloMode setting turns it off. Gemini CLI's sandbox is off unless you pass -s or set GEMINI_SANDBOX. On macOS its Seatbelt profile confines writes to the project directory.

OpenCode's build agent allows every action, including access outside the project. Only reading .env files asks first. It has no OS sandbox, so narrow it with deny and ask rules or run it in a container or a cloud sandbox.

When to Pick Which​

  • Pick Gemini CLI if your company has a Gemini Code Assist license, you want prompts before each tool call, or you want a choice of sandbox backends.
  • Pick OpenCode if you have no Code Assist license, switch between providers, run local models, or want to reuse a ChatGPT, Copilot or Claude plan.
  • Pick Antigravity CLI if you use Gemini on a personal Google account. Gemini CLI no longer serves those plans.

Alternatives​

Running Several Agents at Once​

Running Gemini CLI and OpenCode on the same task needs one git worktree per agent, so their edits never collide. In Treq, each agent runs in its own workspace, and you review the results side by side.

Sources​

Checked December 4, 2026:

Next Steps​