Blog
AI

Give your AI agents access to your notification infrastructure with the Courier CLI

Mike Miller

March 12, 2026

New Courier CLI for AI Agents

Table of contents

What's new in the Courier CLI

How AI agents send and manage messages

Setting up the CLI for your AI agent

Get started with the Courier CLI

Give your AI agents access to your notification infrastructure with the Courier CLI

We rebuilt the Courier CLI (command-line interface) from scratch, designed for both developers and AI agents. The previous version covered a subset of the API. The new one covers the full Courier API with a consistent courier [resource] <command> [flags] pattern across messages, profiles, lists, tenants, automations, preferences, bulk jobs, and more. Whether you're working in Cursor, Claude Code, or a CI pipeline, every Courier operation is now a terminal command away.

What's new in the Courier CLI

It's a standalone binary for macOS, Linux, and Windows with no runtime dependencies. Install via npm (npm install -g @trycourier/cli), which downloads a platform-specific binary through a postinstall step, or grab it from GitHub Releases.

Every command supports --format json for machine-readable output and --transform for filtering responses with GJSON syntax. Run --help on any command to see its flags and usage, which makes the CLI self-documenting for agents that discover tools at runtime. See the CLI docs for the full reference.

How AI agents send and manage messages

The real power isn't any single command. It's that agents can chain commands together, using structured output from one step to decide what to run next.

Send messages from the terminal

You tell your agent to send a message, and it translates that into a command:

Copied!

courier send message \
--message.to.email "alex@example.com" \
--message.content.title "New login detected" \
--message.content.body "We noticed a new login to your account from San Francisco. If this wasn't you, reset your password immediately."

That's inline content, but agents can also reference templates, add multi-channel routing with fallbacks, include dynamic data, or send to entire lists. The same command works across email, SMS, push notifications, in-app notifications, Slack, Microsoft Teams, WhatsApp, Discord, and webhooks. One command, any channel.

Debug delivery issues

This is where agents and the CLI really click. Your teammate says a user didn't get a message. Instead of opening the dashboard, you ask your agent to look into it:

  1. The agent searches recent messages for the user
  2. Finds the message ID and retrieves its status: UNROUTABLE
  3. Checks the user's profile. No email on file.
  4. Tells you the root cause and offers to fix the profile

Each step is a CLI command with --format json output that the agent parses to determine the next move. The entire investigation happens in your editor.

Manage users, lists, and tenants

Agents can create user profiles, subscribe users to lists, set up tenants with custom branding, and update notification preferences. All the operational work that normally means switching to the dashboard or writing one-off scripts.

See the CLI docs for the full command reference across all these resources.

Setting up the CLI for your AI agent

Install the CLI globally and set your API key:

Copied!

npm install -g @trycourier/cli
export COURIER_API_KEY="your-api-key"

That's the entire setup. No config files, no auth flows, no SDK initialization. If your shell has the API key, your agent has access.

In Cursor

Cursor's agent mode can run shell commands directly, so the CLI works out of the box once installed. To get more out of it, add a project rule that tells the agent the CLI is available and points it at the CLI docs for command reference.

In Claude Code

Claude Code has direct shell access, so the same applies. Set COURIER_API_KEY in your shell profile (.zshrc, .bashrc) so it persists across sessions, and add a note to your CLAUDE.md project instructions letting the agent know the CLI is available.

MCP as an alternative

If you'd rather give your agent structured tool access instead of shell commands, we also have an MCP server that exposes the same Courier operations through the Model Context Protocol. Both Cursor and Claude Code support MCP. It's a different integration path to the same capabilities.

Get started with the Courier CLI

Beyond agents, the CLI is also the fastest way to interact with Courier from your terminal for scripting, CI/CD smoke tests, and debugging on the fly. The CLI docs have recipes and examples for all of it.

Install it, set your API key, and start using it.

Similar resources

email infrastructure providers
AIGuideEngineering

Best Email API Providers for Developers in 2026: SendGrid vs Postmark vs Mailgun vs SES vs Resend

Your email provider sticks with you longer than most technical decisions. Courier handles notification infrastructure for thousands of teams, so we went deep on the six email providers that show up most: SendGrid, Postmark, Mailgun, Amazon SES, Resend, and SMTP. This guide covers real API primitives, actual code from each provider's docs, Courier integration examples with provider overrides, and an honest read on where each developer experience holds up and where it breaks down. We also asked Claude to review every API and tell us which one it would wire up first. The answer surprised us.

By Kyle Seyler

February 23, 2026

AI Board Member
AI

I Built an AI Board Member in Cursor. Here's How.

Every month I send a board update—and every month I wish someone would tell me what’s wrong before it goes out. Investors are busy, feedback comes late, and most people soften the punch. So I built an AI board member using Cursor Rules: three markdown files, a basic project layout, and no plugins. Drop in your board deck, get an immediate review, and walk into the meeting with fewer surprises.

By Thomas Schiavone

February 20, 2026

Courier MCP is open source
AIEngineering

The Courier MCP Server Is Open Source. Here's How It Actually Works.

Courier's MCP server is open source at github.com/trycourier/courier-mcp. It connects AI coding tools like Cursor and Claude Code to your Courier account so they can send messages, manage users, and install SDKs without hallucinating API details. This post walks through the actual codebase: how 16 tool classes are registered (and how a config allowlist gates most of them), why we pull installation guides from GitHub at runtime instead of bundling them, how the DocsTools class generates live JWTs alongside setup instructions, and what the SdkContextTools class does in the repo to prevent v7/v8 SDK conflicts (even though it isn't wired into the server yet).

By Mike Miller

February 06, 2026

Multichannel Notifications Platform for SaaS

Products

Platform

Integrations

Customers

Blog

API Status

Subprocessors


© 2026 Courier. All rights reserved.