Configuration
Configure the Hookie CLI with hookie.yml, global settings, and environment variables
The Hookie CLI uses global config under ~/.hookie/, optional repository hookie.yml files, and a few environment variables.
Global Configuration
Authentication tokens are stored in your system keychain when available (macOS Keychain or equivalent), with a config-file fallback. Machine ID and optional relay overrides live in the config file.
Default path: ~/.hookie/config.json. Override the directory with HOOKIE_CONFIG_DIR when home directory resolution differs across terminals or tools:
export HOOKIE_CONFIG_DIR="$HOME/.hookie"You normally manage this with hookie login and hookie logout rather than editing files by hand.
Environment Variables
| Variable | Purpose |
|---|---|
HOOKIE_RELAY_URL | gRPC relay address (host:port). Official builds default to the hosted relay. |
HOOKIE_CONFIG_DIR | Directory for user config (token, machine ID). |
HOOKIE_UI_PORT | Port for the local event GUI (default 4840). |
HOOKIE_INSECURE_TLS | Non-empty value forces plaintext gRPC (local CLI development against a non-TLS relay). |
Repository Configuration
Create a hookie.yml in your repository for app_id, forward URLs, and per-source forwarding so teammates can run hookie listen without flags.
File Format
app_id: billing-api-k7m2xp
forward: http://localhost:3001/webhooks
sources:
stripe: http://localhost:3002/webhooks/stripe
checkout: http://localhost:3003/webhooks/checkoutFields
app_id(optional) — Application public id to subscribe to (all sources).source_id(optional) — Source slug for a single source. Requiresapp_id.forward(optional) — Default forward URL for all events. Must include scheme and host.sources(optional) — Map of source slug → forward URL for per-source forwarding. Each URL must include scheme and host.
Configuration Discovery
The CLI searches for hookie.yml from the current working directory upward until it finds one or reaches the filesystem root. The closest file wins.
Example from /project/app/src/components:
/project/app/src/components/hookie.yml/project/app/src/hookie.yml/project/app/hookie.yml/project/hookie.yml/hookie.yml
Priority Order
For hookie listen:
- CLI flags (
--app-id,--source-id,--forward-to, and so on) — highest priority - Repository config (
hookie.yml) - Anonymous mode — if no app or source is set by flags or config, even when logged in
# Flag overrides config
hookie listen --app-id checkout-api-m2n8xp
# Config used when no targeting flags
hookie listen
# No app/source in flags or hookie.yml → anonymous ephemeral channel
hookie listenInitializing Configuration
hookie initThis command:
- Checks whether
hookie.ymlalready exists in the current directory (prompts to overwrite) - Requires authentication
- Fetches your applications
- Shows an interactive selector to choose an application
- Prompts for an optional forward URL
- Writes
hookie.ymlin the current directory
hookie init is the interactive flow. hookie listen does not prompt you to pick an app; without targeting info it goes anonymous.
Example Output
? Select an application
▸ My Webhook App (billing-api-k7m2xp)
API Gateway (checkout-api-m2n8xp)
? Forward URL (optional)
http://localhost:3001/webhooks
✓ Created hookie.yml
Configuration:
App ID: billing-api-k7m2xp
Forward URL: http://localhost:3001/webhooks
You can now run hookie listen without specifying flags.
To add per-source forwarding, edit hookie.yml and add entries under 'sources'.Per-Source Forwarding
Different sources can forward to different endpoints.
Basic Example
app_id: billing-api-k7m2xp
forward: http://localhost:3001/webhooks # Default for all sources
sources:
stripe: http://localhost:3002/payments
checkout: http://localhost:3003/webhooksHow It Works
When an event arrives:
- If the event's source slug is in the
sourcesmap, use that URL - Otherwise use the default
forwardURL (if set) - If neither applies, the event is not forwarded
With the config above:
stripe→http://localhost:3002/paymentscheckout→http://localhost:3003/webhooks- any other source →
http://localhost:3001/webhooks
Advanced Example
app_id: billing-api-k7m2xp
# No default forward URL
sources:
stripe: http://localhost:3002/payments
subscriptions: http://localhost:3003/subscriptionsTeam Collaboration
- Commit
hookie.ymlso clones can runhookie listenwith shared defaults - Keep environment-specific forward URLs appropriate for local ports
- Treat the file as living documentation of which app or sources the repo uses
Example Workflow
# Developer A
cd my-project
hookie init
git add hookie.yml
git commit -m "Add hookie.yml configuration"
git push
# Developer B
git clone my-project
cd my-project
hookie login
hookie listenValidation
The CLI validates repository config:
source_idrequiresapp_id— source slugs are scoped to an application- URL format — Forward URLs need a scheme (
http://orhttps://) and host - YAML syntax — Invalid YAML surfaces a parse error
Error Examples
# source_id without app_id
Error: invalid configuration in hookie.yml: source_id requires app_id
# Missing scheme in URL
Error: invalid forward URL: URL must include a scheme (e.g., http:// or https://)
# YAML syntax error
Error: failed to parse hookie.yml: yaml: line 2: found character that cannot start any tokenRelated Commands
- Listen — Uses repository configuration when listening
- Status — Check relay connectivity and login state
- Applications — Find application public ids
- Sources — Find source slugs for per-source forwarding