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.
push command uploads your local newsletter content to Buttondown, creating or updating emails and media.
Usage
What Gets Uploaded
Thepush command uploads:
- Emails - Only emails that have been modified or created locally
- Media - New images referenced in your emails
- Automations - Your automation sequences
- 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 containing your local content.Must be a directory previously created by
buttondown pull or containing properly structured content.Smart Sync
Thepush command is intelligent about what it uploads:
Only Changed Emails
The CLI compares local emails with remote versions and only pushes emails that have changed:Automatic Image Upload
When you reference new images in your emails using relative paths, they’re automatically uploaded:Image Deduplication
The CLI tracks which images have already been uploaded using.buttondown-sync.json. Images are only uploaded once, even if referenced in multiple emails.
Image URL Conversion
When pushing emails, relative image paths are converted to absolute Buttondown URLs:.buttondown-sync.json.
Authentication
Thepush command requires authentication. You can provide your API key in two ways:
Using stored credentials (recommended)
Providing API key directly
Custom Directory
Push content from a specific directory:Operation Results
The push command shows statistics for each resource type:- updated - Existing remote resources that were modified
- created - New resources uploaded
- deleted - Remote resources removed (if they no longer exist locally)
- failed - Operations that encountered errors
Error Handling
Missing API key
Invalid directory
API errors
Examples
Create and push a new email
Update existing emails
Push with new images
Push from custom directory
Workflow Example
Typical workflow for editing and publishing:Best Practices
- Pull before push - Always run
buttondown pullbefore pushing to avoid overwriting recent changes - Review changes - Check which files have changed before pushing (use
git diffif using version control) - Test locally - Preview your Markdown rendering before pushing
- Incremental changes - Push frequently with small changes rather than large batches
- Sync state - Don’t manually edit
.buttondown-sync.json- it’s managed automatically
What Doesn’t Get Pushed
The push command won’t upload:- Files outside the configured directory
- The
.buttondown-sync.jsonmetadata file itself - Hidden files (starting with
.) - Files in directories other than
emails/,media/, etc.
Next Steps
After pushing your content:- Visit Buttondown web interface to review and publish drafts
- Run buttondown pull to sync any changes made via the web interface
- Continue the edit-push cycle for your next newsletter