| title | CLI |
|---|---|
| description | Use the Inbox Zero API CLI from npm or npx. |
Use the Inbox Zero API CLI when you want a thin wrapper around the public API for scripts, bots, or local automation.
The package is published to npm as @inbox-zero/api, and the executable name is inbox-zero-api.
Requires Node.js 18+.
npx @inbox-zero/api --helpYou can also install it globally:
npm install -g @inbox-zero/apiThe CLI reads configuration in this order:
- Command flags
- Environment variables
~/.inbox-zero-api/config.json
Supported environment variables:
INBOX_ZERO_API_KEYINBOX_ZERO_BASE_URLfor self-hosted or custom API deployments
Example:
inbox-zero-api rules listbase-url is optional. The CLI defaults to https://www.getinboxzero.com and only needs an override for self-hosted or custom deployments.
Set INBOX_ZERO_API_KEY in your shell or secret manager before running commands. Avoid passing API keys as CLI arguments because they can leak into shell history and process listings.
List rules:
inbox-zero-api rules list
inbox-zero-api rules list --jsonGet a rule:
inbox-zero-api rules get rule_123 --jsonCreate a rule from JSON:
inbox-zero-api rules create --file rule.json
cat rule.json | inbox-zero-api rules create --file -Update a rule from JSON:
cat rule.json | inbox-zero-api rules update rule_123 --file -Delete a rule:
inbox-zero-api rules delete rule_123Read stats:
inbox-zero-api stats by-period --period week --json
inbox-zero-api stats response-time --jsonUnsubscribe from a sender:
inbox-zero-api senders unsubscribe news@example.com
inbox-zero-api senders unsubscribe news@example.com --jsonFetch the live OpenAPI document:
inbox-zero-api openapi --jsonFor bots, prefer --json so the output is stable and machine-readable.