Skip to content

francois-vz/agent-skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Skills with Gemini CLI: Hello World

Welcome! This guide will show you how to use, create, and manage Agent Skills with the Gemini CLI.

What are Agent Skills?

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.

Essential Gemini CLI Commands

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 installation

Configuration & API Key

To use the Gemini CLI, you must have a valid Google Gemini API key.

  1. Get your API key: Obtain one from Google AI Studio.
  2. Setup your environment:
    • Create a .env file in the project root:
      cp .env.example .env
    • Edit .env and replace your_api_key_here with your actual key.
    • Alternatively, you can export it directly in your shell profile:
      export GEMINI_API_KEY='your-actual-key'

Example 1: Creating a Local Skill

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.

Anatomy of our summarize-scripts skill:

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.

Packaging and Installing

Once you have created your skill directory and SKILL.md, you can package and install it (assuming you have the skill-creator available):

  1. Package the skill:

    node /path/to/skill-creator/scripts/package_skill.cjs ./summarize-scripts

    This generates a summarize-scripts.skill file.

  2. Install the skill:

    gemini skills install ./summarize-scripts.skill --scope workspace
  3. Reload: Open your Gemini CLI and type /skills reload.


Example 2: Adding Hosted Skills

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).

Finding Skills

To search for a skill (for example, to help with React performance):

npx skills find react performance

Installing a Hosted Skill

As 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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages