Skip to main content
The hooks command manages event-driven hooks configured in .praison/hooks.json.

Quick Start

List event hooks example

Usage

List Hooks

Expected Output:

Show Statistics

Initialize Hooks

Creates a template .praison/hooks.json file.

Hooks Configuration

Manage Event-Driven Hooks Configure hooks in .praison/hooks.json:

Available Hook Events

Hook Types

Shell Hooks

Python Hooks

How It Works

  1. Load: Hooks are loaded from .praison/hooks.json
  2. Register: Hooks are registered for specific events
  3. Trigger: Events trigger corresponding hooks
  4. Execute: Hook commands/functions are executed with context

Context Variables

Hooks receive context variables that can be used in commands:

Examples

Code Formatting Hook

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.