Command-line interface for the Buffer social media management API. Manage profiles, schedule posts, and view analytics from your terminal.
npm install -g @funnelenvy/buffer-cli# Save your Buffer access token
buffer auth login <your-access-token>
# List connected social profiles
buffer profiles list --output table
# Create a post
buffer posts create --profile-id <id> --text "Hello from the CLI!"
# Schedule a post
buffer posts create --profile-id <id> --text "Scheduled post" --scheduled-at "2024-03-01T09:00:00Z"
# View sent posts with engagement stats
buffer analytics get --profile-id <id> --output tableBuffer uses OAuth2 access tokens. You can obtain one from the Buffer Developer portal.
buffer auth login <your-access-token>export BUFFER_ACCESS_TOKEN=your-token-here
buffer profiles listbuffer profiles list --access-token your-token-herebuffer auth statusbuffer auth logoutbuffer auth login <token> # Save access token
buffer auth status # Show current auth status
buffer auth logout # Remove stored credentialsbuffer profiles list # List all connected profiles
buffer profiles get --profile-id <id> # Get details for a profile# List posts
buffer posts list --profile-id <id> # List pending posts
buffer posts sent --profile-id <id> # List sent posts
buffer posts list --profile-id <id> --count 50 --page 2 # Paginate results
# Create posts
buffer posts create --profile-id <id> --text "Hello world"
buffer posts create --profile-id <id> <id2> --text "Multi-profile post"
buffer posts create --profile-id <id> --text "With link" --media-link https://example.com
buffer posts create --profile-id <id> --text "Scheduled" --scheduled-at "2024-03-01T09:00:00Z"
buffer posts create --profile-id <id> --text "Share now" --now
# Modify posts
buffer posts update --post-id <id> --text "Updated text"
buffer posts delete --post-id <id>
buffer posts share --post-id <id> # Share immediately
# Dry run (preview without sending)
buffer posts create --profile-id <id> --text "Test" --dry-run
buffer posts delete --post-id <id> --dry-runbuffer analytics get --profile-id <id> # View post analytics
buffer analytics get --profile-id <id> --count 50 --output csv # Export analyticsAll data commands support --output (-o) with three formats:
buffer profiles list -o json # JSON (default) — machine-readable
buffer profiles list -o table # Table — human-readable aligned columns
buffer profiles list -o csv # CSV — for spreadsheets and data pipelinesAdditional flags:
--quiet(-q) — suppress status messages, output only data--verbose(-v) — debug logging including HTTP request URLs
Config file location: ~/.config/buffer-cli/config.json
{
"auth": {
"oauth_token": "your-access-token"
},
"defaults": {
"output": "table"
}
}git clone https://github.com/FunnelEnvy/buffer-cli.git
cd buffer-cli
pnpm install
pnpm run build
pnpm run test
pnpm run typecheck
pnpm run lintThis tool is part of Marketing CLIs — open source CLIs for marketing tools that lack them. Consistent auth, output formats, and error handling across all tools.
MIT