Documentation Index
Fetch the complete documentation index at: https://docs.enconvo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Hooks let you trigger shell commands or HTTP requests whenever something happens in EnConvo - like an agent starting, completing, or failing. No coding required - just create a JSON config file.Quick Start
Configuration
The config file lives at~/.config/enconvo/hooks.json. The structure is:
| Field | Type | Required | Description |
|---|---|---|---|
event_name | string | Yes | The event to listen for (top-level key) |
matcher | string | No | Regex to filter events. Empty = match all |
hooks | array | Yes | List of hooks to execute |
Hook Types
Command Hook
Runs a shell command. Event data is sent to stdin as JSON.| Field | Type | Default | Description |
|---|---|---|---|
type | "command" | - | Required |
command | string | - | Shell command to execute |
timeout | number | 30000 | Timeout in milliseconds |
HTTP Hook
Sends a POST request with event data as the JSON body.| Field | Type | Default | Description |
|---|---|---|---|
type | "http" | - | Required |
url | string | - | HTTP endpoint URL |
method | string | "POST" | HTTP method |
headers | object | {} | Additional headers |
timeout | number | 30000 | Timeout in milliseconds |
Event Data Format
Both command hooks (stdin) and HTTP hooks (request body) receive the same JSON:| Field | Description |
|---|---|
event | Short event name |
fullEvent | Full internal event name |
params | Event-specific payload |
timestamp | Unix timestamp in milliseconds |
Available Events
| Event | Params | When |
|---|---|---|
run_status_changed | { commandKey, runStatus } | Agent/chat/bot changes to running, completed, or failed |
recent_chat_list_changed | { command, commandKey } | Recent chat list is updated |
audio_progress_<hash> | { currentTime, duration, progress } | Audio playback progress |
audio_played_<hash> | {} | Audio playback completed |
audio_state_<hash> | { state } | Audio player state changed |
Extensions can fire custom events. Any event name used by an extension can be used as a hook trigger.
Examples
macOS Notification on Agent Failure
Get a native notification when any agent fails:Log All Status Changes
Write a timestamped log of every agent status change:Slack Webhook
Send a message to Slack when an agent completes:Custom Script
Create a script that reads event data from stdin and takes action:Multiple Hooks on One Event
You can run multiple hooks for the same event. They all execute concurrently:Important Notes
Hooks are fire-and-forget
Hooks are fire-and-forget
Hooks run in the background and do not block EnConvo. If a hook fails or times out, it is logged to the server console but does not affect the event flow.
Config reloads automatically
Config reloads automatically
The
hooks.json file is checked for changes (by modification time) each time an event fires. You can edit the file while EnConvo is running - no restart needed.Use absolute paths
Use absolute paths
Shell commands run with the server’s environment. Use absolute paths for scripts, or prefix with
bash to enable ~ expansion.Debugging hooks
Debugging hooks
To test your hook script manually, pipe sample JSON to it:
Event System for Developers
Build extensions that listen and react to events programmatically
Agents
Learn about EnConvo agents and custom bots