Skip to main content

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"
}
FieldDescription
access_tokenSession token from the device code flow
token_expires_atToken expiration (60 days from login)
selected_organization_idDefault 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:

VariableDefaultDescription
HOOKLISTENER_API_URLhttps://app.hooklistener.comBase URL for API requests
HOOKLISTENER_WS_URLwss://api.hooklistener.comBase URL for WebSocket connections (listen mode)
HOOKLISTENER_DEVICE_PORTAL_URLhttps://app.hooklistener.com/device-codesDevice 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