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.
Quick Start
This guide will walk you through authenticating with Buttondown, pulling your content, making edits, and pushing changes back.
Step 1: Authenticate
Run the login command
Start by authenticating with your Buttondown API key: The CLI will prompt you to enter your API key interactively.
Enter your API key
Paste your API key when prompted. You can find your API key in your Buttondown settings . Please enter your Buttondown API key:
> your-api-key-here
Confirm authentication
Once authenticated, you’ll see a success message: ✓ Successfully configured API key!
You can also provide your API key directly using the --api-key flag: buttondown login --api-key=your-api-key
Updating Your API Key
If you need to change your API key, use the --force flag:
Step 2: Pull Your Content
Pull content from Buttondown
Download all your emails and media files: By default, this creates a ./buttondown directory in your current location.
Review the downloaded content
The CLI will show you what was synced: newsletter pulled: 1 updated, 0 created, 0 deleted, 0 failed
emails pulled: 12 updated, 0 created, 0 deleted, 0 failed
images pulled: 8 updated, 0 created, 0 deleted, 0 failed
All content saved to: ./buttondown
Explore the directory structure
Check out your local newsletter files: You’ll see:
.buttondown.json - Sync state and configuration
emails/ - Your newsletters as Markdown files
media/ - Downloaded images and attachments
You can specify a custom directory: buttondown pull --directory=./my-newsletter
Step 3: Edit Your Content
Open an email file
Navigate to the emails directory and open any .md file in your favorite editor: cd emails
vim newsletter-issue-1.md # or use any editor
Review the email format
Your email will have YAML frontmatter followed by Markdown content: ---
subject : My Newsletter Issue #1
status : draft
email_type : public
slug : newsletter-issue-1
publish_date : 2025-04-27T09:00:00Z
created : 2025-04-25T15:32:18Z
modified : 2025-04-26T10:45:22Z
---
# My Newsletter Issue #1
Hello subscribers!
This is the content of my email...
Make your changes
Edit the content, subject, or any metadata you want to update. Save the file when you’re done.
Don’t modify the id field in the frontmatter - this is used to match your local file with the remote email on Buttondown.
Step 4: Create a New Email (Optional)
You can create new draft emails locally:
buttondown create --title= "My New Newsletter" --directory=./buttondown
This creates a new Markdown file with the proper frontmatter structure:
---
subject : My New Newsletter
status : draft
email_type : public
slug : my-new-newsletter
created : 2026-02-28T10:30:00Z
modified : 2026-02-28T10:30:00Z
---
Write your email content here...
Add images to the media folder
Copy any images you want to use into the media/ directory: cp ~/Downloads/my-image.png buttondown/media/
Reference images in your emails
After pushing (next step), images are uploaded to Buttondown. You can then reference them using either:
Relative paths: 
Absolute URLs: 
Step 6: Push Your Changes
Push to Buttondown
Upload your changes back to Buttondown:
Review the sync results
The CLI shows what was uploaded: newsletter pushed: 0 updated, 0 created, 0 deleted, 0 failed
emails pushed: 2 updated, 1 created, 0 deleted, 0 failed
images pushed: 1 updated, 0 created, 0 deleted, 0 failed
The push command is smart - it only uploads files that have changed since the last sync.
Common Workflows
Version Control with Git
Track your newsletter content with Git:
cd buttondown
git init
git add .
git commit -m "Initial newsletter backup"
Regular Backups
Set up a cron job or scheduled task to automatically pull your content:
# Add to crontab (daily at 2am)
0 2 * * * cd /path/to/buttondown && buttondown pull
Team Collaboration
One team member pulls content: buttondown pull
Commit to Git: git add . && git commit -m "Update newsletter"
Push to remote: git push origin main
Other team members pull from Git: git pull
When ready, push to Buttondown: buttondown push
Next Steps
Now that you’ve completed the quick start:
Explore Commands Learn about all available CLI commands and options
Configuration Customize your sync settings and directory structure
Email Format Deep dive into the email Markdown format and frontmatter
Working with Media Learn how to manage images and media files