Buttondown Documentation
The Buttondown CLI (Command Line Interface) is a powerful tool that lets you manage your newsletter content from your local machine. It enables workflows like editing newsletters in your preferred text editor, backing up your content, and syncing media files.
Install the CLI globally using npm:
Or use it with npx without installing:
The CLI provides several capabilities:
Before using the CLI, you need to authenticate with your Buttondown API key:
You'll be prompted to enter your API key, which you can find in your Buttondown settings.
To download your newsletters from Buttondown:
This creates a ./buttondown
directory with all your content.
Create a new draft:
Then edit the created Markdown file with your preferred editor.
When you're ready to save your changes back to Buttondown:
The CLI creates this structure in your local folder:
Each newsletter is stored as a Markdown file with YAML frontmatter:
media/
directorybuttondown push
, the CLI uploads the images and updates the URLsConsider adding this to a scheduled task for regular backups.
You can work with different newsletters using different directories:
Create a script like publish.sh
:
Make it executable with chmod +x publish.sh
Command | Description |
---|---|
| Authenticate with Buttondown |
| Clear stored credentials |
| Download content from Buttondown |
| Upload content to Buttondown |
| Create a new draft email locally |
If you encounter authentication errors:
If you've modified the same email both locally and on Buttondown:
cp -r ./buttondown ./buttondown-backup
buttondown pull --force
buttondown push
For more information, refer to the CLI documentation or contact Buttondown support.