---
title: "Command line"
description: "The unitpost CLI: one command per API operation, generated from the OpenAPI spec. Install it, sign in with OAuth, and send from your terminal, scripts, CI, and agents — with JSON output and stable exit codes."
url: https://www.unitpost.com/cli
section: "Marketing"
updated: 2026-11-17
---
# Command line

> The unitpost CLI: one command per API operation, generated from the OpenAPI spec. Install it, sign in with OAuth, and send from your terminal, scripts, CI, and agents — with JSON output and stable exit codes.

## Highlights

- 82 commands, one per API operation
- OAuth browser sign-in, API keys in CI
- JSON-on-stdout scripting with jq
- Destructive confirmations and idempotent writes
- Driven by people and agents alike
- Install, Homebrew (macOS, Linux): `brew install unitpostcom/tap/unitpost`
- Install, Install script (macOS, Linux): `curl -fsSL https://www.unitpost.com/install.sh | sh`
- Install, PowerShell (Windows): `irm https://www.unitpost.com/install.ps1 | iex`
- Install, npm (Node.js 20+): `npm install -g unitpost-cli`

## Links

- [CLI docs](https://www.unitpost.com/docs/cli)

## FAQ

### Do I need to install anything to use the CLI?

Just the CLI. brew install unitpostcom/tap/unitpost or curl -fsSL https://www.unitpost.com/install.sh | sh gives you a standalone binary that doesn't need Node.js (on Windows: irm https://www.unitpost.com/install.ps1 | iex). With Node.js 20+ you can use npm install -g unitpost-cli, or npx unitpost-cli@latest for a one-off. There are no runtime dependencies.

### How does login work?

unitpost login opens your browser and completes an OAuth 2.1 authorization-code flow with PKCE against the same authorization server the MCP server uses. It asks for every permission the CLI's commands use, and you can untick any on the approval page. The token lives in the macOS Keychain (a 0600 file elsewhere) and refreshes automatically; see or revoke sign-ins in Settings, Connected apps. In CI or headless shells, set UNITPOST_API_KEY instead. No login step needed.

### Can AI agents drive the CLI?

Yes, that's a primary use case. The agent skill teaches the mapping (email_send becomes unitpost email send), output is exactly one JSON document on stdout when piped or passed --json, exit codes are stable (0 ok, 1 request failed, 2 usage), and --dry-run lets an agent preview a send before anything goes out. Prefer MCP for tool calls inside a chat session and the CLI for shells, scripts, and CI.

### Can the CLI manage API keys?

It can read them: unitpost api-keys list and unitpost api-keys usage need the apikeys:read permission, which no key preset includes. Creating and revoking keys happen only in the dashboard, because those endpoints authenticate with a session, not a Bearer token; unitpost api-keys create explains exactly that and points at the dashboard.

### How do I know the commands match the API?

The tree is generated from the OpenAPI snapshot: one command per operation, flags from the request fields, enums and descriptions verbatim. A drift gate fails CI if the committed catalog lags the spec, so a new endpoint becomes a documented, shell-completable command with no CLI code change.
