Create custom commands for repetitive tasks.Custom commands let you specify a prompt you want to run when that command is executed in Gammacode.
/init, /undo, /redo, /help.
Create command files
Create markdown files in thecommand/ directory to define custom commands.
Create .gammacode/command/test.md:
/ followed by the command name.
Configure
You can add custom commands by creating markdown files in thecommand/ directory.
Markdown configuration
Define commands using markdown files. Place them in:- Global:
~/.gammacode/command/ - Per-project:
.gammacode/command/
test.md lets you run:
Prompt configuration
The prompts for the custom commands support several special placeholders and syntax.Arguments
Pass arguments to commands using the$ARGUMENTS placeholder.
$ARGUMENTS will be replaced with Button.
Shell output
Use!command“ to inject bash command output into your prompt.
For example, to create a custom command that analyzes test coverage:
File references
Include files in your command using@ followed by the filename.
Configuration options
Description
Use thedescription option to provide a brief description of what the command does.
Agent
Use theagent config to optionally specify which agent should execute this command. If this is a subagent, the command will trigger a subagent invocation by default.
Model
Use themodel config to override the default model for this command.
Subtask
Use thesubtask boolean to force the command to trigger a subagent invocation. This is useful if you want the command to not pollute your primary context.
Examples
Test runner command
Component generator
Code review command
Documentation updater
/docs src/utils/helper.js
Security audit
Built-in commands
Gammacode includes several built-in commands like/init, /undo, /redo, /share, /help.
Custom commands can override built-in commands. If you define a custom command with the same name, it will override the built-in command.
Use cases
Here are some common use cases for custom commands:- Development workflows: Automated testing, building, and deployment commands
- Code analysis: Security audits, performance analysis, code quality checks
- Documentation: Generating or updating documentation for specific files or modules
- Project setup: Creating new components, services, or features with boilerplate code
- Git operations: Custom commit messages, branch management, release preparation
- Debugging: Analyzing logs, running diagnostics, troubleshooting issues
Best practices
- Use descriptive names: Choose command names that clearly indicate their purpose
- Leverage arguments: Use
$ARGUMENTSto make commands flexible and reusable - Combine with agents: Use specific agents for specialized tasks (e.g., security agent for audits)
- Include context: Use shell output and file references to provide relevant context
- Keep focused: Each command should have a single, clear purpose
- Document usage: Include clear descriptions and examples of how to use the command
- Version control: Check project commands into version control for team sharing
Advanced usage
Conditional logic
You can create commands that adapt based on the current state:Multi-step workflows
Create commands that perform complex, multi-step operations:Environment-specific commands
Tailor commands for different environments:Next steps
Agents
Learn about creating and using specialized AI agents for task-specific workflows
Headless Mode
Learn how to run Gammacode programmatically without interactive UI
Development Workflows
Step-by-step guides for common development tasks and best practices
Quickstart
Get started with Gammacode in just a few minutes