Prerequisite: Create an API Key
You need a Courier API key to authenticate CLI commands. Create one in your Courier Settings, then set it in your shell:Installation
- npm
- Homebrew
- Direct download
Command Structure
The CLI uses a resource-based pattern:--help on any command to see available flags:
Common Commands
Send a message
List recent messages
Inspect a message
View delivery history
Get a user profile
List notification templates
Output Formats
Every command supports structured output via the--format flag:
| Format | Description |
|---|---|
auto | Default; human-readable for terminals, JSON for pipes |
json | JSON output |
yaml | YAML output |
pretty | Colorized, indented JSON |
raw | Raw response body |
jsonl | Newline-delimited JSON (for streaming) |
--transform:
Global Flags
| Flag | Description |
|---|---|
--api-key | Override COURIER_API_KEY for this command |
--base-url | Use a custom API URL |
--format | Output format (auto, json, yaml, pretty, raw, jsonl) |
--transform | Filter output with GJSON syntax |
--debug | Show HTTP request/response details |
--version, -v | Print CLI version |
--help | Show command usage |
CI/CD Integration
Use the CLI in automated pipelines to validate sends or run smoke tests during deployment.AI Agent Usage
The CLI works as a zero-config tool for AI agents in Cursor, Claude Code, Codex, and similar environments. Install once, setCOURIER_API_KEY, and agents can run Courier operations directly via shell commands. Every command supports --format json for machine-readable output.
MCP Server
Structured AI tool access for sending messages, managing users, and more.
API Reference
Full REST API documentation for all 81 endpoints.
Source code: trycourier/courier-cli