Uninstall Gemini CLI, including the config it leaves

Uninstalling the package is one command. Removing what it leaves is the part nobody documents, and there is one directory you must not delete carelessly, because Antigravity CLI now lives inside it.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Run npm uninstall -g @google/gemini-cli, or brew uninstall gemini-cli, or sudo port uninstall gemini-cli, depending on how you installed it. For npx, clear the _npx cache. Then remove the leftovers by hand: credentials and state in ~/.gemini/, per-project .gemini/ directories, the GEMINI_API_KEY export in your shell profile, and the Gemini CLI Companion editor extension. Do not delete all of ~/.gemini if you use Antigravity CLI: it stores its own config there.

What you need to know
  • npm: npm uninstall -g @google/gemini-cli. Homebrew: brew uninstall gemini-cli.
  • npx leaves nothing installed but caches the package in _npx.
  • The package manager does not touch ~/.gemini/, which holds your credentials.
  • Do not rm -rf ~/.gemini if you use Antigravity CLI. Its config lives in there.
  • Uninstalling does not revoke anything: delete the API key in AI Studio too.
  • The editor extension is separate: google.gemini-cli-vscode-ide-companion.

Work out how it was installed

The removal command depends on the install route, and machines that have had the CLI for a while often have two.

Run all of these.
which -a gemini

npm ls -g @google/gemini-cli 2>/dev/null
brew list --versions gemini-cli 2>/dev/null
port installed gemini-cli 2>/dev/null

gemini --version
What you seeInstall routeSection
A path under npm root -g or ~/.npm-globalnpm globalnpm
/opt/homebrew/bin/gemini or /usr/local/bin/geminiHomebrewHomebrew
/opt/local/bin/geminiMacPortsMacPorts
Nothing, but you have been running npxnpx cachenpx
Two pathsBoth. Remove eachAll of the above

Remove the package

npm global install
npm uninstall -g @google/gemini-cli
Homebrew
brew uninstall gemini-cli

# optional: drop the dependency if nothing else needs it
brew autoremove
MacPorts
sudo port uninstall gemini-cli

npx

npx never installs anything permanently, so there is nothing to uninstall. It does cache the package. Clearing that cache removes Gemini CLI and every other package you have ever run with npx, which is usually fine and occasionally annoying.

macOS and Linux
npm config get cache          # see where it is
rm -rf "$(npm config get cache)/_npx"
Windows PowerShell
Remove-Item -Path (Join-Path $env:LocalAppData "npm-cache\_npx") -Recurse -Force

The directory the uninstaller does not touch

Every package manager removes the binary and nothing else. Your OAuth credentials, project state, trusted-folder list, and shell history all survive in ~/.gemini/.

Look before you delete.
ls -la ~/.gemini

What you will find, and who owns it. Contents vary by version; checked August 2026.

PathWhat it isSafe to delete?
settings.jsonYour Gemini CLI user settingsYes
oauth_creds.jsonCached Google credentialsYes, and you should
google_accounts.jsonWhich account was signed inYes
trustedFolders.jsonFolders you told it to trustYes
installation_idAnonymous telemetry idYes
projects.json, state.jsonPer-project slugs and UI stateYes
tmp/, history/Per-project shell history and session stateYes
GEMINI.mdYour global instructions fileOnly if you are not migrating
antigravity-cli/Antigravity CLI stateNo
config/Antigravity CLI config and MCP serversNo
antigravity/, antigravity-ide/Antigravity desktop app stateNo

Removing only the Gemini CLI parts

Surgical: leaves anything Antigravity owns in place.
cd ~/.gemini
rm -f  settings.json oauth_creds.json google_accounts.json \
       trustedFolders.json installation_id projects.json state.json
rm -rf tmp history

# your global instructions file, if you do not want it any more
rm -f ~/.gemini/GEMINI.md
Everything, only when Antigravity is not on this machine.
ls ~/.gemini | grep -i antigravity   # must print nothing
rm -rf ~/.gemini
The contents of the dot gemini directory split by owner: the Gemini CLI files that are safe to delete on the left, the Antigravity directories that must be kept on the right, and a struck out recursive delete of the whole directory INSIDE ~/.gemini/ Gemini CLI wrote these SAFE TO DELETE settings.json oauth_creds.json google_accounts.json trustedFolders.json installation_id projects.json, state.json tmp/, history/ Antigravity wrote these DO NOT DELETE antigravity-cli/ config/ antigravity/ antigravity-ide/ GEMINI.md shared. keep it if you migrate rm -rf ~/.gemini takes the Antigravity install with it

