Recipes
Practical, copy-pasteable workflows. They assume you’re authenticated
(loomta auth:status returns authenticated) and use jq to thread IDs between
commands.
Publish a video immediately
Section titled “Publish a video immediately”PID=$(loomta platforms:list | jq -r '.platforms[] | select(.provider=="tiktok") | .id' | head -n1)ID=$(loomta upload launch.mp4 | jq -r '.id')loomta posts:create \ -c "We just shipped 🚀 #buildinpublic" \ -m "$ID" -i "$PID" \ --mode now \ --settings '{"privacy_level":"PUBLIC_TO_EVERYONE"}'Schedule a photo carousel for later
Section titled “Schedule a photo carousel for later”A TikTok carousel is 1–35 images (never mixed with video). Upload each image,
collect the IDs, and schedule with -s:
PID=$(loomta platforms:list | jq -r '.platforms[]|select(.provider=="tiktok").id' | head -n1)A=$(loomta upload a.jpg | jq -r '.id')B=$(loomta upload b.jpg | jq -r '.id')C=$(loomta upload c.jpg | jq -r '.id')loomta posts:create \ -c "3 reasons to try us" \ -m "$A,$B,$C" -i "$PID" \ -s "2026-07-01T15:00:00Z"Generate captions with AI, then bake them onto images
Section titled “Generate captions with AI, then bake them onto images”Draft copy with slides:caption, then composite the chosen captions onto your
uploaded images with slides:composite. Both spend AI credits.
# 1. Draft a caption + 4 slide textsloomta slides:caption -r "Why indie devs love our app" -n 4
# 2. Upload base images and composite captions onto themA=$(loomta upload slide-a.jpg | jq -r '.id')RESULT=$(loomta slides:composite --slides "[{\"index\":0,\"mediaId\":\"$A\",\"caption\":\"Reason 1\"}]")
# 3. Feed the composited media IDs into a postCID=$(echo "$RESULT" | jq -r '.slides[0].mediaId')loomta posts:create -c "4 reasons devs love us" -m "$CID" -i "$PID" --mode nowReschedule or cancel
Section titled “Reschedule or cancel”# Move a scheduled postloomta posts:reschedule <postId> -s "2026-07-02T18:00:00Z"
# List what's queued, then delete oneloomta posts:list --start-date "2026-07-01T00:00:00Z" --end-date "2026-07-31T23:59:59Z"loomta posts:delete <postId>Robust scripting
Section titled “Robust scripting”Because failures go to stderr with a 1 exit code, you can fail fast:
set -euo pipefailif ! loomta auth:status >/dev/null; then echo "Not authenticated" >&2; exit 1fiTo branch on a specific error, capture stderr and read the code:
if ! OUT=$(loomta posts:create -c "x" -i "$PID" -m "$ID" --mode now 2>&1); then CODE=$(echo "$OUT" | jq -r '.error.code') [ "$CODE" = "post_limit_reached" ] && echo "Upgrade the plan." >&2fiSee Use with AI agents for the agent-oriented version of these patterns.