Skip to main content
Gemini CLI extensions package prompts, MCP servers, custom commands, themes, hooks, sub-agents, and agent skills into a familiar and user-friendly format. Extensions enable you to expand the capabilities of Gemini CLI and share those capabilities with others.

Extension Gallery

Browse the official Gemini CLI extension gallery to discover available extensions

What Are Extensions?

Extensions are self-contained packages that can include:

MCP Servers

Expose new tools and data sources to the model

Custom Commands

Create shortcuts for repetitive tasks and complex prompts

Context Files

Provide persistent instructions and knowledge to the model

Agent Skills

Bundle specialized expertise for complex tasks

Hooks

Customize CLI behavior at lifecycle events

Themes

Personalize the CLI’s visual appearance

Choose Your Path

Learn how to discover, install, and manage extensions to enhance your Gemini CLI experience.

Installation

Install an extension from GitHub:
gemini extensions install https://github.com/gemini-cli-extensions/workspace

Managing Extensions

List installed extensions:
# From CLI
gemini extensions list

# From interactive session
/extensions list

Extension Reference

Learn about advanced installation options and management commands

Extension Features

Decide which features your extension needs based on your use case.
What it is: A standard way to expose new tools and data sources to the model.When to use it: Use this when you want the model to perform new actions like:
  • Fetching data from an internal API
  • Querying a database
  • Controlling a local application
  • Accessing external services
Invoked by: Model automaticallyExample:
server.registerTool(
  'fetch_posts',
  {
    description: 'Fetches posts from API',
    inputSchema: z.object({}).shape,
  },
  async () => {
    const response = await fetch('https://api.example.com/posts');
    return { content: [{ type: 'text', text: JSON.stringify(await response.json()) }] };
  }
);

MCP Server Guide

Learn more about MCP server integration
What it is: A shortcut (like /my-cmd) that executes a pre-defined prompt or shell command.When to use it: Use this for:
  • Repetitive tasks
  • Saving long, complex prompts
  • Automation workflows
Invoked by: User manuallyExample:
# commands/fs/grep-code.toml
prompt = """
Please summarize the findings for the pattern `{{args}}`.

Search Results:
!{grep -r {{args}} .}
"""
Usage: /fs:grep-code "function.*User"

Custom Commands

Learn about creating custom commands
What it is: A markdown file containing instructions loaded into the model’s context at the start of every session.When to use it: Use this to:
  • Define the extension’s “personality”
  • Set coding standards
  • Provide essential knowledge the model should always have
Invoked by: CLI provides to model automaticallyExample:
# My Extension Instructions

You are an expert developer assistant specializing in Python.
When analyzing code:
1. Check for PEP 8 compliance
2. Suggest type hints where missing
3. Recommend modern Python idioms
Configure in gemini-extension.json:
{
  "contextFileName": "GEMINI.md"
}
What it is: Specialized instructions and workflows that the model activates only when needed.When to use it: Use this for:
  • Complex, occasional tasks (“create a PR”, “audit security”)
  • Avoiding context window clutter when skill isn’t needed
  • Task-specific expertise
Invoked by: Model when task matches skill descriptionExample:
---
name: security-audit
description: Expertise in auditing code for security vulnerabilities
---

# Security Auditor

When auditing code:
1. Look for common vulnerabilities (OWASP Top 10)
2. Check for hardcoded secrets or API keys
3. Suggest remediation steps for any findings

Agent Skills

Learn about agent skills system
What it is: A way to intercept and customize the CLI’s behavior at specific lifecycle events.When to use it: Use this when you want to:
  • Validate tool arguments before execution
  • Log activity for auditing
  • Modify the model’s input/output
  • Automate actions based on model behavior
Invoked by: CLI at specific lifecycle eventsExample:
export default {
  beforeToolCall: async (toolName, params) => {
    console.log(`Executing ${toolName}`);
    // Validate, modify, or block the tool call
    return params;
  },
  afterToolCall: async (toolName, result) => {
    console.log(`Completed ${toolName}`);
    return result;
  }
};

Hooks System

Learn about the hooks system
What it is: A set of color definitions to personalize the CLI UI.When to use it: Use this to:
  • Provide a unique visual identity for your extension
  • Offer specialized high-contrast schemes
  • Create thematic color palettes
Invoked by: User via /theme commandExample:
{
  "themes": {
    "myTheme": {
      "primary": "#00ff00",
      "secondary": "#0000ff",
      "background": "#1e1e1e",
      "text": "#ffffff"
    }
  }
}
Usage: /theme myTheme

Themes Reference

Learn about theme configuration

Example Use Cases

API Integration

Create an extension with MCP tools to interact with your internal API

Code Quality

Bundle linting commands and context about your team’s coding standards

Database Tools

Expose database query tools and migration commands

DevOps Workflows

Package deployment commands and infrastructure management tools

Documentation

Create commands that generate and update project documentation

Testing Utilities

Bundle test generation skills and test execution commands

Getting Started

1

Install an Extension

Try installing an extension from the gallery:
gemini extensions install https://github.com/gemini-cli-extensions/workspace
2

Explore Capabilities

Use /extensions list to see what the extension provides
3

Create Your Own

When ready, create your first extension:
gemini extensions new my-extension mcp-server

Next Steps

Writing Extensions

Complete guide to creating your first extension

Extension Reference

Detailed API reference and configuration options

Best Practices

Learn how to build secure and reliable extensions

Publishing Guide

Share your extension with the community

Build docs developers (and LLMs) love