TheDocumentation 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.
pull command downloads your newsletter content from Buttondown and saves it to a local directory.
Usage
What Gets Downloaded
Thepull command downloads:
- Emails - All your newsletter emails as Markdown files with frontmatter
- Media - All uploaded images and files
- Automations - Your automation sequences (if any)
- Newsletter settings - Basic newsletter configuration
- Snippets - Reusable content snippets
Basic Example
Options
Your Buttondown API key. Required if you haven’t run
buttondown login.If you’ve already logged in, the stored API key will be used automatically.The Buttondown API base URL.Only needed if you’re using a self-hosted Buttondown instance or a custom API endpoint.
The directory where content will be saved.The CLI will create this directory if it doesn’t exist, along with subdirectories for emails, media, etc.
Directory Structure
After runningpull, your directory will look like:
Email Files
Each email is saved as a Markdown file with YAML frontmatter:Media Files
Images and other media are downloaded to themedia/ directory. Image URLs in email bodies are automatically converted to relative paths.
Sync State
The.buttondown-sync.json file tracks which images have been synced. This file is used by the push command to avoid re-uploading unchanged media.
Image URL Conversion
When pulling emails, absolute Buttondown image URLs are converted to relative paths:Authentication
Thepull command requires authentication. You can provide your API key in two ways:
Using stored credentials (recommended)
Providing API key directly
Custom Directory
Pull content to a specific directory:Operation Results
The pull command shows statistics for each resource type:- updated - Existing local files that were modified
- created - New files downloaded
- deleted - Local files removed (if they no longer exist in Buttondown)
- failed - Operations that encountered errors
Error Handling
Missing API key
Invalid API key
Network errors
Examples
First-time pull
Sync updates
Pull to custom directory with custom API URL
Next Steps
After pulling your content:- Edit email files locally using your preferred text editor
- Run buttondown create to add new draft emails
- Run buttondown push to upload your changes back to Buttondown
Best Practices
- Pull before editing - Always pull the latest content before making local changes to avoid conflicts
- Regular syncs - Pull regularly to stay in sync with changes made via the Buttondown web interface
- Version control - Consider using Git to track changes to your local newsletter content
- Backup directory - Use a custom directory for backups:
buttondown pull --directory=./backup-$(date +%Y%m%d)