The Buttondown CLI uses API key authentication to securely connect to your Buttondown account.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.
How Authentication Works
The CLI authenticates all requests to the Buttondown API using a token-based authentication system:- Your API key is stored locally on your machine
- Each API request includes an
Authorizationheader with your token - The CLI also sends a user-agent header to identify itself
src/sync/types.ts:26-40:
Configuration Storage
Your credentials are stored using the conf package, which saves configuration data in a platform-specific location:- macOS:
~/Library/Preferences/buttondown-cli-nodejs/ - Linux:
~/.config/buttondown-cli-nodejs/ - Windows:
%APPDATA%\buttondown-cli-nodejs\
Your Buttondown API key used for authentication
The base URL for the Buttondown API
Your Buttondown username (optional)
Getting Your API Key
To get your API key:- Log in to your Buttondown account
- Navigate to Settings → API
- Copy your API key
Authenticating the CLI
Interactive Login
The easiest way to authenticate is using the interactive login command:Non-Interactive Login
You can also provide your API key directly:Changing Your API Key
If you’re already logged in and want to use a different API key:Logging Out
To remove your stored credentials:Security Best Practices
Use environment-specific API keys
If you have multiple Buttondown accounts (e.g., production and staging), use separate API keys for each.
Rotate keys regularly
Periodically generate new API keys in your Buttondown settings and update the CLI configuration.
Troubleshooting
”Unauthorized” Errors
If you receive authentication errors:- Verify your API key is correct in your Buttondown settings
- Try logging out and logging in again: