Skip to main content
@senderkit/cli is a single-binary senderkit command that sends notifications, lists templates, and inspects message history from your terminal. It wraps the same REST surface as the TypeScript SDK and bundles the MCP server.

Install

npm install -g @senderkit/cli
pnpm add -g @senderkit/cli
bun add -g @senderkit/cli
npx @senderkit/cli --help
Requires Node.js 18 or newer. After installing, verify it’s on your path:
senderkit --version

Authenticate

Every command (except --help and --version) needs an API key. The CLI looks in three places, in this order:
  1. The --api-key <key> flag on the command.
  2. The SENDERKIT_API_KEY environment variable.
  3. ~/.senderkit/config.json — populated by senderkit login or senderkit config set apiKey ….
For interactive setup, login is the easiest path. It prompts, verifies the key against the API by listing your templates, and saves it with 0600 permissions:
senderkit login
# SenderKit API key: sk_test_…
# ✓ Saved API key to /Users/you/.senderkit/config.json
For non-interactive setup (CI provisioning, dotfiles), set the value directly:
senderkit config set apiKey sk_test_…
senderkit config list  # API key shown masked, e.g. sk_test_xyz…ABCD
Or pass it inline for one-off scripts:
SENDERKIT_API_KEY=sk_test_… senderkit templates list
senderkit templates list --api-key sk_test_…
Mode (live vs test) is encoded in the key prefix — sk_live_… sends real mail; sk_test_… synthesizes the full lifecycle without leaving the building. See Environments.

Global flags

These work on every command and resolve before the subcommand runs.
--api-key <key>
API key. Overrides SENDERKIT_API_KEY and ~/.senderkit/config.json.
--base-url <url>
Override the API base URL. Also resolvable via SENDERKIT_BASE_URL or senderkit config set baseUrl …. Useful for staging environments and self-hosted deployments.
--json
Print the raw JSON response instead of human-readable text. The shape matches the REST response for the underlying endpoint, so it pipes cleanly into jq or a downstream script.
--version
Print the CLI version and exit.
--help
Print contextual help. Works at any level — senderkit --help, senderkit messages list --help.

Managing config

~/.senderkit/config.json stores apiKey and baseUrl. Three subcommands manage it:
senderkit config set apiKey sk_test_…
senderkit config set baseUrl https://api.staging.senderkit.com
senderkit config get apiKey   # printed masked
senderkit config list         # prints all values, apiKey masked
The file is written with 0600 permissions so other users on the machine can’t read your key.

Output and exit codes

The CLI is built for both humans and pipelines:
  • Human mode (default) prints aligned tables for list commands and key: value blocks for object responses, with a green on successful sends.
  • JSON mode (--json) prints the raw SDK response — same shape as the REST API.
  • Exit codes: 0 on success, 1 on any error (auth failure, validation, rate limit, network, anything else). Errors print to stderr; results print to stdout, so you can pipe results without losing error visibility.
senderkit templates list --json | jq '.[].slug'
senderkit messages list --status failed --json > failed.json

Utility commands

senderkit context

Report the connected workspace and the active send mode:
senderkit context
# workspace: Acme Inc
# slug:      acme
# mode:      test
Fetches GET /v1/context so the result is authoritative and workspace-aware. Add --json to get { workspace: { id, slug, name }, mode } as structured output.

MCP server

The CLI also bundles the SenderKit MCP server, exposed as senderkit mcp and senderkit mcp install. That surface is documented separately — see MCP Server.

send

Fire a template or raw send from the terminal.

templates

List and inspect templates by slug.

messages

Query message history and filter by status, channel, or template.

MCP Server

Hand the same operations to Claude, Cursor, and other AI clients.