The hooks command manages event-driven hooks configured in .praison/hooks.json.
Quick Start
Usage
List Hooks
Expected Output:
Show Statistics
Initialize Hooks
Creates a template .praison/hooks.json file.
Hooks Configuration
Configure hooks in .praison/hooks.json:
Available Hook Events
Hook Types
Shell Hooks
Python Hooks
How It Works
- Load: Hooks are loaded from
.praison/hooks.json
- Register: Hooks are registered for specific events
- Trigger: Events trigger corresponding hooks
- Execute: Hook commands/functions are executed with context
Context Variables
Hooks receive context variables that can be used in commands:
Examples
Linting Hook
Error Logging Hook
Programmatic Usage
Best Practices
Use hooks for consistent code formatting and validation across your project.
Hooks add execution time. Keep hook commands fast to avoid slowing down agent operations.