create-command Guide Skill
This skill allows Tars to create custom slash commands for Gemini CLI extensions.
Instructions
- •Locate Extension: Navigate to the target extension directory (e.g.,
~/.gemini/extensions/<name>). - •Create Directory: Create a
commandsdirectory if it doesn't exist, and a subdirectory for the command group (e.g.,commands/utils).- •The directory structure determines the command name:
commands/<group>/<name>.tomlbecomes/<group>:<name>.
- •The directory structure determines the command name:
- •Create TOML File: Create a
.tomlfile with the command definition. - •Define Content:
- •
prompt: The text sent to the LLM. - •
{{args}}: Placeholder for user arguments. - •
!{command}: Syntax to execute shell commands and inject output.
- •
Template
toml
# commands/utils/summarize.toml
prompt = """
Please summarize the content of the following file:
File Content:
!{cat {{args}}}
"""
Usage
After creating the file, restart the Gemini CLI (or re-link extension). Default commands are available immediately in commands/.
The command above would be invoked as /utils:summarize path/to/file.