Terminal-first CLI for drafting posts and publishing them to Buffer.
Package: @supacart/buffer-cli
Repo: github.com/supacart/buffer-cli
Use it when you want a simple way to:
- draft posts locally
- list your connected Buffer channels
- schedule a post from the terminal
- publish a post immediately
pnpm add -g @supacart/buffer-cliThen run:
buffer help
buffer version
buffer setupbuffer setup
buffer list-channels
buffer draft --text "We help teams ship software without the usual chaos." --channel-hint facebook
buffer drafts
buffer schedule --channel facebook --draft .social/drafts/your_draft_file.json --at 2026-03-20T09:00:00Z- Saves local drafts in
.social/drafts/ - Lists connected Buffer channels
- Schedules a post to a Buffer channel
- Publishes a post now
The easiest way is:
buffer setupbuffer setup will:
- detect whether you use
zshorbash - ask for your Buffer API key
- ask for your Buffer organization ID
- save them into the right shell profile
If you prefer to set values manually, you can still export them yourself:
export BUFFER_API_KEY=your_api_key_here
export BUFFER_ORGANIZATION_ID=your_organization_id_hereOptional legacy token fallback for older profile listing:
export BUFFER_ACCESS_TOKEN=your_legacy_access_tokenList your channels and copy the Facebook channel ID:
buffer list-channelsCreate a draft:
buffer draft --text "We help teams ship software without the usual chaos." --channel-hint facebookSchedule the draft:
buffer schedule \
--channel facebook \
--draft .social/drafts/your_draft_file.json \
--at 2026-03-20T09:00:00ZFacebook posts default to post. If you want a different Facebook type, pass:
buffer publish-now --channel your_facebook_channel_id --text "Behind the scenes" --type story
buffer publish-now --channel your_facebook_channel_id --text "New product demo" --type reelOr publish immediately:
buffer publish-now \
--channel facebook \
--text "We help teams ship software without the usual chaos."When Buffer provides the network URL after a successful publish-now, the CLI prints:
Posted URL: https://...
buffer help
buffer version
buffer setup
buffer list-channels --org your_organization_id
buffer draft --text "We just shipped a new client portal." --channel-hint facebook
buffer drafts
buffer schedule --channel facebook --text "Shipping updates this week." --at 2026-03-20T09:00:00Z [--type post|story|reel]
buffer publish-now --channel facebook --draft .social/drafts/2026-03-19_some-post.json [--type post|story|reel]- This is an unofficial Buffer CLI.
draftis local on purpose. Buffer draft behavior is less stable in the public docs than post creation.list-channelsuses Buffer's GraphQL API whenBUFFER_ORGANIZATION_IDis available, then falls back to Buffer's legacy profiles endpoint ifBUFFER_ACCESS_TOKENis available.--channelaccepts either a raw Buffer channel ID or a simple alias likefacebook,tiktok, ortwitter.- Facebook publish calls automatically default to
type: postwhen the target channel is Facebook. scheduleandpublish-nowuse Buffer's GraphQLcreatePostmutation pattern.publish-nowprintsPosted URL: ...when Buffer returns the external post link.- For local development in this repo,
pnpm social ...still works and now runs the TypeScript source directly.
- Start at
0.1.0while the CLI is still early and changing quickly. - Use patch releases like
0.1.1for bug fixes. - Use minor releases like
0.2.0for new features or breaking changes while still pre-1.0. - Move to
1.0.0when the command surface feels stable enough for others to depend on.
This repo includes:
- GitHub Actions CI in
.github/workflows/ci.yml - GitHub Actions npm publish workflow in
.github/workflows/publish.yml
Recommended npm setup:
- Create the package under the
@supacartscope. - Configure npm trusted publishing for
supacart/buffer-cliand the workflow file.github/workflows/publish.yml. - Publish by creating a GitHub release like
v0.1.0.