Craft AI Coding Workflows: Gemini CLI Slash Commands
Enhance dev workflows using Gemini CLI's custom slash commands. Create code reviews, tests, docs & more via TOML files. Supports user/project-level scopes & namespacing.
"AI Disruption" Publication 7300 Subscriptions 20% Discount Offer Link.
Custom slash commands are now standard in CLIs, allowing for quick preset workflow construction.
The latest version of Gemini CLI has also added support, which can now be implemented through TOML files or MCP.
Using Gemini CLI custom slash commands involves two steps: Description and invocation. The rule is that the filename becomes the command name.
Like Claude Code, scopes can be defined: User-level commands: Create .toml files in the ~/.gemini/commands/ directory
Project-level commands: Create .toml files in the .gemini/commands/ directory.
Naming convention: Filename becomes the command name, supports namespacing like git/commit.toml becomes /git:commit
Custom slash command examples:
Simple Code Review Command
# ~/.gemini/commands/review.toml
description = "Review specified code files or directories"
prompt = """
Please review the quality of the following code: {{args}}
Focus on:
1. Code readability and maintainability
2. Potential performance issues
3. Security issues
4. Best practice recommendations
Please provide specific improvement suggestions.
"""