Basic Usage
Validation Patterns
Required Arguments
Optional Arguments
Default Values
Argument Parsing
Quoted Strings
Quoted arguments are treated as single values:Multiple Words
Flags and Options
Conditional Logic
Argument Count
Argument Validation
Environment Variable Substitution
Advanced Patterns
Multi-Command Dispatch
File Path Expansion
Interactive Argument Collection
Escaping and Special Characters
Quotes in Arguments
Paths with Spaces
Error Handling
Testing Arguments
Best Practices
Validate Early
Check arguments at the start. Fail fast with clear error messages.
Document Examples
Show usage examples in the command description or body.
Use Defaults
Provide sensible defaults for optional arguments.
Quote Paths
Always quote file paths that might contain spaces.
Next Steps
Delegation
Pass arguments to agents
Frontmatter
Command configuration options
Agents
Create agents that accept arguments
Examples
Real-world command examples