Per-project leftovers

Gemini CLI writes into repositories as well as your home directory, and those files are committed in a lot of teams. Removing the tool locally does not mean you want them gone from the repo, so decide deliberately.

FilePurposeUsually
GEMINI.mdProject instructions for the agentKeep. Antigravity CLI reads the same file
.geminiignorePaths the agent must not readKeep, if anyone else uses the agent
.gemini/settings.jsonProject-level settings and MCP serversRemove if nobody else runs the CLI
.gemini/skills/Workspace skillsRename to .agents/skills/ if you are migrating
.gemini/sandbox.DockerfileCustom sandbox profileRemove with the rest
Find them across a projects directory.
find ~/code -maxdepth 3 \( -name GEMINI.md -o -name .geminiignore -o -name .gemini \) -print

Shell profile, environment, and credentials

The installer appends to your shell profile and you probably appended a key to it yourself. Neither is removed by an uninstall.

Look for these, then edit the file by hand.
grep -n "GEMINI\|gemini" ~/.zshrc ~/.zprofile ~/.bashrc ~/.bash_profile ~/.profile 2>/dev/null

Variables Gemini CLI reads.

VariableRemove if
GEMINI_API_KEYYou are not keeping the key for anything else
GEMINI_CLI_HOMEYou relocated the config root
GEMINI_CLI_TRUSTED_FOLDERS_PATHYou relocated the trust list
GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATIONThey were set for Vertex AI and nothing else uses them

The editor extension

The IDE integration is a separate VS Code extension and survives uninstalling the CLI.

code --list-extensions | grep -i gemini
code --uninstall-extension google.gemini-cli-vscode-ide-companion

If you use a VS Code-compatible editor with its own CLI, substitute that binary. In Zed or JetBrains the integration is an ACP agent registration rather than an extension, so remove it from the editor's agent list instead.

Verify it is gone

exec $SHELL -l

which -a gemini          # expect nothing
gemini --version         # expect command not found
ls -la ~/.gemini 2>/dev/null
echo "$GEMINI_API_KEY"   # expect an empty line

Questions people ask

npm uninstall -g @google/gemini-cli for an npm install, brew uninstall gemini-cli for Homebrew, or sudo port uninstall gemini-cli for MacPorts. If you only ever ran it with npx, clear the _npx directory inside your npm cache.

No. Every package manager removes the binary only. Your settings, cached credentials, trusted folders, and per-project state stay in ~/.gemini/ until you delete them yourself.

Only if Antigravity is not installed. Antigravity CLI keeps its own configuration in ~/.gemini/antigravity-cli/ and ~/.gemini/config/, and the desktop app uses ~/.gemini/antigravity/. Run ls ~/.gemini first and delete the Gemini CLI files individually if any of those exist.

npm uninstall -g @google/gemini-cli in PowerShell, delete %UserProfile%\.gemini (minus anything Antigravity owns), and remove the GEMINI_API_KEY user variable with [Environment]::SetEnvironmentVariable("GEMINI_API_KEY",$null,"User").

Yes, if you want it revoked. Removing the CLI and unsetting the variable does not disable the key. Delete it in Google AI Studio, and remember it may also live in shell history, a CI secret, or a dotfiles repository.

Usually not. Antigravity CLI reads the same GEMINI.md and AGENTS.md files in the same locations, so if you are migrating rather than leaving, the file carries over unchanged.

You have a second install. npm and Homebrew place the binary in different directories, and PATH order decides which one you were running. which -a gemini lists every match; remove each one.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Uninstalling the CLI (Gemini CLI docs) package-manager commands
  2. Gemini CLI configuration reference config paths and environment variables
  3. Gemini CLI to Antigravity CLI migration where Antigravity stores its config
Try it

Fewer tools,
one workbench.

Continuum runs Google, Anthropic, and OpenAI agents side by side on your own logins, with spend by repo.

free app · your subscriptions · local-first