Use the CLI from Coding Agents
Let Claude Code, Cursor, Codex and other coding agents generate slide decks and schedule posts with the mostly CLI.
Coding agents already know how to run shell commands, so mostly works in Claude Code, Cursor, Codex, Windsurf and any agent with a terminal, with no plugin to install. Prefer a tool connection instead? The same tools are available over MCP.
Setup
Install and log in once on the machine the agent runs on:
npm i -g mostly
mostly auth loginIn sandboxes and CI, set MOSTLY_API_KEY (and MOSTLY_BRAND_ID if you have several brands) instead.
Tell the agent about it
Add a short note to the project's agent instructions (CLAUDE.md, AGENTS.md, .cursor/rules, or Codex's AGENTS.md):
## Mostly (social content)
Use the `mostly` CLI for slide decks and social posts. Run `mostly --help` and
`mostly <command> --help` before using a command. Add `--json` when you need to
read the output.
- Decks: `mostly slides generate --prompt "…" --wait --json`
- Posts: `mostly posts create --deck <id> --platform tiktok,instagram --caption "…" --at "<time>"`
- Never pass `--yes` to `posts publish` or `posts create --publish` until I have
approved the exact post and time in chat.
- Never raise `--max-credits` without asking me.
- Anything else: `mostly tools list`, then `mostly call <tool> --args '{…}'`.Claude Code
Claude Code runs the commands in its terminal and asks before each one unless you allow them. To skip the prompt for read-only commands, allow them in .claude/settings.json:
{
"permissions": {
"allow": [
"Bash(mostly slides list:*)",
"Bash(mostly slides get:*)",
"Bash(mostly posts list:*)",
"Bash(mostly posts get:*)",
"Bash(mostly integrations list:*)"
]
}
}Keep posts publish out of the allow list so you approve every publish.
Then ask in plain words: "Make a 6-slide carousel about our new oat latte and schedule it to TikTok and Instagram for Friday 9am."
Cursor
Cursor's agent runs terminal commands too. Add the note above to .cursor/rules/mostly.mdc. To use Mostly as tools rather than commands, add the MCP server from MCP setup.
Codex
Codex reads AGENTS.md. Codex sandboxes block network access by default, so allow network for the session and pass the key as an environment variable:
export MOSTLY_API_KEY="mst_..."
codexWhy it's safe to hand to an agent
- Drafts first.
posts createonly saves a draft. Publishing needsposts publish, which refuses to run without a terminal unless--yesis passed. - Credit ceilings. Storyboard renders and exports never spend more than
--max-credits; without it they print the price and exit with code2, which tells the agent to ask you. - Clean output.
--jsonon stdout, progress on stderr, non-zero exit codes on failure.