The Buttondown CLI creates a well-organized directory structure to manage your newsletter content locally.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.
Directory Overview
When you runbuttondown pull, the CLI creates the following structure:
Core Directories
emails/
Contains all your newsletter emails as Markdown files with YAML frontmatter.
- File naming: Each email is saved as
{slug-or-id}.md - Format: Markdown with YAML frontmatter (see Email Format)
- Purpose: Main content for your newsletters
media/
Stores all images and media files downloaded from Buttondown.
- File naming: Original filename from Buttondown (e.g.,
header-image.png) - Supported formats: PNG, JPG, GIF, SVG, WebP
- Usage: Referenced in emails using relative paths
Other Resource Directories
The CLI also syncs additional Buttondown resources:automations/
Email automation workflows
newsletter/
Newsletter settings and configuration
snippets/
Reusable content snippets
State Management File
.buttondown.json
This file tracks the sync state and is automatically managed by the CLI.
Maps image IDs to their local paths and remote URLs. This allows the CLI to:
- Convert absolute URLs to relative paths when pulling
- Convert relative paths to absolute URLs when pushing
- Avoid re-uploading images that are already synced
- Track which images belong to your newsletter
How Files Are Created
On Pull
Fromsrc/commands/pull.tsx:83-162:
On Push
Fromsrc/commands/push.tsx:84-184:
Directory Location
By default, the CLI uses a./buttondown directory in your current working directory.
You can specify a different location:
Version Control
When using Git or other version control systems: Do commit:emails/- Your newsletter contentmedia/- Images and media files (if not too large)automations/,newsletter/,snippets/- Configuration files
.buttondown.json- Contains absolute paths specific to your machine- Large media files (add to
.gitignoreand use Git LFS if needed)
.gitignore: