How to Detect Gemini CLI, Codex CLI and Other AI Coding CLIs

Terminal AI agents install with one npm or pip command, live in the user's PATH and run shell commands on their own. This guide lists where the common ones leave traces, a read-only check for each OS, and the configuration that turns off their approval prompts.

By Kuntur team · Published · Updated

Short answer. As the logged-in user:

  • Mac or Linux: run ls -d ~/.gemini ~/.codex ~/.copilot ~/.qwen ~/.config/opencode 2>/dev/null and npm ls -g --depth=0. Each folder printed means that CLI has run for this user.
  • Windows: check the same folders under %USERPROFILE% and the packages in %APPDATA%\npm\node_modules. In Task Manager they show up as node.exe, not by name.
  • Every laptop at once: use the Intune Remediation or Jamf extension attribute below, which reads every user profile.

Then look for the settings that turn off approval prompts (Gemini YOLO mode, Codex danger-full-access). A Windows check never sees CLIs inside WSL or containers.

Why CLIs are the hardest AI tools to see

A CLI agent has no window, no installer entry and often no admin footprint. npm install -g @google/gemini-cli or pipx install aider-chat puts it in a per-user folder; it then reads the repository, runs commands such as git, test runners and package managers, and can launch MCP servers. Network tools see HTTPS to an API endpoint at best. The endpoint is where you can see which agent it is, which version, and how it is configured.

Claude Code has its own guide: How to detect Claude Code on company laptops. This one covers the others.

Footprints of the common CLIs

ToolTypical installCommandPer-user data
Gemini CLI (Google)npm @google/gemini-cli, Homebrewgemini~/.gemini/ (settings.json, extensions/)
Codex CLI (OpenAI)npm @openai/codex, Homebrew, release binarycodex~/.codex/ (config.toml, sessions)
GitHub Copilot CLInpm @github/copilotcopilot~/.copilot/ (mcp-config.json)
Qwen Code (Alibaba)npm @qwen-code/qwen-codeqwen~/.qwen/
opencodenpm opencode-ai, install script, Homebrewopencode~/.config/opencode/, ~/.local/share/opencode/
Aiderpip or pipx aider-chataider.aider* files in repositories
Goose (Block)Install script, desktop appgoose~/.config/goose/ (config.yaml lists extensions)
Amazon Q Developer CLIInstaller / app bundleq, qchat~/.aws/amazonq/
Cursor CLIInstall scriptcursor-agentShares ~/.cursor/ with the editor
Continue CLInpm @continuedev/clicn~/.continue/
Docker cagentBundled with Docker Desktop or standalonecagent~/.cagent/

Install methods change often; the data folders are the most stable signal because they survive upgrades and switching install method. On Windows, npm shims land in %APPDATA%\npm as .cmd and .ps1 files, and the process you see is usually node.exe with the package path in its command line, not a process named after the tool.

Check a Windows machine

Run as the user, not SYSTEM. Everything below only reads.

# Global npm packages of common AI CLIs (active Node version)
$pkgs = '@google/gemini-cli','@openai/codex','@github/copilot','@qwen-code/qwen-code',
        'opencode-ai','@continuedev/cli','@anthropic-ai/claude-code'
npm ls -g --depth=0 --json 2>$null | ConvertFrom-Json |
  ForEach-Object { $_.dependencies.PSObject.Properties } |
  Where-Object { $pkgs -contains $_.Name } |
  Select-Object Name, @{n='Version'; e={ $_.Value.version }} | Format-Table -AutoSize

# Commands on PATH (npm shims, pipx, standalone binaries)
'gemini','codex','copilot','qwen','opencode','aider','goose','q','qchat','cursor-agent','cn','cagent' |
  ForEach-Object { Get-Command $_ -ErrorAction SilentlyContinue } |
  Select-Object Name, Source | Format-Table -AutoSize

# Per-user config folders (evidence of use)
'.gemini','.codex','.copilot','.qwen','.continue','.cagent','.aws\amazonq' |
  ForEach-Object { Join-Path $env:USERPROFILE $_ } | Where-Object { Test-Path $_ } |
  ForEach-Object { Get-Item $_ | Select-Object FullName, LastWriteTime } | Format-Table -AutoSize

