Gemini CLI

Google's open-source terminal agent on Gemini models: code work, shell, web search and MCP

CLIEditors’ pickHigh risk

google-gemini/gemini-cli

Install

npm install -g @google/gemini-cli

Global install via npm

This is third-party code. Review the repository files before installing.

What it does

Gemini CLI is a terminal agent that reads and edits codebases, runs shell commands, fetches web pages and uses Google Search grounding for current data. It supports MCP servers, GEMINI.md context files, session checkpoints and a non-interactive mode with JSON output for scripts. A separate GitHub Action handles PR reviews and issue triage. The repository also ships skills such as code-reviewer.

Who it is for. Developers who live in the terminal and want a Gemini-based agent with a free tier.

Good fit when

  • You need to understand a large codebase with long context
  • You want to automate tasks in scripts via gemini -p with JSON output
  • You need PR reviews and issue triage in GitHub Actions
  • You connect your own MCP servers to the agent

Not a fit when

  • Your network cannot reach Google services
  • Company policy forbids sending code to external models

Example request

Explain the architecture of this repository and find where authorization errors are handled

Limitations

Requires a Google account, a Gemini API key or Vertex AI. The free tier with Google sign-in is 60 requests per minute and 1,000 per day. Preview and nightly builds may contain regressions.

How to disable. Remove the package with npm uninstall -g @google/gemini-cli or via brew, depending on how you installed it.

Security check

  • The agent runs shell commands and edits files
  • Code and prompts are sent to Google models
  • Requires a Google account or API key

README in short

Gemini CLI is Google's open-source terminal AI agent under Apache 2.0. The README covers installation via npx, npm, Homebrew, MacPorts and conda, release channels and three auth options. Features include codebase work, multimodal input, MCP, Google Search grounding, checkpoints and context files. GitHub integration via the Gemini CLI GitHub Action is described separately.

SKILL.md

---
name: code-reviewer
description:
  Use this skill to review code. It supports both local changes (staged or working tree)
  and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability,
  and adherence to project standards.
---

# Code Reviewer

This skill guides the agent in conducting professional and thorough code reviews for both local development and remote Pull Requests.

## Workflow

### 1. Determine Review Target
*   **Remote PR**: If the user provides a PR number or URL (e.g., "Review PR #123"), target that remote PR.
*   **Local Changes**: If no specific PR is mentioned, or if the user asks to "review my changes", target the current local file system states (staged and unstaged changes).

### 2. Preparation

#### For Remote PRs:
1.  **Checkout**: Use the GitHub CLI to checkout the PR.
    ```bash
    gh pr checkout <PR_NUMBER>
    ```
2.  **Preflight**: Execute the project's standard verification suite to catch automated failures early.
    ```bash
    npm run preflight
    ```
3.  **Context**: Read the PR description and any existing comments to understand the goal and history.

#### For Local Changes:
1.  **Identify Changes**:
    *   Check status: `git status`
    *   Read diffs: `git diff` (working tree) and/or `git diff --staged` (staged).
2.  **Preflight (Optional)**: If the changes are substantial, ask the user if they want to run `npm run preflight` before reviewing.

### 3. In-Depth Analysis
Analyze the code changes based on the following pillars:

*   **Correctness**: Does the code achieve its stated purpose without bugs or logical errors?
*   **Maintainability**: Is the code clean, well-structured, and easy to understand and modify in the future? Consider factors like code clarity, modularity, and adherence to established design patterns.
*   **Readability**: Is the code well-commented (where necessary) and consistently formatted according to our project's coding style guidelines?

FAQ

Can I try it without installing?

Yes, the README suggests running npx @google/gemini-cli.

What release channels exist?

preview ships on Tuesdays, stable follows a week after preview, and nightly ships daily.

Editors’ pick

A self-improving agent from Nous Research with a TUI, messaging gateway, cron jobs and skills it writes itself

CLIHigh risk245.5K
Editors’ pick

Anthropic's coding agent for the terminal, IDE and GitHub: understands your codebase, runs tasks and handles git

CLIHigh risk145K
Editors’ pick

OpenAI's coding agent that runs locally in your terminal, with IDE and desktop versions

CLIHigh risk124.1K
Editors’ pick

Open-source coding agent for VS Code, JetBrains, the terminal and desktop, with any model and MCP support

CLIHigh risk68K