Configuration
Configure Hookie CLI using repository-specific hookie.yml files and global settings
The Hookie CLI supports two types of configuration: global configuration stored in your home directory, and repository-specific configuration using hookie.yml files.
Global Configuration
The CLI stores authentication tokens securely in your system's keychain (macOS Keychain or equivalent). Your user ID and optional relay URL are stored locally. This configuration is automatically created when you run hookie login and cleared when you run hookie logout.
By default, the config file is stored at ~/.hookie/config.json. You can override this with the HOOKIE_CONFIG_DIR environment variable if the home directory differs between invocations (e.g., when auth works in one terminal but not another). Example: export HOOKIE_CONFIG_DIR=/Users/yourname/.hookie.
You typically don't need to manage this configuration manually. Use hookie login and hookie logout to manage your authentication.
Repository Configuration
You can create a hookie.yml file in your repository to configure app_id, forward URLs, and per-topic forwarding. This allows team members to run hookie listen without specifying flags.
File Format
Create hookie.yml in your repository root:
app_id: app_xxx
forward: http://localhost:3001/webhooks
topics:
topic_abc: http://localhost:3002/webhooks/topic-abc
topic_def: http://localhost:3003/webhooks/topic-defConfiguration Fields
app_id(optional) - Application ID to subscribe to. Mutually exclusive withtopic_id.topic_id(optional) - Topic ID to subscribe to. Mutually exclusive withapp_id.forward(optional) - Default forward URL for all events. Must include scheme and host (e.g.,http://localhost:3001/webhooks).topics(optional) - Map of topic_id -> forward URL for per-topic forwarding. Each URL must include scheme and host.
Configuration Discovery
The CLI searches for hookie.yml starting from the current working directory and walks up the directory tree until found or reaching the filesystem root. The closest config file takes precedence.
Example:
If you run hookie listen from /project/app/src/components, the CLI will search:
/project/app/src/components/hookie.yml/project/app/src/hookie.yml/project/app/hookie.yml/project/hookie.yml/hookie.yml
It uses the first hookie.yml file found.
Priority Order
When running hookie listen, configuration is resolved in this order:
- CLI flags (
--app-id,--forward, etc.) - Highest priority - Repository config (
hookie.yml) - Medium priority - Interactive selector - Lowest priority (if no flags or config)
Example:
# CLI flag overrides config
hookie listen --app-id app_different # Uses app_different, ignores hookie.yml
# Config used when no flags
hookie listen # Uses app_id from hookie.yml
# Interactive selector when no config or flags
hookie listen # Prompts for selection if no hookie.yml foundInitializing Configuration
Use hookie init to interactively create a hookie.yml file:
hookie initThis command will:
- Check if
hookie.ymlalready exists (prompts to overwrite if found) - Require authentication (shows error if not logged in)
- Fetch your applications
- Show an interactive selector to choose an application
- Prompt for an optional forward URL
- Create
hookie.ymlin the current directory
Example Output
? Select an application
▸ My Webhook App (app_123)
API Gateway (app_456)
? Forward URL (optional)
http://localhost:3001/webhooks
✓ Created hookie.yml
Configuration:
App ID: app_123
Forward URL: http://localhost:3001/webhooks
You can now run hookie listen without specifying flags.
To add per-topic forwarding, edit hookie.yml and add entries under 'topics'.Per-Topic Forwarding
You can configure different forward URLs for different topics. This is useful when different topics need to be forwarded to different endpoints.
Basic Example
app_id: app_xxx
forward: http://localhost:3001/webhooks # Default for all topics
topics:
payments: http://localhost:3002/payments # Specific URL for payments topic
webhooks: http://localhost:3003/webhooks # Specific URL for webhooks topicHow It Works
When an event arrives:
- If the event's
topic_idexists in thetopicsmap, use that URL - Otherwise, use the default
forwardURL (if provided) - If neither exists, the event is not forwarded
Example:
With the config above:
- Event for
paymentstopic → forwarded tohttp://localhost:3002/payments - Event for
webhookstopic → forwarded tohttp://localhost:3003/webhooks - Event for
othertopic → forwarded tohttp://localhost:3001/webhooks(default)
Advanced Example
app_id: app_xxx
# No default forward URL
topics:
payments: http://localhost:3002/payments
subscriptions: http://localhost:3003/subscriptions
# Events for other topics are not forwardedTeam Collaboration
Repository configuration files are perfect for team collaboration:
- Commit
hookie.ymlto version control - Team members can clone and runhookie listenimmediately - Environment-specific configs - Use different forward URLs per environment
- Documentation - The config file serves as documentation for which app/topics the repo uses
Example Workflow
# Developer A: Initialize config
cd my-project
hookie init
# Selects app_123, sets forward to http://localhost:3001/webhooks
git add hookie.yml
git commit -m "Add hookie.yml configuration"
git push
# Developer B: Clone and use
git clone my-project
cd my-project
hookie listen # Automatically uses app_123 and forward URL from hookie.ymlValidation
The CLI validates configuration files:
- Mutual exclusivity -
app_idandtopic_idcannot both be set - URL format - Forward URLs must include scheme (
http://orhttps://) and host - YAML syntax - Invalid YAML will show clear error messages
Error Examples
# Invalid: Both app_id and topic_id specified
Error: invalid configuration in hookie.yml: cannot specify both app_id and topic_id
# Invalid: Missing scheme in URL
Error: invalid forward URL: URL must include a scheme (e.g., http:// or https://)
# Invalid: YAML syntax error
Error: failed to parse hookie.yml: yaml: line 2: found character that cannot start any tokenBest Practices
- Don't commit sensitive URLs - Use environment variables or local-only configs for production URLs
- Use relative paths - Consider using environment-specific forward URLs
- Document per-topic configs - Add comments in YAML to explain why certain topics forward to specific URLs
- Version control - Commit
hookie.ymlso team members have consistent configuration
Related Commands
- Listen - Use repository configuration when listening to events
- Applications - Find application IDs for configuration
- Topics - Find topic IDs for per-topic forwarding