Trigv CLI
Use the official Trigv CLI to send push notifications from your terminal, shell scripts, cron jobs, CI pipelines, and deploy hooks.
Install
Code
npm install -g @trigv/cli Or run without installing:
Code
npx @trigv/cli send --channel general --title "Hello" Send a notification
Code
export TRIGV_API_KEY="trgv_your_api_key"
trigv send \
--channel general \
--title "Deploy finished" \
--description "Production is live" \
--level success Command flags
| Flag | Required | Description |
|---|---|---|
--channel | Yes | Channel slug, such as general, deploys, or payments. |
--title | Yes | Push notification title. |
--description | No | Body text shown in the notification. |
--image-url | No | HTTPS image URL for screenshots, charts, camera snapshots, or previews. |
--url | No | Destination URL opened from the notification. |
--level | No | info, success, warning, or error. Defaults to info. |
--delivery-urgency | No | standard or time_sensitive. Defaults to standard. |
--event-type | No | Free-form event label such as deploy.completed or cron.failed. |
--idempotency-key | No | Deduplication key for safe retries. |
--json | No | Print machine-readable JSON output. |
Safe retries with idempotency
Code
trigv send \
--channel deploys \
--title "Production deploy complete" \
--level success \
--idempotency-key deploy-prod-42 Retries with the same key return the existing event instead of billing and sending another alert.
Authentication and config
The CLI looks for credentials in this order:
TRIGV_API_KEYenvironment variable- macOS Keychain, when available
~/.config/trigv/credentials
Store a key interactively:
Code
trigv config set-key Verify the key:
Code
trigv connection Use --base-url only for local development or custom API environments.
JSON output
Use --json when another script needs to read the result.
Code
trigv send --channel general --title "Hello" --json Successful responses include ok, event, and duplicate. Error responses include ok: false, error, code, and status_code.
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | Validation or usage error. |
2 | Missing API key or config. |
3 | API or network error. |
Good places to use it
- CI/CD pipelines and deploy scripts
- Local shell scripts and scheduled jobs
- Any workflow where adding a single terminal command is easier than writing code