Gemini CLI is Google's open-source terminal agent, licensed under Apache 2.0 and signed in with a Google account, a Gemini API key or Vertex AI. Open-source alternatives we confirmed are Qwen Code, OpenCode, Aider, Cline, Goose and OpenAI's Codex CLI. Google's own successor is Antigravity CLI, and the Safeguard CLI is the option that also knows your vulnerabilities.
If you move to Safeguard, you do not give up what you already pay for. Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. You can also connect Claude or ChatGPT to the Safeguard MCP server and use Safeguard from the chat you already work in.
What Gemini CLI is today
The README describes Gemini CLI as "an open-source AI agent that brings the power of Gemini directly into your terminal", licensed under Apache 2.0. You can run it through npx @google/gemini-cli, install it from npm, or use Homebrew or MacPorts.
Sign-in. Google's authentication page lists three routes: Sign in with Google for individual accounts, a Gemini API key from Google AI Studio, and Vertex AI with a Google Cloud project. Workspace accounts and Gemini Code Assist licences need a project set in GOOGLE_CLOUD_PROJECT.
The Antigravity note. This is the fact to check first. The README and the authentication page both say Gemini CLI "was replaced by Antigravity CLI on June 18th, 2026" for unpaid tier and Google One users. They also say Gemini CLI "has not been optimized for Gemini 4 Argon" and point to Antigravity for that model. The repository still publishes releases: the README lists a weekly stable release on Tuesdays at 20:00 UTC, a weekly preview and a daily nightly build.
Approvals. The configuration reference names general.defaultApprovalMode with three values: default, which prompts for approval, auto_edit, which auto-approves edit tools, and plan, which is read-only. The default is default. YOLO mode, which approves every action, "can only be enabled via command line", and an admin can set security.disableYoloMode to block it even when the flag is passed.
Sandbox. You turn the sandbox on with -s, the GEMINI_SANDBOX variable, or tools.sandbox in settings. Methods include macOS Seatbelt, Docker or Podman, a Windows native sandbox, gVisor and an experimental LXC option. The default Seatbelt profile confines writes to the project directory while allowing broad reads and network access.
Settings, MCP and scripting. User settings live in ~/.gemini/settings.json and project settings in .gemini/settings.json. MCP servers go under mcpServers there, or you add one with gemini mcp add. Remote servers can sign in with OAuth through /mcp auth. For scripts, gemini -p runs one prompt, and --output-format json or stream-json gives structured output.
Gemini CLI alternatives compared
Each open-source licence below was confirmed on the tool's own repository page. "Where the agent runs" means where the tool executes; prompts and the files the agent reads still go to the model provider you configure, unless you run a local model.
| Tool | Interface | Licence | Models | Where the agent runs | Approval default we found |
|---|---|---|---|---|---|
| Gemini CLI (reference) | Terminal | Apache 2.0 | Gemini via Google sign-in, API key or Vertex AI | Your machine; sandbox opt-in | Prompts for approval |
| Aider | Terminal | Apache 2.0 | "Almost any LLM, including local models" | Your machine | Commits each change to git automatically |
| Cline | VS Code, JetBrains, CLI, desktop app, SDK | Apache 2.0 (JetBrains plugin not open source) | Anthropic, OpenAI, Google Gemini, OpenRouter, Bedrock, Vertex, Ollama, LM Studio, OpenAI-compatible APIs | Your machine | Extension asks per edit and command; CLI auto-approves by default |
| Codex CLI | Terminal, plus IDE extension, desktop app and Codex Cloud | Apache 2.0 | OpenAI, via ChatGPT sign-in or API key | Your machine in an OS sandbox | Auto preset: workspace writes, asks to leave the sandbox |
| Goose | Desktop app, CLI, API | Apache 2.0 | 15+ providers, including Anthropic, OpenAI, Google, Ollama, Bedrock | Your machine | Autonomous mode |
| OpenCode | Terminal UI, beta desktop app | MIT | 75+ providers, local models, Vertex AI | Your machine | Most permissions allow without a prompt |
| Qwen Code | Terminal, plus editor, desktop and web surfaces | Apache 2.0 | OpenAI, Anthropic, Gemini and Qwen APIs, local via Ollama or vLLM | Your machine | Docs name both Auto and Ask Permissions as the starting mode |
Qwen Code
Qwen Code is an Apache 2.0 terminal agent from the Qwen team. Its README says it "was originally based on Google Gemini CLI v0.8.2" and stopped syncing with upstream from its own v0.1, so the layout will feel familiar to Gemini CLI users. It supports OpenAI, Anthropic, Gemini and Qwen APIs plus local models, and you configure a provider with /auth. Know before adopting: the npm package needs Node.js 22 or later, and its approval docs include an Auto mode where an LLM classifier approves or blocks shell commands, network calls and edits outside the workspace.
OpenCode
OpenCode is an MIT-licensed coding agent with a terminal UI and a beta desktop app for macOS, Windows and Linux. It ships a full-access build agent and a read-only plan agent you switch between with Tab. Its provider docs list more than 75 providers and local models through Ollama, LM Studio and llama.cpp, and Gemini models are reachable through Google Vertex AI. Know before adopting: its permission docs say most permissions default to allow, with .env files denied for reads. We cover it in open-source OpenCode alternatives.
Aider
Aider is "AI pair programming in your terminal", a Python tool licensed under Apache 2.0 that "can connect to almost any LLM, including local models." You start it in a project folder with a model and a key. Know before adopting: it commits changes automatically, so work on a branch and use git to review and undo.
Cline
Cline is an Apache 2.0 agent that ships as a VS Code extension, a JetBrains plugin, a CLI, a desktop app for macOS and Windows, and an SDK. Google's Gemini models are on its provider list. In the extension's Act mode, "every file edit and terminal command requires your approval" unless you turn on auto-approve. Know before adopting: the CLI docs list --auto-approve as true by default, and the README says the JetBrains plugin is not open source.
Goose
Goose is a general-purpose Apache 2.0 agent with a desktop app for macOS, Linux and Windows, a CLI and an API, and it is part of the Agentic AI Foundation at the Linux Foundation. Its README lists more than 15 providers, Google among them. Know before adopting: its docs say Autonomous mode is applied by default, which lets it edit and delete files without approval. Manual, Smart and Chat Only modes are a /mode command away.
Codex CLI
Codex CLI is "a coding agent from OpenAI that runs locally on your computer", licensed under Apache 2.0. You sign in with ChatGPT or set up an API key. Its default Auto preset lets it edit and run commands inside the working folder, keeps network off, keeps .git read-only, and asks before stepping outside. Know before adopting: it uses OpenAI models only. Our OpenAI Codex alternatives guide covers it in depth.
Not open source, but worth knowing
Antigravity CLI. Google's docs present it as the terminal agent agy within Antigravity, which also has an app, IDE extensions and an SDK. Its modes are default, which pauses for an inline diff review before it writes files, accept-edits and plan, switched with Shift+Tab or --mode. The pages we read do not state a licence. Its FAQ says Antigravity is for personal Google accounts in approved geographies, that some models need a Google AI Pro or Ultra plan, and that wrapping agy inside third-party coding agents is not supported on consumer plans.
Claude Code. Anthropic's agent runs in the terminal, IDEs, a desktop app and the web. Its licence file reads "All rights reserved" under Anthropic's Commercial Terms. You sign in with a Claude subscription, a Claude Console account or a cloud provider.
Approval modes and sandboxes side by side
An approval prompt decides when the agent must ask you. A sandbox limits what a command can reach even after you approve it. This table uses each tool's own names.
| Tool | Modes you can pick | Default we found | Sandbox |
|---|---|---|---|
| Gemini CLI | default, auto_edit, plan; yolo from the command line only | default | Opt-in: Seatbelt, Docker, Podman, Windows native, gVisor, LXC |
| Antigravity CLI | default, accept-edits, plan | default | Not described on the pages we read |
| Qwen Code | Plan, Ask Permissions, Auto-Edit, Auto, YOLO | Docs name both Auto and Ask Permissions | Not described on the pages we read |
| Codex CLI | read-only, workspace-write, danger-full-access; approvals on-request, never, granular | Auto (workspace-write with on-request) | OS-level: Seatbelt on macOS, bwrap with seccomp on Linux |
| Claude Code | Manual, acceptEdits, plan, auto, dontAsk, bypassPermissions | auto from v2.1.283 | Optional Bash sandbox on macOS, Linux and WSL2, off by default |
| Goose | Autonomous, Manual, Smart, Chat Only | Autonomous | Not described on the pages we read |
| Cline CLI | Plan or Act; auto-approve on or off | Act, auto-approve on | Not described on the pages we read |
| OpenCode | allow, ask or deny per permission | Mostly allow | Not described on the pages we read |
| Aider | Auto-commit on or off | Auto-commit | None; git history is the undo |
Two Gemini CLI habits are worth carrying to any tool. First, YOLO cannot be set from a settings file, so a cloned repository's config cannot quietly switch it on. Second, the Seatbelt profile keeps writes inside the project. If your new agent does not do the equivalent by default, set it up before the first real task.
Moving off Gemini CLI, step by step
Decide what you are keeping
- You want Gemini models with a different agent. Qwen Code, Cline and Goose list Gemini or Google as a provider, and OpenCode reaches Gemini through Vertex AI. The Antigravity FAQ recommends a Gemini Enterprise or Google AI Studio API key for third-party coding agents, so plan on a key rather than a consumer sign-in.
- You want to stay with Google. Antigravity CLI is Google's successor. Check its account and plan requirements first.
- You want to keep a Claude, ChatGPT or Codex plan you pay for. The Safeguard CLI lets you use it, as covered below.
- You want the agent to know your vulnerabilities. That is the Safeguard CLI, alone or after any tool above.
Walkthrough
Step 1: Carry over your context file. Gemini CLI reads context files such as GEMINI.md. Copy the instructions into whatever your new tool reads. Codex creates an AGENTS.md with /init, and Claude Code's docs say it can read AGENTS.md in place of CLAUDE.md.
Step 2: List your MCP servers. Open ~/.gemini/settings.json and .gemini/settings.json and copy each entry under mcpServers. Add the same servers in the new tool.
Step 3: Install the new agent and set approvals before the first task.
# Qwen Code (Node.js 22 or later); in the session run /auth,
# then /approval-mode default to be asked before edits and commands
npm install -g @qwen-code/qwen-code@latest
# OpenCode; in the session run /connect to add credentials
curl -fsSL https://opencode.ai/v2/install | bash
# Cline CLI with auto-approval off
npm i -g cline
cline auth
cline --auto-approve false "add input validation to the signup handler"
# Goose CLI; in the session run /mode approve
curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash
Step 4: Work on a branch and take a baseline scan.
git switch -c agent/signup-validation
curl -fsSL https://cli.safeguard.sh/install | bash
safeguard scan --dir .
The scan builds an SBOM and matches it against vulnerability databases. Results land as JSON files under ./output, including vuln.json and license.json, so you can compare before and after the agent's changes.
Step 5: Replace gemini -p in scripts. Each tool has its own headless form. Keep a dependency check next to it that does not depend on the agent:
# What you had
gemini -p "review the staged changes" --output-format json
# Codex CLI: read-only sandbox by default in exec mode
codex exec "review the change for race conditions"
# Cline CLI reads piped input headless
git diff origin/main...HEAD | cline "review these changes"
# Checks that do not depend on the agent
safeguard scan --dir .
safeguard exec "summarise the critical findings in this repository"
Step 6: Clean up credentials. Revoke Gemini API keys or service account keys you no longer need, and remove MCP OAuth tokens from ~/.gemini/mcp-oauth-tokens.json on machines you retire.
Common mistakes
Assuming the new tool keeps Gemini CLI's defaults. Goose starts autonomous, the Cline CLI auto-approves, and OpenCode allows most actions. Set the mode before the first run.
Plugging a consumer plan into a tool that does not support it. Antigravity's FAQ says wrapping agy in third-party agents is not supported on consumer plans, and OpenCode's provider docs say Anthropic prohibits using Claude Pro or Max plans in third-party tools. Read each provider's terms before you connect a subscription.
Forgetting the sandbox was opt-in. If you ran Gemini CLI without -s, you were not sandboxed. Do not assume the new tool is either.
Letting the agent commit to main. Aider commits automatically. A branch makes a bad run one command to throw away.
Treating approval as review. An approved command can still add a package with a known vulnerability. Scan the change before you merge, as our guide to checking coding agent changes shows.
Do the work properly with the Safeguard CLI
The Safeguard CLI writes code too, and it starts from your Safeguard data: the vulnerabilities in your dependencies and your scan results. It scans code, container images and SBOMs on your own machine, sends only the results to the platform, and includes an assistant that can fix what it finds. You can switch to it outright or run it after another agent.
Keep the plan you already pay for
Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. To connect a model, see the CLI docs or run /model in a session.
Model choice is wider than one plan. This demo shows choosing the model for each conversation: Zero z20 answers with no language model at all by turning the question into a platform query, Griffin, Eagle and Lion are Safeguard's models, a tenant admin chooses which model families people may use, and you can bring your own model on your own provider account and route jobs such as chat or summaries to it.
Click through it at your own pace, or open it full screen.
Install and first session
The CLI is a single static binary, with no Node, Python or JVM needed. It runs on macOS, Linux and Windows, on x86_64 or arm64, with Windows on x86_64 only.
# macOS and Linux
curl -fsSL https://cli.safeguard.sh/install | bash
# Windows (PowerShell)
irm https://cli.safeguard.sh/install.ps1 | iex
Run safeguard with no arguments to open the interactive terminal. Type /login to sign in through your browser, then /scan . to scan the folder you are in. @ attaches a file from the folder you started in, and /resume picks up the last session in that folder.
Writing and fixing code on your machine
The assistant has tools for your local files and for your Safeguard data, and picks whichever the question needs. Ask it to "fix the lodash CVE in this repo" and it works from your actual findings, then writes files, edits code and runs commands, with your approval. The same tools make it a general terminal assistant: the docs give "what's the latest file in ~/Downloads" as an example. You can find and read files, edit code and run commands, then ask "how many critical vulns do we have" in the same conversation.
This demo attaches a computer running the Safeguard CLI and a folder, asks for a fix, reviews the diff and approves the command before it runs. The demo notes that computer work from Search is available and expanding.
Click through it at your own pace, or open it full screen.
Approvals
Tools that change things ask before they act. /permissions sets how often. Ask prompts before every action. Auto approves known actions and asks for anything new, and it is the default. Yolo approves everything. If you liked Gemini CLI's default mode, Ask is the closest habit.
Scans and CI with safeguard exec
safeguard scan --dir .
safeguard scan --repo https://github.com/your-org/your-repo
safeguard scan --image your-image:tag
safeguard scan --sbom bom.json
safeguard exec "summarise the critical findings in this repository"
safeguard validate checks CycloneDX, SPDX and VEX documents. safeguard exec runs one non-interactive assistant turn, which is the slot gemini -p filled in your pipeline. Policies and gates are evaluated in the Safeguard platform, not by the CLI. When the local runner runs platform scan jobs, your source code never leaves the machine; only SBOMs and findings are uploaded. The platform adds reachability analysis and autonomous remediation with fix pull requests, which is off by default.
Use Safeguard from Gemini CLI, Claude or ChatGPT
You can also keep the chat or agent you use and bring Safeguard into it over MCP. Safeguard's MCP docs give the hosted server as https://mcp.safeguard.sh/mcp and say Claude, ChatGPT, Cursor, VS Code and Gemini CLI all sign in with OAuth. With Gemini CLI's own commands, that looks like this:
gemini mcp add --transport http safeguard https://mcp.safeguard.sh/mcp
# then, inside gemini:
/mcp auth safeguard
A new Safeguard workspace starts with a small set of read-only tools, and an administrator enables the rest one at a time. For Claude and ChatGPT, follow the per-assistant guides in the Safeguard docs.
One platform on every surface
The download page lists every surface. Start in the terminal with the CLI, which also runs in CI/CD. Continue in the desktop app for Windows, macOS and Linux, where you ask your supply chain anything in plain English. Check findings on your phone with the iOS and Android apps, and use the VS Code, JetBrains, Open VSX or Chrome extensions where you already work. To install nothing, the Cloud CLI runs the CLI on Safeguard's infrastructure, and the cloud sandbox gives you an isolated tenant against a seeded demo repo, free for seven days with no card. For more on the assistant, read the Safeguard CLI as a security-aware coding assistant.
FAQ
Is Gemini CLI still available?
Yes. The Apache 2.0 repository is live and lists weekly stable releases. Its docs say it was replaced by Antigravity CLI on 18 June 2026 for unpaid tier and Google One users, while API key and Vertex AI routes are still documented.
Which alternative is closest to Gemini CLI?
Qwen Code started from Gemini CLI v0.8.2 and has developed independently since its own v0.1, so its layout is the most similar. It supports Gemini APIs alongside OpenAI, Anthropic and Qwen.
Can I keep using Gemini models with another agent?
Yes, with an API key or Vertex AI. Qwen Code, Cline and Goose list Gemini or Google as a provider, and OpenCode reaches Gemini through Vertex AI. Antigravity's FAQ recommends a Gemini Enterprise or Google AI Studio key for third-party coding agents.
If I switch to Safeguard, do I lose my Claude, ChatGPT or Codex plan?
No. Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. You can also connect Claude or ChatGPT to the Safeguard MCP server and use Safeguard from that chat.
Does the Safeguard CLI replace Gemini CLI feature for feature?
No. It writes and fixes code with an assistant that knows your findings, and it scans what any agent changed. You can switch to it, or keep your agent and add it before merge.
Does my source code leave my machine?
With any coding agent, prompts and the files the agent reads go to the model provider you configure. With Safeguard scans, results go to the platform, and when the local runner runs platform scan jobs only SBOMs and findings are uploaded.
Can I use the Safeguard CLI for work that is not security?
Yes, within what its tools cover. It can find and read local files, edit code and run commands, with your approval, alongside questions about your Safeguard data.
Try it yourself
This walkthrough sets up the runner on your own machine: pick the platform, start it, approve it with its device code, then use the same CLI to scan from the terminal.
Click through it at your own pace, or open it full screen.
Switch without giving anything up. Download Safeguard, connect the Claude, ChatGPT or Codex plan you already have, and read the CLI docs before your next merge.
Quick check
Can you turn on Gemini CLI's YOLO mode from a settings file?
No. Google's configuration reference says YOLO mode can only be enabled from the command line, with the yolo flag or approval mode set to yolo, and an admin setting can disable it entirely.
Does approving an agent's command mean the change is safe to merge?
No. Approval tells you what the agent wants to run, not whether the code or packages it added carry known vulnerabilities. Scan the change, for example with the Safeguard CLI, before you merge.
Sources
- Gemini CLI repository
- Gemini CLI docs: Authentication
- Gemini CLI docs: Configuration
- Gemini CLI docs: Sandbox
- Gemini CLI docs: MCP servers
- Antigravity CLI docs: Execution modes
- Antigravity docs: FAQ
- Qwen Code repository
- Qwen Code docs: Approval modes
- OpenCode repository
- OpenCode docs: Providers
- OpenCode docs: Permissions
- Aider repository
- Cline repository
- Cline CLI docs
- Goose repository
- Goose docs: Permission modes
- OpenAI Codex repository
- Codex docs: Agent approvals and security
- Codex docs: Non-interactive mode
- Claude Code licence
- Claude Code docs: Overview
- Claude Code docs: Permission modes
- Claude Code docs: Sandboxing
- Safeguard download page
- Safeguard CLI docs
- Safeguard CLI docs: Interactive terminal
- Safeguard docs: MCP server
Last reviewed: 21 October 2026.