# Running now
Get-Process -Name gemini,codex,copilot,qwen,opencode,aider,goose,qchat,cursor-agent -ErrorAction SilentlyContinue |
  Select-Object Name, Id, Path | Format-Table -AutoSize

Check macOS and Linux

# Commands on PATH
for b in gemini codex copilot qwen opencode aider goose q qchat cursor-agent cn cagent; do
  p=$(command -v "$b" 2>/dev/null) && echo "$b -> $p"
done

# Global npm packages (repeat per Node version if you use nvm/fnm/Volta)
npm ls -g --depth=0 2>/dev/null | grep -E 'gemini-cli|@openai/codex|@github/copilot|qwen-code|opencode-ai|@continuedev/cli'

# Python-installed CLIs
pipx list --short 2>/dev/null | grep -Ei 'aider|llm'

# Config folders (evidence of use)
ls -dl ~/.gemini ~/.codex ~/.copilot ~/.qwen ~/.continue ~/.cagent ~/.aws/amazonq \
       ~/.config/opencode ~/.config/goose 2>/dev/null

# Running now
pgrep -fl 'gemini|codex|copilot|qwen|opencode|aider|goose|qchat|cursor-agent'

A name match alone can mislead: goose is also the name of a popular database migration tool, and q is a common alias. Confirm with the data folder or the package that owns the binary before you raise anything.

Settings that remove the guard rails

Each of these agents asks before running commands by default. Each also has a way to stop asking, and that is the configuration worth tracking:

# Codex: no sandbox, or never ask (user config and every profile in it)
grep -nE 'sandbox_mode *= *"danger-full-access"|approval_policy *= *"never"|danger-full-access' ~/.codex/config.toml

# Gemini CLI: YOLO approval mode set as the default
jq '{default: .general.defaultApprovalMode, autoAccept: .tools.autoAccept}' ~/.gemini/settings.json

# MCP servers each CLI will start
jq -r '.mcpServers // {} | keys[]' ~/.gemini/settings.json ~/.copilot/mcp-config.json ~/.qwen/settings.json 2>/dev/null
grep -n '^\[mcp_servers\.' ~/.codex/config.toml

The MCP servers these CLIs start deserve the same review as any other: unpinned packages, tokens in plain text and broad file system access. The MCP security checklist covers what to look for, and the MCP config auditor checks a pasted config in your browser.

Places a quick check misses

Check every laptop with Intune or Jamf

The same checks run fleet-wide from the MDM you already have. Both scripts only read the file system, look in every user profile (they run as SYSTEM or root) and print user: tool pairs.

Microsoft Intune. Add it as the detection script of a Remediation (Devices → Scripts and remediations), with no remediation script, Run this script using the logged-on credentials set to No and 64-bit PowerShell. Devices with an AI CLI show as With issues; add the Pre-remediation detection output column to see which user has which tool. Intune keeps only the first 2,048 characters of that output.

# Intune Remediations, detection script (runs as SYSTEM, so it looks in every profile)
# Exit 1 = at least one AI coding CLI found; the output lists user: tool pairs.
$dirs = [ordered]@{ 'Gemini CLI'='.gemini'; 'Codex CLI'='.codex'; 'Copilot CLI'='.copilot'; 'Qwen Code'='.qwen'
  'Continue CLI'='.continue'; 'Docker cagent'='.cagent'; 'Amazon Q CLI'='.aws\amazonq'
  'opencode'='.config\opencode'; 'Goose'='.config\goose' }
$npm = '@google\gemini-cli','@openai\codex','@github\copilot','@qwen-code\qwen-code','opencode-ai','@continuedev\cli'
$found = @()
Get-ChildItem 'C:\Users' -Directory -ErrorAction SilentlyContinue | ForEach-Object {
  $u = $_.Name; $h = $_.FullName
  foreach ($k in $dirs.Keys) { if (Test-Path (Join-Path $h $dirs[$k])) { $found += "${u}: $k" } }
  foreach ($p in $npm) { if (Test-Path "$h\AppData\Roaming\npm\node_modules\$p") { $found += "${u}: npm $p" } }
}
if ($found) { Write-Output ("AI CLIs: " + ($found -join '; ')); exit 1 }
Write-Output 'No AI coding CLI found'
exit 0

