Mostly CLI
Install the mostly CLI, log in with an API key, and generate slide decks, schedule posts and call any Mostly tool from your terminal or coding agent.
mostly is the command-line client for Mostly. Generate a slide deck, post it to TikTok and Instagram, render a storyboard video or call any Mostly tool, from your terminal or from a coding agent like Claude Code, Cursor or Codex.
It's a thin client: every command calls the same backend as the Mostly app, the MCP server and the REST API. Your brand kit, credits, decks and posts are the same everywhere.
Install
Requires Node.js 18.17 or newer.
npm i -g mostly
mostly --versionOr run it without installing:
npx mostly --helpLog in
- Create an API key in Settings → API & MCP. Keys start with
mst_. - Save it:
mostly auth login # paste the key when asked
mostly auth status # workspace name and credit balanceThe key is stored in ~/.config/mostly/config.json (readable only by you). mostly auth logout removes it.
For CI and agents, set environment variables instead of logging in:
| Variable | What it does |
|---|---|
MOSTLY_API_KEY | API key (overrides the saved one) |
MOSTLY_BRAND_ID | Default brand for every call |
MOSTLY_BASE_URL | Server, default https://mostly.so |
Pick a brand
Slide decks, posts and storyboards use your brand kit (voice, products, palette, fonts). With one brand it's picked automatically. With several:
mostly brands list
mostly brands use <brandId> # saved default
mostly slides list --brand <brandId> # one-off overrideYour first deck, posted
# 1. Plan and render a carousel (waits until every slide has an image)
mostly slides generate --prompt "5 mistakes killing your cold brew" --aspect-ratio 4:5 --wait
# 2. Check which social accounts are connected
mostly integrations list
# 3. Draft the post, scheduled for tomorrow 9am, and confirm
mostly posts create --deck <deckId> --platform tiktok,instagram \
--caption "Save this before your next batch" --at "2026-11-03 09:00" --publishNothing is published without a confirmation. In a terminal mostly asks [y/N]; agents and scripts pass --yes once the user has approved.
Output for scripts and agents
- Add
--jsonto any command for machine-readable output. - Results go to stdout and progress to stderr, so commands pipe cleanly.
--waitpolls every 3 seconds for up to 10 minutes (--wait-interval 5s,--wait-timeout 20m).- Exit code is
1on errors, and2when a command needs--max-creditsbefore it spends credits.