Welcome! This guide will show you how to use, create, and manage Agent Skills with the Gemini CLI.
Skills are modular, self-contained packages that extend Gemini CLI's capabilities. They provide specialized knowledge, workflows, and tools, transforming Gemini CLI from a general-purpose assistant into a specialized agent for specific tasks.
When using the Gemini CLI interactively, you can manage your skills with the following commands:
/skills list— View all currently installed and active skills./skills reload— Reload skills (required after installing or updating a skill).
To install a skill package from the command line, use:
gemini skills install <path-to-skill.skill> --scope workspace
# Use --scope user for a global installationTo use the Gemini CLI, you must have a valid Google Gemini API key.
- Get your API key: Obtain one from Google AI Studio.
- Setup your environment:
- Create a
.envfile in the project root:cp .env.example .env
- Edit
.envand replaceyour_api_key_herewith your actual key. - Alternatively, you can export it directly in your shell profile:
export GEMINI_API_KEY='your-actual-key'
- Create a
Let's create a local skill that helps the agent summarize scripts effectively.
We have created an example skill in the summarize-scripts/ directory in this workspace.
Every skill requires a SKILL.md file containing YAML frontmatter (name and description) and Markdown instructions.
summarize-scripts/SKILL.md:
---
name: summarize-scripts
description: Use this skill when the user asks to summarize a script, code file, or program. It provides structured guidelines on how to concisely describe the purpose, inputs, outputs, and core logic.
---
# Summarize Scripts Skill
When asked to summarize a script, always follow this structured format:
1. **Purpose**: A one-sentence summary of what the script does.
2. **Inputs & Outputs**: What arguments or data does it consume? What files or stdout does it produce?
3. **Core Logic**: Maximum 3 bullet points explaining the main algorithm or flow.
4. **Dependencies**: Any major external libraries or tools it relies on.
Keep the summary concise. Do not regurgitate the code.Once you have created your skill directory and SKILL.md, you can package and install it (assuming you have the skill-creator available):
-
Package the skill:
node /path/to/skill-creator/scripts/package_skill.cjs ./summarize-scripts
This generates a
summarize-scripts.skillfile. -
Install the skill:
gemini skills install ./summarize-scripts.skill --scope workspace
-
Reload: Open your Gemini CLI and type
/skills reload.
You don't have to write every skill from scratch. You can discover and install skills from the open agent skills ecosystem using the Skills CLI (npx skills).
To search for a skill (for example, to help with React performance):
npx skills find react performanceAs an example, let's say you want to install a skill like find-skills (a skill that helps the agent search for other skills):
npx skills add example-org/repo@find-skills -g -y(The -g flag installs it globally at the user-level, and -y skips confirmation prompts).
After installation, simply run /skills reload in your Gemini CLI session. You can now ask Gemini CLI things like, "Find a skill that helps me write tests in Jest", and it will automatically use the hosted skill you just installed!