Configuration
The CLI stores configuration in a JSON file and supports environment variables for advanced usage.
Config file
Location: ~/.config/hooklistener/config.json
Format:
{
"access_token": "ey...",
"token_expires_at": "2026-04-14T12:34:56Z",
"selected_organization_id": "org_abc123"
}
| Field | Description |
|---|---|
access_token | Session token from the device code flow |
token_expires_at | Token expiration (60 days from login) |
selected_organization_id | Default organization for commands |
The CLI manages access_token and token_expires_at automatically through the login/logout commands.
Viewing configuration
hooklistener config show
Displays:
- Config file path
- Token status (present/absent, valid/expired)
- Selected organization ID
Setting configuration values
# Set the default organization
hooklistener config set selected_organization_id org_abc123
# Clear a value
hooklistener config set selected_organization_id none
Environment variables
Override default URLs for self-hosting or development:
| Variable | Default | Description |
|---|---|---|
HOOKLISTENER_API_URL | https://app.hooklistener.com | Base URL for API requests |
HOOKLISTENER_WS_URL | wss://api.hooklistener.com | Base URL for WebSocket connections (listen mode) |
HOOKLISTENER_DEVICE_PORTAL_URL | https://app.hooklistener.com/device-codes | Device code authorization URL |
Example:
# Point to a local development server
HOOKLISTENER_API_URL=http://localhost:4000 hooklistener endpoint list
Log files
Logs are stored in ~/.config/hooklistener/logs/ as structured JSON files.
File naming: hooklistener-YYYYMMDD-HHMMSS.log
Log level
Set the log level with --log-level:
hooklistener --log-level debug listen my-endpoint
Available levels: trace, debug, info (default), warn, error
Custom log directory
hooklistener --log-dir /tmp/hooklistener-logs listen my-endpoint
Log to stdout
hooklistener --log-stdout listen my-endpoint