Gemini CLI

repository·main·Indexed 13 days ago

https://github.com/google-gemini/gemini-cli

An open-source AI agent bringing Gemini's multimodal capabilities to the terminal. It allows developers to query codebases, automate workflows, and integrate external tools via the Model Context Protocol (MCP). Features include the Agent Client Protocol (ACP) for IDE extension communication and a behavioral evaluation framework for validating model decision-making and steering.

Tokens
172K
Snippets
515
Records
818
Agent score
99%

What's inside Gemini CLI

  1. Gemini CLI Companion features

    main

    The extension provides several context-aware features to enhance the Gemini CLI experience:

    • Open Editor File Context: Provides Gemini CLI with awareness of all files currently open in your editor, improving project structure understanding.
    • Selection Context: Grants Gemini CLI access to your cursor position and any text you have currently selected.
    • Native Diffing: Allows you to seamlessly view, modify, and accept code changes suggested by the CLI directly within the editor interface.
  2. Understand Gemini CLI licensing and service terms

    main

    Gemini CLI is an open-source tool licensed under the Apache 2.0 license.

    Important Note: While the CLI software itself is Apache 2.0, your access to the underlying AI services (like Gemini Code Assist or Gemini Developer API) is governed by the specific Terms of Service and Privacy Notices of those Google services.

    Prohibited Action: Directly accessing the services powering Gemini CLI using third-party software or tools (e.g., using OpenClaw with Gemini CLI OAuth) is a violation of terms and may result in account suspension or termination.

  3. Compare Gemini CLI quotas and pricing tiers

    main

    Gemini CLI quotas depend on your authentication method. Choose between Free usage (experimentation), Paid tiers (fixed cost for predictable usage), or Pay-as-you-go (flexible, usage-based billing for professional/uninterrupted workflows).

    Authentication methodTier / SubscriptionMax requests / user / day
    Google accountGemini Code Assist (Individual)1,000
    Google AI Pro1,500
    Google AI Ultra2,000
    Gemini API keyFree tier (Unpaid)250
    Pay-as-you-go (Paid)Varies
    Vertex AIExpress mode (Free)Varies
    Pay-as-you-go (Paid)Varies
    Google WorkspaceCode Assist Standard1,500
    Code Assist Enterprise2,000
    Workspace AI Ultra2,000
  4. What is the `activate_skill` tool?

    main

    The activate_skill tool is a specialized mechanism that allows the Gemini agent to load procedural expertise and resources tailored to specific engineering tasks.

    Skills are packages containing instructions and tools for tasks like code reviews, pull request creation, or documentation writing. When the agent activates a skill, it gains:

    • Specialized logic: Expert-level procedures for complex workflows.
    • Dynamic capability: Access to new, task-specific tools.
    • Contextual awareness: Focus on relevant standards and conventions for the specific task.

    Note: This tool is used exclusively by the Gemini agent. You cannot invoke activate_skill manually.

  5. What is Plan Mode and when to use it

    main

    Plan Mode is a read-only environment designed for architecting solutions before implementation. It allows you to research a project, design solutions, and align on an execution strategy without the risk of accidental code changes.

    In Plan Mode, Gemini CLI is restricted to read-only tools (like file reading and searching) and can only write to specific plan files (Markdown) to document the proposed strategy. This ensures you can evaluate trade-offs and reach an agreement on the approach before any actual codebase modifications occur.

  6. Overview of Gemini CLI extensions

    main

    Gemini CLI extensions allow users to package and share various capabilities in a standardized format. Supported extension types include:

    • Prompts: Pre-defined prompt templates.
    • MCP Servers: Model Context Protocol servers.
    • Custom Commands: New CLI commands.
    • Themes: Visual customizations.
    • Hooks: Lifecycle hooks for the CLI.
    • Sub-agents: Specialized agents for specific tasks.
    • Agent Skills: Specific abilities granted to agents.

    Extensions are designed to be easily installable from GitHub or local paths and can be discovered via the Gemini CLI extension gallery.

  7. What is Antigravity CLI?

    main

    Antigravity CLI is a next-generation terminal interface for collaborating with autonomous agents on local codebases. It uses an interactive Terminal User Interface (TUI) to coordinate code generation, reasoning, and workspace tasks.

    Key features include:

    • Autonomous Agent Collaboration: Direct interaction with agents within the terminal.
    • Interactive TUI: A dedicated interface designed specifically for agent workflows.
    • Workspace Integration: Deep context and understanding of your local workspace structure.
  8. What is an MCP server and how does it integrate with Gemini CLI?

    main

    An MCP (Model Context Protocol) server is an application that exposes tools and resources to the Gemini CLI, acting as a bridge between the Gemini model and your local environment or external services (APIs, databases, etc.).

    Gemini CLI uses MCP servers to:

    • Discover tools: List available tools, descriptions, and parameters via standardized schemas.
    • Execute tools: Call tools with specific arguments and receive structured responses.
    • Access resources: Read data from exposed resources like files, API payloads, or reports.

    The integration is split into two layers:

    1. Discovery Layer (mcp-client.ts): Iterates through mcpServers in settings.json, establishes connections, fetches/validates tool schemas, and registers them in the global registry.
    2. Execution Layer (mcp-tool.ts): Wraps tools in DiscoveredMCPTool instances to handle confirmation logic, execution, response processing, and connection state.
  9. Overview of Gemini CLI Extension Features

    main

    Gemini CLI extensions allow you to expand the CLI's capabilities through several different mechanisms. Choose the feature based on how you want the model or user to interact with it:

    FeatureDescriptionInvocation
    MCP serverExposes new tools and data sources (e.g., querying a database or API) via the Model Context Protocol.Model
    Custom commandsShortcuts (e.g., /my-cmd) that execute pre-defined prompts or shell commands.User
    Context file (GEMINI.md)Markdown instructions loaded into the model's context at the start of every session to define personality or standards.CLI (to Model)
    Agent skillsSpecialized instructions/workflows activated by the model only when a specific task is identified (e.g., "audit security").Model
    HooksIntercept and customize CLI behavior at specific lifecycle events (e.g., before/after a tool call).CLI
    Custom themesColor definitions to personalize the CLI UI.User (via /theme)
  10. How ACP and MCP work together

    main

    ACP (Agent Client Protocol) can be extended using MCP (Model Context Protocol) to allow an IDE to expose its own functionality as tools to the Gemini model.

    The workflow is as follows:

    1. The client (e.g., an IDE) implements an MCP server that advertises its tools.
    2. During the ACP initialize handshake, the client provides the connection details for its MCP server.
    3. Gemini CLI connects to the MCP server, discovers the tools, and makes them available to the AI model.
    4. When the model needs a tool, Gemini CLI sends a tool call request to the MCP server.