How to Detect Gemini CLI on Employee Laptops
Gemini CLI is Google's terminal coding agent. It installs as an npm package or with Homebrew, without admin rights, so software inventories rarely list it. Here are the traces it leaves on each OS, a one-minute read-only check, and the settings that turn an install into a finding.
What Gemini CLI is and why security teams care
Gemini CLI is Google's open-source terminal agent. Like other coding agents it reads the code in the folder it starts from, edits files, runs shell commands and starts MCP servers, with the permissions of the logged-in user. It signs in with a Google account, a Gemini API key or Vertex AI credentials.
- Invisible installs. It is usually installed as a global npm package (
@google/gemini-cli) or with Homebrew, or run without installing throughnpx. None of these show up in Programs and Features or/Applications. - YOLO mode. An approval mode called
yolo(the--yoloflag, or a default insettings.json) runs every tool call without asking. - Keys in plain text. A
GEMINI_API_KEYoften sits in~/.gemini/.envor a shell profile; see how to find exposed AI API keys.
Where Gemini CLI leaves traces
| Signal | Windows | macOS | Linux |
|---|---|---|---|
| npm global package | @google/gemini-cli under %APPDATA%\npm\node_modules, shim %APPDATA%\npm\gemini.cmd | @google/gemini-cli under npm root -g | Same as macOS |
| Binary on PATH | gemini.cmd | /opt/homebrew/bin/gemini or /usr/local/bin/gemini (Homebrew or npm) | /usr/local/bin/gemini, ~/.local/bin/gemini |
| Run without install | npx @google/gemini-cli leaves the package in the npm cache (~/.npm/_npx, or %LOCALAPPDATA%\npm-cache\_npx on Windows) | ||
| Process | node.exe with @google/gemini-cli in the command line | node running the package, or gemini | Same as macOS |
| User data | %USERPROFILE%\.gemini | ~/.gemini | ~/.gemini |
| System settings (if deployed) | C:\ProgramData\gemini-cli\settings.json | /Library/Application Support/GeminiCli/settings.json | /etc/gemini-cli/settings.json |
| Project files | .gemini/settings.json and GEMINI.md in a repository | ||
Inside ~/.gemini, settings.json holds approval settings and MCP servers, .env can hold an API key, extensions/ holds installed extensions (which can bring their own MCP servers), GEMINI.md holds global instructions, and tmp/ holds per-project session data. Two traps: Google Antigravity also writes under ~/.gemini (an antigravity subfolder), so the folder alone does not prove Gemini CLI; and the Gemini desktop app on macOS also runs a process called gemini, from Gemini.app. Kuntur's catalog counts a gemini process only when its path points at the CLI.
Check one machine
Both checks only read files and the process table. They send nothing over the network and change nothing.
Windows (PowerShell)
# Read-only, no network. Run as the user (not SYSTEM).
# 1. Installed? npm global package and its shim, then anything named gemini on PATH
Test-Path "$env:APPDATA\npm\node_modules\@google\gemini-cli"
Test-Path "$env:APPDATA\npm\gemini.cmd"
Get-Command gemini -ErrorAction SilentlyContinue | Select-Object Source
# 2. Running now? Gemini CLI runs under node, so match the package in the command line
Get-CimInstance Win32_Process -Filter "Name = 'node.exe'" |
Where-Object { $_.CommandLine -like '*gemini-cli*' } | Select-Object ProcessId, ExecutablePath
# 3. Used? The data folder and its most recent changes
Get-ChildItem "$env:USERPROFILE\.gemini" -Force -ErrorAction SilentlyContinue |
Sort-Object LastWriteTime -Descending | Select-Object -First 10 Name, LastWriteTime
# 4. Settings worth a finding (line numbers and keys only, no values)
$s = "$env:USERPROFILE\.gemini\settings.json"
if (Test-Path $s) {
Select-String -Path $s -Pattern '"yolo"', '"autoAccept"\s*:\s*true', '"mcpServers"' |
Select-Object LineNumber, Pattern
}
macOS and Linux (bash)
# Read-only, no network. Run as the user.
# 1. Installed? PATH, Homebrew and common prefixes, npm global, npx cache
command -v gemini
ls -l /opt/homebrew/bin/gemini /usr/local/bin/gemini ~/.local/bin/gemini 2>/dev/null
ls -d "$(npm root -g 2>/dev/null)/@google/gemini-cli" 2>/dev/null
ls -d ~/.npm/_npx/*/node_modules/@google/gemini-cli 2>/dev/null # run once with npx
brew list --versions gemini-cli 2>/dev/null
# 2. Running now? It runs under node
pgrep -fl 'gemini-cli'
# 3. Used? Data folder and recent per-project session data
ls -la ~/.gemini 2>/dev/null
find ~/.gemini/tmp -mindepth 1 -maxdepth 1 -mtime -30 2>/dev/null | head -n 10
# 4. Settings worth a finding (prints only the matched keys)
grep -noE '"(defaultApprovalMode|approvalMode)"[[:space:]]*:[[:space:]]*"yolo"|"autoAccept"[[:space:]]*:[[:space:]]*true|"mcpServers"' \
~/.gemini/settings.json 2>/dev/null
With nvm, fnm or Volta each Node version has its own global packages, so also list ~/.nvm/versions/node/*/lib/node_modules/@google. A Linux install inside WSL is invisible to the Windows check; see the WSL guide, which uses the same approach.
Settings worth a finding
| Setting | What it means | Kuntur finding |
|---|---|---|
"general": {"defaultApprovalMode": "yolo"}, tools.approvalMode or autoAccept: true | Tool calls run without asking | AGENT_PERMISSIONS_BYPASS |
mcpServers in settings.json or an extension | Programs or URLs the agent can call, often with tokens in env or headers | MCP inventory and MCP_PLAINTEXT_SECRET |
GEMINI_API_KEY in ~/.gemini/.env or a profile | A long-lived key in a plain-text file | AI_API_KEY_IN_SHELL_PROFILE for profiles |
The --yolo flag on the command line has the same effect as the setting but leaves nothing in the file, so EDR process command lines are the only place to see it.
Find it across a fleet
The commands above answer the question for one laptop. Across a fleet, run the same read-only checks from the management tool you already use and collect one line per device. Each of these guides has a tested script that already includes Gemini CLI:
- Windows with Intune: Detect AI tools with Intune Remediations (detection-only script, results in the device status column).
- Windows with NinjaOne: Inventory AI tools with NinjaOne (writes a summary to a device custom field).
- macOS with Jamf Pro: Find AI tools with a Jamf Pro extension attribute (plus a Smart Group to act on it).
- macOS with Iru (Kandji): Detect AI tools with an Iru custom script (with an allowlist).
Those scripts walk every profile under C:\Users or /Users, because MDM scripts usually run as SYSTEM or root, where %USERPROFILE% and ~ point at the wrong home folder. On Linux, run the bash checks through whatever configuration management you have (Ansible, Salt, a cron job) and loop over /home/* the same way.
How Kuntur detects Gemini CLI
Kuntur's catalog identifies Gemini CLI by the global npm package, the gemini binary in the usual install locations, a node process running @google/gemini-cli, and the ~/.gemini data folder, while excluding the Gemini desktop app. The agent also reads Gemini CLI's MCP servers (user, system and extension), its extensions and the approval settings in the table above, for every user profile.
To check one machine now, the free Kuntur scanner lists Gemini CLI together with every other AI tool, extension, local model and MCP server it finds:
- Download scan.ps1.
- Read it. It's plain text; here's what it does.
- Check its SHA-256 against the published hash:
Get-FileHash .\scan.ps1 -Algorithm SHA256 - Run it:
powershell -ExecutionPolicy Bypass -File .\scan.ps1
Windows shortcut, if you trust the source (PowerShell)
irm https://app.kuntur.io/scan.ps1 | iexmacOS and Linux (Terminal)
curl -fsSL https://app.kuntur.io/scan.sh | shIt needs no account and no admin rights, writes an HTML report to the Desktop (or home folder) and uploads nothing. You can read scan.ps1 or scan.sh before running it; what it collects is documented.
Across a fleet, the Kuntur agent reports the same inventory for every user profile on Windows, macOS and Linux. You mark Gemini CLI approved or unauthorized once for the organization, the dashboard shows which machines carry it, and every decision lands in an audit log.
Free for up to 5 endpoints. Pro is US$3 per endpoint per month (or US$30 per endpoint per year) for 10 to 30 endpoints. The trial needs no credit card. Kuntur detects and reports; it does not block or uninstall anything.
FAQ
- Where is Gemini CLI installed?
- Usually as the global npm package
@google/gemini-cli(under%APPDATA%\npm\node_moduleson Windows ornpm root -gelsewhere), or with Homebrew on macOS, which putsgeminiin/opt/homebrew/binor/usr/local/bin. Its user data is always in~/.gemini. - How do I check if Gemini CLI is installed?
- Run
Get-Command geminion Windows orcommand -v geminion macOS and Linux, and look for the npm package@google/gemini-cliand the~/.geminifolder. People who ran it once withnpxleave it in the npm cache instead. - What is Gemini CLI YOLO mode?
- An approval mode in which every tool call, including shell commands and file edits, runs without asking. It is turned on with
--yoloor set as the default in~/.gemini/settings.json; Kuntur reports the setting asAGENT_PERMISSIONS_BYPASS. - Where does Gemini CLI store MCP servers?
- In
mcpServersin~/.gemini/settings.json, in a project's.gemini/settings.json, in system settings if you deployed them, and inside installed extensions under~/.gemini/extensions.
Sources
Detect other AI tools:
Related guides: