Documentation Index
Fetch the complete documentation index at: https://mintlify.com/buttondown/cli/llms.txt
Use this file to discover all available pages before exploring further.
The Buttondown CLI provides five core commands for managing your newsletter content locally.
Available Commands
Authentication
- login - Configure your Buttondown API key
- logout - Clear stored credentials
Content Synchronization
- pull - Download emails and media from Buttondown
- push - Upload local emails and media to Buttondown
Content Creation
- create - Create a new draft email locally
Quick Start
First-time setup
# Log in with your API key
$ buttondown login --api-key=your-api-key
✓ Successfully configured API key!
# Pull existing content from Buttondown
$ buttondown pull
pulling
emails pulled: 0 updated, 5 created, 0 deleted, 0 failed
images pulled: 0 updated, 3 created, 0 deleted, 0 failed
All content saved to: ./buttondown
Create and publish a new email
# Create a new draft email
$ buttondown create --title="Welcome to my newsletter"
Created new draft email: ./buttondown/emails/welcome-to-my-newsletter.md
# Edit the email locally
$ vim ./buttondown/emails/welcome-to-my-newsletter.md
# Push changes to Buttondown
$ buttondown push
pushing
emails pushed: 0 updated, 1 created, 0 deleted, 0 failed
Work with a custom directory
# Pull to a specific directory
$ buttondown pull --directory=./my-newsletter
# Create an email in a specific directory
$ buttondown create --title="New Post" --directory=./my-newsletter
# Push from a specific directory
$ buttondown push --directory=./my-newsletter
Global Options
These flags are available for most commands:
Your Buttondown API key. If not provided, the CLI will use the key from buttondown login.
--base-url
string
default:"https://api.buttondown.com/v1"
Your Buttondown API base URL. Only needed for self-hosted instances.
--directory
string
default:"./buttondown"
Directory to store or read Buttondown content.
Enable verbose output for debugging.
Command Help
Run any command with --help to see usage information:
$ buttondown --help
$ buttondown login --help
$ buttondown pull --help
Getting Your API Key
To use the Buttondown CLI, you’ll need an API key:
- Log in to your Buttondown account
- Navigate to Settings → API
- Copy your API key
- Run
buttondown login --api-key=YOUR_KEY
Your API key is stored securely in your system’s configuration directory and will be used for all subsequent commands.