Welcome to your incredibly powerful custom slash command system! This feature lets you create personal shortcuts, integrate external tools, and automate your workflow.
/custom example/custom editAdd this to your config:
{
"commands": {
"hello": {
"type": "text",
"description": "Say hello with style",
"text": "👋 Hello {user}! Welcome to {cwd}"
}
}
}/hello{
"todo": {
"type": "template",
"description": "Quick todo list",
"template": "📝 TODO ({user} @ {cwd})\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n{args}\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
},
"note": {
"type": "template",
"description": "Quick note taking",
"template": "📓 Note ({user}): {args}\n📍 {cwd}\n⏰ {model} session"
}
}{
"test": {
"type": "shell",
"description": "Run project tests",
"command": "pytest tests/ -v",
"dry_run": false
},
"lint": {
"type": "shell",
"description": "Check and format code",
"command": "ruff check . && ruff format ."
}
}{
"stats": {
"type": "function",
"description": "Show session statistics",
"function": "clippy.cli.custom_commands.show_session_stats"
},
"whoami": {
"type": "text",
"description": "Show current context",
"text": "👋 User: {user}\n📁 Directory: {cwd}\n🤖 Model: {model}"
}
}Execute shell commands safely with argument substitution.
{
"git": {
"type": "shell",
"command": "git {args}",
"dry_run": false, // Set true to preview without executing
"timeout": 30, // Command timeout in seconds
"dangerous": false // Allow dangerous operations
}
}Display static text with basic variables.
{
"welcome": {
"type": "text",
"text": "Welcome {user}! Your current directory is {cwd}",
"formatted": true // Enable rich text formatting
}
}Advanced templating with more variables.
{
"report": {
"type": "template",
"template": "Report by {user} using {model} with {message_count} messages",
"formatted": true
}
}Call Python functions for complex behavior.
{
"deploy": {
"type": "function",
"function": "my_tools.deploy_function"
}
}/custom list/custom edit # Opens in your default editor
/custom edit vim # Use specific editor/custom reload/custom help- Dangerous commands (rm, sudo, etc.) are blocked by default
- Set
"dangerous": trueto enable specific commands - Use
"dry_run": trueto preview commands
Available variables in templates:
{args}- Command arguments{user}- Current username{cwd}- Current working directory{model}- Current AI model{provider}- Current provider{message_count}- Number of messages
Enable beautiful output with colors and styling:
{
"colorful": {
"type": "text",
"text": "[bold green]Success![/bold green] Task completed.",
"formatted": true
}
}/bootstrap my-new-project{
"bootstrap": {
"type": "shell",
"description": "Create new project structure",
"command": "mkdir {args} && cd {args} && npm init -y && mkdir src tests docs",
"dangerous": false
}
}/api-test GET https://api.example.com/users{
"api-test": {
"type": "shell",
"description": "Quick API request testing",
"command": "curl -X {args} -w '\\n\\nHTTP Status: %{http_code}\\nTime: %{time_total}s\\n'",
"timeout": 10
}
}/standup Working on user authentication, fixed login bug, need to review PRs{
"standup": {
"type": "template",
"description": "Daily standup notes format",
"template": "📋 Daily Standup ({user}) - {model}\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n✅ Yesterday: {args}\\n🎯 Today: \\n🚧 Blockers: \\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
}
}Custom commands work seamlessly with all clippy-code features:
- MCP Servers: Create shortcuts to access specific MCP tools
- Subagents: Commands that delegate to specialized agents
- Models: Quick model switching for different tasks
- File Operations: Streamlined file management
- Project Management: Commands for your specific workflows
Here are some ideas to inspire you:
{
"fortune": {
"type": "shell",
"command": "echo 'You will have a great coding session! 🚀'"
},
"coffee": {
"type": "text",
"text": "☕ Time for a coffee break, {user}! You've earned it."
}
}{
"learn": {
"type": "template",
"template": "📚 Learning Topic: {args}\\n\\n🔗 Resources:\\n• Documentation\\n• Examples\\n• Tutorials\\n\\n📝 Notes:"
}
}{
"backup": {
"type": "shell",
"command": "cp -r src backup_$(date +%Y%m%d_%H%M%S) && echo '✅ Backup completed!'"
}
}- Start Simple: Begin with text commands, then expand
- Use Dry Run: Test shell commands with
"dry_run": truefirst - Secure Commands: Only enable
"dangerous": truewhen necessary - Clear Naming: Use descriptive command names
- Good Descriptions: Helpful descriptions appear in
/help - Test Thoroughly: Use
/custom reloadafter changes
🎊 Congratulations! You now have an incredibly flexible command system that can adapt to your exact workflow. The possibilities are endless – start creating your perfect AI assistant experience today!
Remember: Edit ~/.clippy/custom_commands.json and run /custom reload to apply changes. Happy customizing! 📎✨