CLI Examples & Recipes
Copy-paste mostly CLI recipes: carousel to TikTok and Instagram, a week of scheduled posts, retrying failed posts, and scripting with --json and jq.
Carousel to TikTok and Instagram
DECK=$(mostly slides generate --prompt "3 ways to style wide-leg jeans" --aspect-ratio 4:5 --wait --json | jq -r .slideDeckId)
mostly posts create --deck "$DECK" --platform tiktok,instagram \
--caption "Which one are you wearing this week?" --at "+1d" --publish--publish shows the channels and time and asks you to confirm.
Draft now, schedule later
POST=$(mostly posts create --deck <deckId> --platform tiktok --caption "…" --json | jq -r .post.id)
mostly posts get "$POST"
mostly posts schedule "$POST" --at "2026-11-07 18:30"A week of carousels from a topics file
day=1
while IFS= read -r topic; do
deck=$(mostly slides generate --prompt "$topic" --wait --json | jq -r .slideDeckId)
mostly posts create --deck "$deck" --platform tiktok,instagram \
--caption "$topic" --at "+${day}d" --publish --yes
day=$((day + 1))
done < topics.txtHere --yes skips the confirmation for every post, so review topics.txt first.
What's going out this week
mostly posts list --status scheduled
mostly posts list --status scheduled --json | jq -r '.[] | "\(.scheduledFor) \(.id) \(.caption[0:40])"'Retry what failed
mostly posts list --status failed,partially_failed --json | jq -r '.[].id' | xargs -n1 mostly posts retryUnschedule and edit
mostly posts cancel <postId> # back to drafts
mostly posts update <postId> --caption "New caption" --at "+3h"
mostly posts publish <postId>On-brand deck with product photos
mostly call list_brand_products --args '{}' --json | jq -r '.products[] | "\(.id) \(.name)"'
mostly slides generate --prompt "Why our serum works in 7 days" --product <productId> --waitImage and video
mostly generate nano-banana-2-1 --prompt "cold brew can on wet slate, top light" --count 2 --wait
mostly generate seedance-2.5 --prompt "slow push-in, condensation" --start-image ./can.png --duration 5 --waitLocal development
mostly auth login --base-url http://localhost:3000
MOSTLY_BASE_URL=https://staging.mostly.so mostly slides list