Google's official terminal coding agent for repo analysis, code edits, shell actions, and headless JSON runs.
$npm install -g @google/gemini-cli
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
Gemini CLI is Google's terminal coding agent for working inside a local repository through an interactive session or headless one-shot run. It wraps model-driven coding help with built-in file, shell, web, MCP, and skill surfaces.
What It Enables
- Inspect and edit a local codebase, run shell commands, read or write files, and use built-in web search or fetch tools from one terminal session.
- Run one-shot coding or repo prompts in scripts, CI helpers, or wrappers, with structured JSON or streaming JSON output for downstream parsing.
- Extend the base agent with MCP servers, workspace context files, and reusable skills for project-specific workflows.
Agent Fit
- Headless mode has explicit JSON and JSONL formats, documented exit codes, and flags for approval mode, model selection, session resume, and included directories.
- The default experience is still an interactive TUI with auth, confirmation, and trust flows, so unattended usage needs preconfiguration and remains less deterministic than service-specific CLIs.
- Best fit when you want a higher-level repo automation loop in the shell; it can also connect to MCP-based setups when that integration model is needed.
Caveats
- Automation should use
--promptor--output-formatexplicitly because docs disagree on whether positional prompts default to one-shot or interactive mode in a TTY. - Browser-based sign-in and tool approval or trust settings can block unattended runs until you configure auth and policies.