Jamf Pro. Add it as a computer extension attribute (Settings → Computer management → Extension attributes, input type Script). The value updates at the next inventory update (sudo jamf recon forces one); then build a smart group where the attribute is not None.

#!/bin/bash
# Jamf Pro extension attribute (runs as root): user:folder for every AI coding CLI it finds
found=""
for home in /Users/*; do
  u=$(basename "$home")
  for d in .gemini .codex .copilot .qwen .continue .cagent .aws/amazonq .config/opencode .config/goose; do
    [ -d "$home/$d" ] && found="$found $u:$d"
  done
done
for b in gemini codex copilot qwen opencode aider cursor-agent; do
  for dir in /opt/homebrew/bin /usr/local/bin; do
    [ -e "$dir/$b" ] && found="$found $dir/$b"
  done
done
echo "<result>${found:-None}</result>"

Both give you a list, not a history: you see what exists at the last run, not when it appeared or who decided it was fine. They also miss WSL distros and containers (see above). To restrict a CLI rather than find it, see Claude Code with Intune; the same app control limits apply to the other npm-installed CLIs.

Automate it

On one machine, the free Kuntur scanner lists every catalogued AI CLI it finds (binary, npm package, process or data folder) with its MCP servers, extensions and the bypass settings above.

  1. Download scan.ps1.
  2. Read it. It's plain text; here's what it does.
  3. Check its SHA-256 against the published hash: Get-FileHash .\scan.ps1 -Algorithm SHA256
  4. Run it: powershell -ExecutionPolicy Bypass -File .\scan.ps1

Windows shortcut, if you trust the source (PowerShell)

irm https://app.kuntur.io/scan.ps1 | iex

macOS and Linux (Terminal)

curl -fsSL https://app.kuntur.io/scan.sh | sh

It 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 per user and per execution environment (host, WSL distro, container), and also surfaces uncatalogued CLIs as candidates for review: Python packages that depend on an LLM SDK, and compiled binaries in common bin folders that embed LLM provider endpoints. You mark each one approved or unauthorized, and the console keeps who decided and when. For an audit, the evidence pack exports that history for a period as a ZIP with checksums.

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

How do I find Codex CLI if it was not installed with npm?
Check for a codex binary on PATH and for the ~/.codex folder, which every install method uses for config.toml and session data.
What is Gemini CLI YOLO mode?
An approval mode that runs every tool call, including shell commands, without asking. It can be passed per run with --yolo or set as the default in ~/.gemini/settings.json.
Why does Task Manager show node.exe instead of gemini or codex?
npm-installed CLIs run as Node.js scripts, so the process is node and the package name appears in its command line. Look at command lines, not process names.
How do I check every laptop for AI coding CLIs at once?
Run a read-only script from your MDM that looks in every user profile: an Intune Remediation detection script on Windows or a Jamf Pro extension attribute on macOS. For a running inventory with history and approval decisions, use an endpoint agent such as Kuntur.
Does the check need admin rights?
Not for your own profile: the one-machine commands run as the logged-in user. Reading other users' profiles needs SYSTEM or root, which is how Intune and Jamf run the fleet scripts.
Why can't I find Gemini CLI or Codex on a Windows laptop that uses WSL?
A CLI installed inside a WSL distro lives in that distro's own home folder, which Windows-side checks never read. List distros with wsl -l -q and run the Linux check inside each one (WSL guide).
Does Kuntur detect AI CLIs that are not in its catalog?
Yes, as candidates for review rather than confirmed tools: Python packages that require an LLM SDK and compiled binaries that embed LLM provider endpoints. See what Kuntur detects.

Sources

  1. Gemini CLI documentation (GitHub)
  2. OpenAI Codex CLI (GitHub)
  3. GitHub Docs: About GitHub Copilot CLI
  4. Qwen Code (GitHub)
  5. Aider documentation

More guides and tools: