Skip to content

Recipes

Practical, copy-pasteable workflows. They assume you’re authenticated (loomta auth:status returns authenticated) and use jq to thread IDs between commands.

Terminal window
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"}'

A TikTok carousel is 1–35 images (never mixed with video). Upload each image, collect the IDs, and schedule with -s:

Terminal window
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.

Terminal window
# 1. Draft a caption + 4 slide texts
loomta slides:caption -r "Why indie devs love our app" -n 4
# 2. Upload base images and composite captions onto them
A=$(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 post
CID=$(echo "$RESULT" | jq -r '.slides[0].mediaId')
loomta posts:create -c "4 reasons devs love us" -m "$CID" -i "$PID" --mode now
Terminal window
# Move a scheduled post
loomta posts:reschedule <postId> -s "2026-07-02T18:00:00Z"
# List what's queued, then delete one
loomta posts:list --start-date "2026-07-01T00:00:00Z" --end-date "2026-07-31T23:59:59Z"
loomta posts:delete <postId>

Because failures go to stderr with a 1 exit code, you can fail fast:

Terminal window
set -euo pipefail
if ! loomta auth:status >/dev/null; then
echo "Not authenticated" >&2; exit 1
fi

To branch on a specific error, capture stderr and read the code:

Terminal window
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." >&2
fi

See Use with AI agents for the agent-oriented version of these patterns.