What is a Gemini CLI Extension?

Learn how to use and create powerful extensions for Gemini CLI

Introduction

Gemini CLI extensions are a new framework that allows you to customize Gemini CLI and connect it to the tools you use most, all from the command line. Instead of context-switching between your terminal and other tools, you can now bring those tools directly into your workflow.

Gemini CLI is an open-source, AI-powered agent for your terminal, and extensions are its power-ups — pre-packaged, easily installable integrations that connect it to external tools including everything from databases and design platforms to payment services.

With over one million developers building with Gemini CLI in just three months since launch, an open ecosystem of extensions from Google, industry leaders like Dynatrace, Elastic, Figma, Harness, Postman, Shopify, Snyk, and Stripe, and the broader open-source community is now available.

How It Works

1. The Playbook Concept

Each extension contains a built-in "playbook" that instantly teaches the AI how to use new tools effectively. This means you get meaningful results from the very first command, no complex setup required, allowing you to tailor your experience with the tools most valuable to you.

2. Installation

It's easy to install an extension — simply type:

gemini extensions install <GitHub URL or local path>

3. What's Inside an Extension

Extensions package instructions, MCP servers and custom commands into a familiar format. They can bundle:

  • One or more MCP servers: To connect with external tools and services
  • Context files: Like GEMINI.md or custom context file types, to provide specific instructions
  • Excluded tools: Useful for disabling built-in tools or offering alternative implementations
  • Custom commands: To encapsulate complex prompts into simple slash commands

Creating Your Own Extension

Step 1: Initialize Your Project

mkdir my-gemini-extension cd my-gemini-extension npm init -y

Step 2: Create Extension Manifest

Create a gemini-extension.json file:

{ "name": "my-extension", "version": "1.0.0", "description": "My awesome Gemini CLI extension", "main": "dist/index.js", "author": "Your Name", "license": "MIT", "keywords": ["gemini", "cli", "extension"], "commands": [ { "name": "hello", "description": "Say hello", "usage": "gemini hello [name]" } ] }

Step 3: Implement Your Extension

Create your extension logic in TypeScript or JavaScript:

export default function extension(gemini) { gemini.registerCommand('hello', (args) => { const name = args[0] || 'World'; console.log(`Hello, ${name}!`); }); }

Best Practices

  • Use clear, descriptive names for commands and options
  • Provide comprehensive documentation and examples
  • Handle errors gracefully with helpful messages
  • Write tests for your extension functionality
  • Keep dependencies minimal and up-to-date
  • Follow semantic versioning for releases

Resources

Ready to Share Your Extension?

Submit your extension to our directory and reach thousands of developers

Submit Extension