Beehiiv CLI is a cross-platform command-line tool designed to interact with the Beehiiv V2 API, enabling users to manage their publications, subscribers, posts, and webhooks directly from the terminal. It provides a seamless interface for developers and content creators to automate tasks and integrate AI-driven workflows through Codex.
Key Features:
Secure Credential Management: Stores credentials securely using macOS Keychain or Windows Credential Manager.
User-Friendly Help System: Offers clear help output on every command, enhancing usability.
Guided Reports: Generates non-technical reports with options for CSV exports and ASCII charts, making data analysis accessible.
Audience & Benefits:
Ideal for content creators, newsletter managers, developers requiring script automation, and teams leveraging Codex for AI-driven workflows. Beehiiv CLI streamlines resource management on Beehiiv, integrates seamlessly with Codex for conversational AI tasks, and supports shell scripting or CI/CD pipelines, enhancing efficiency and productivity.
This tool is available on Windows via winget, ensuring easy installation and setup.
README
Beehiiv CLI
A simple command-line app for interacting with the Beehiiv V2 API. Use it (with AI! 🤖) to extract data and work with your publications, subscribers, posts, and webhooks from your terminal.
Project Status
Ready for public use on macOS, Windows, and Linux. Install via Homebrew (macOS/Linux) or winget (Windows), or download a binary from the GitHub releases page. The Codex plugin ships both in-repo and as a release asset for team installs.
Quick Start
Download the latest release from the GitHub releases page or install via a package manager:
brew tap deldrid1/homebrew-tap
brew install beehiiv
Sign in — your browser opens automatically:
beehiiv login
Try beehiiv publications list or beehiiv --help.
If you're setting up release publishing with an agent, start with docs/release-auth-setup.md. It includes the current token requirements, including the classic PAT requirement for winget publication.
Use with Codex
The repo includes a Codex-installable plugin at plugins/beehiiv-codex for teammates who would rather ask for outcomes in plain language than memorize CLI commands.
If your team already works in this repo:
Pull the latest changes.
Restart Codex.
Open Plugins in Codex, then install Beehiiv from the Beehiiv Local Plugins marketplace.
If your team just wants the plugin:
Download beehiiv-codex-plugin_VERSION.zip from the matching GitHub release.
Extract beehiiv-codex into ~/.codex/plugins/ on macOS/Linux or %USERPROFILE%\\.codex\\plugins\\ on Windows.
Add a personal marketplace file at ~/.agents/plugins/marketplace.json that points at ./.codex/plugins/beehiiv-codex.
Restart Codex and install Beehiiv from that personal marketplace.
The repo includes a Claude Code plugin at plugins/beehiiv-claude with a beehiiv-reporting-assistant skill that translates plain-language requests ("summarize the last 14 days", "export subscribers to CSV") into the right beehiiv commands.
One-command sign-in via OAuth — no API key setup required
Secure credential storage in the macOS Keychain or Windows Credential Manager
Handy shortcuts for common subscriber, publication, post, and webhook tasks
Guided reports workflows for non-technical stats, charts, and CSV exports
JSON output for scripts, with table output when you want something easier to read
Automatic pagination with --all
Built-in retry and rate-limit handling
CLI vs Beehiiv MCP Server
Beehiiv ships an official MCP server for AI-assisted workflows. The table below compares it with this CLI so you can choose the right tool — or use both.
Capability coverage
Resource
CLI
MCP
Notes
Publications (list, get, stats)
✅
✅
Posts (list, get, stats)
✅
✅
Post content (free/paid audience views)
✅
✅
MCP adds audience-scoped rendering
Post ISP deliverability breakdown
❌
✅
MCP-only; per-domain metrics for 50+ subscriber domains
Post click tracking (per-link)
❌
✅
MCP-only; includes per-subscriber click lists
Subscriptions (list, get, filter)
✅
✅
Authors
✅
✅
Tiers
✅
✅
Custom fields
✅
✅
Content tags
❌
✅
MCP-only
Polls + poll responses
✅
✅
Surveys + survey responses
❌
✅
MCP-only
Automations + journeys
✅
✅
MCP adds per-step subscriber counts
Automation email content
❌
✅
MCP-only; rendered email from a step
Segments (list, get, recalculate)
✅
❌
CLI-only
Segment members / results
✅
❌
CLI-only
Referral program
✅
❌
CLI-only
Advertisement opportunities
✅
❌
CLI-only
Webhooks (CRUD + test)
✅
❌
CLI-only
Email blasts
✅
❌
CLI-only
Engagements
✅
❌
CLI-only
Newsletter lists
✅
❌
CLI-only (Beta)
Workspaces
✅
✅
Post templates
✅
❌
CLI-only
Condition sets
✅
❌
CLI-only
Beehiiv documentation search
❌
✅
MCP-only; search and read support articles
Write operations
Operation
CLI
MCP
Create / update / delete posts
✅
❌
Create / update / delete subscriptions
✅
❌
Bulk import subscriptions
✅
❌
Bulk update subscriptions
✅
❌
Create / update / delete custom fields
✅
❌
Create / update / delete webhooks
✅
❌
Create / update tiers
✅
❌
Create automation journeys
✅
❌
Delete segments
✅
❌
Add subscription tags
✅
❌
The MCP is read-only (v1) — Beehiiv has announced write support for a future v2.
Cross-cutting features
Feature
CLI
MCP
Full pagination (--all aggregation)
✅
Capped at 100/page
CSV export
✅
❌
ASCII charts in terminal
✅
❌
Publication summary reports
✅
❌
Table, JSON, and raw output
✅
JSON only
Rate-limit handling + retry
✅
Managed server-side
OAuth sign-in (no API key)
✅
✅ (managed auth)
API key auth
✅
❌
Works on free Beehiiv plan
✅
❌ (paid plans only)
Shell scripting / CI pipelines
✅
❌
AI agent integration (MCP)
❌
✅
Verbose request debugging
✅
❌
When to use which
CLI — scripting, bulk operations, CI/CD, CSV exports, anything that writes data, free-tier accounts, or when you need the full API surface (71 operations across 28 resource groups).
MCP — conversational AI workflows, asking questions about your newsletter in natural language, deliverability analysis (ISP breakdown), and survey data.
Both — the CLI and MCP complement each other. Use the MCP for exploration and analysis, then use the CLI to act on what you find.
Requirements
For normal use: a Beehiiv account (OAuth sign-in is built in — no API key needed)
To build from source: Go 1.26 or newer
For publication-scoped commands: a Beehiiv publication ID
For CI/CD or programmatic use you can also pass an API key directly. See Beehiiv's Create an API Key guide.
Build from Source
From the Go module root:
make build
Cross-platform examples:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ./dist/beehiiv-darwin-arm64 ./cmd/beehiiv
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./dist/beehiiv-darwin-amd64 ./cmd/beehiiv
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./dist/beehiiv-windows-amd64.exe ./cmd/beehiiv
Install from a Release
macOS
Download the correct archive for your machine from the latest release:
beehiiv_VERSION_darwin_arm64.tar.gz on Apple Silicon or beehiiv_VERSION_darwin_x86_64.tar.gz on Intel.
Secrets are stored in the macOS Keychain by default.
Windows
Install via winget (requires Windows 10 1809+ or Windows 11):
winget install Deldrid1.BeehiivCLI
Then sign in:
beehiiv login
If winget is not available, download the correct archive from the latest release (e.g. beehiiv_VERSION_windows_x86_64.zip), extract it into a folder such as C:\Tools\beehiiv\, and add that folder to your PATH.
The CLI stores its config at %AppData%\beehiiv-cli\config.json. Secrets are stored in the Windows Credential Manager by default.
Linux
Download the correct archive from the latest release, for example beehiiv_VERSION_linux_x86_64.tar.gz.
Extract it:
tar -xzf beehiiv_VERSION_linux_x86_64.tar.gz
Move beehiiv somewhere on your PATH, for example:
sudo mv ./beehiiv /usr/local/bin/beehiiv
Package Managers
Homebrew:
brew tap deldrid1/homebrew-tap
brew install beehiiv
Sign in with a single command — no API key required:
beehiiv login
Your browser opens the Beehiiv authorization page. After you approve, credentials are saved securely in the OS keyring. The OAuth client is pre-configured; nothing extra to set up.
If you prefer not to open a browser automatically:
beehiiv login --no-browser
API key authentication (CI/CD)
For non-interactive environments, pass your API key directly:
The CLI defaults to an internal limit of 150 requests per minute and also honors Beehiiv rate-limit headers. When Beehiiv responds with 429, the client waits for the reset window and retries automatically.
Development
Useful local commands:
make build
make docs
make test
make fmt
make fmt-check
make lint
Generated CLI reference docs land in docs/reference/cli/, generated manpages land in share/man/man1/, and generated shell completions land in share/completions/.