@hookman/cli
v0.2.2
Published
CLI for Hookman — webhook routing for branch deployments
Readme
@hookman/cli
CLI for Hookman — webhook routing for branch deployments. Point your webhook provider at one stable Hookman endpoint and route incoming webhooks to the right branch/preview deployment from the command line or CI.
Install
npm i -g @hookman/cli # then: hookman <command>
# or one-off:
npx @hookman/cli <command>The installed command is hookman.
Login
hookman loginOpens your browser, you authorize, and the key is saved to ~/.hookman/config.json.
No copy-paste. In CI, skip login and pass a key instead (see below).
Commands
hookman login Authenticate (browser-based)
hookman whoami Show the authenticated user
hookman list List a project's deployments
hookman register --branch --url Register or update a deployment
hookman switch --branch <label> Make a deployment the active one
hookman remove --branch <label> Remove a deployment
hookman version Print the CLI versionExamples:
hookman register --branch pr-42 --url https://pr-42.myapp.com/api/webhooks
hookman switch --branch pr-42
hookman list --jsonOrg & project
Most commands need an org and project. Resolved in this order:
| What | Flag | Env var |
| ------- | ----------- | ------------------ |
| API key | --key | HOOKMAN_API_KEY |
| Org | --org | HOOKMAN_ORG |
| Project | --project | HOOKMAN_PROJECT |
The API key also falls back to ~/.hookman/config.json (written by hookman login).
register and list accept --json for scripting.
CI usage
export HOOKMAN_API_KEY=hm_live_xxxxxxxx
export HOOKMAN_ORG=acme
export HOOKMAN_PROJECT=payments
npx @hookman/cli register --branch "$BRANCH" --url "$PREVIEW_URL/api/webhooks"Create a key in the dashboard under Settings → API keys.
License
MIT
