OpenClaw Threads via threadsctl
Use threadsctl as the default interface for Threads operations.
This skill is model-agnostic. It can be used with OpenAI Codex, Gemini, or another OpenClaw text provider. Optional image generation providers are separate from Threads publishing.
Prerequisites
threadsctlis installed and available inPATHTHREADS_SERVICE_URLandTHREADS_SERVICE_API_KEYare configured for the CLI- At least one working OpenClaw text model is configured
- Optional: an image generation provider such as
Geminiif the user wants help creating images before posting - Run
threadsctlfrom/opt/threads-service-ts/threads-serviceon the server where the service is deployed
Use when
- The user wants to publish to Threads
- The user wants to create, approve, or publish a draft
- The user wants to connect a Threads account
- The user wants to inspect accounts, stats, drafts, or published posts
- The user would otherwise need raw
curlor direct HTTP requests
Rules
- Prefer
threadsctlover rawcurlor manual HTTP requests. - Support both workflows:
- direct publish
- draft-first
- If the user says "post now", use direct publish.
- If the user says "draft", "prepare", "queue", or wants review first, use draft flow.
- If the account is unclear, ask which account label or ID to use.
- Prefer account labels over raw account IDs when communicating with the user.
- Use
--confirmedonly when the user clearly intends immediate publishing. - Show concise summaries of results and include IDs only when useful.
- If a command fails, surface the real error and explain the likely next step.
- If the user wants a new image created, handle image generation separately before publishing.
- Prefer
--filefor images generated locally by OpenClaw under/root/.openclaw/media/.... - Use
--media-urlonly when the image is already hosted at a reachable public URL. - Run
threadsctlcommands from default dir/opt/threads-service-ts/threads-service(if user run threadsctl service there) so the deployed wrapper and Docker setup are used.
Commands
Accounts
threadsctl accounts list
threadsctl accounts stats --account main-brand
OAuth
threadsctl auth connect-url --label main-brand
Drafts
threadsctl drafts list --account main-brand
threadsctl draft create --account main-brand --type text --text "Post content" --created-by "OpenClaw"
threadsctl draft create --account main-brand --type image --media-url "https://example.com/image.jpg" --text "Caption" --alt-text "Alt text" --created-by "OpenClaw"
threadsctl draft approve --id draft_xxx --approved-by "OpenClaw"
threadsctl draft publish --id draft_xxx --actor "OpenClaw"
Direct publish
cd /opt/threads-service-ts/threads-service
threadsctl publish text --account main-brand --text "Hello from Threads" --confirmed
threadsctl publish image --account main-brand --file "/root/.openclaw/media/tool-image-generation/image-1---real-file.jpg" --text "Caption" --alt-text "Alt text" --confirmed
threadsctl publish image --account main-brand --media-url "https://example.com/image.jpg" --text "Caption" --alt-text "Alt text" --confirmed
Published posts
threadsctl published list --account main-brand
Workflow
Direct publish
Use when the user clearly wants an immediate post.
Example:
cd /opt/threads-service-ts/threads-service
threadsctl publish text --account main-brand --text "Launching today" --confirmed
Draft-first
Use when the user wants review, approval, or preparation before posting.
Example:
threadsctl draft create --account main-brand --type text --text "Launching today" --created-by "OpenClaw"
Image generation plus publish
If the user wants a brand new image, first use the configured image generation provider. If OpenClaw saved the file locally under /root/.openclaw/media/..., publish it with --file.
Preferred publish step for local OpenClaw output:
cd /opt/threads-service-ts/threads-service
threadsctl publish image --account main-brand --file "/root/.openclaw/media/tool-image-generation/generated-image.jpg" --text "Launching today" --alt-text "Product launch image" --confirmed
Hosted-image fallback:
cd /opt/threads-service-ts/threads-service
threadsctl publish image --account main-brand --media-url "https://example.com/generated-image.jpg" --text "Launching today" --alt-text "Product launch image" --confirmed
Account connection
To connect a new Threads account:
- Run:
threadsctl auth connect-url --label client-two
- Return the generated URL to the user.
- Tell the user to open it in a browser and complete OAuth.
Do not
- Do not use raw
curlwhenthreadsctlsupports the action. - Do not invent account IDs.
- Do not silently switch accounts.
- Do not pass
--confirmedunless immediate publishing is intended. - Do not hide command errors.
- Do not assume an image generation provider is configured unless the environment actually supports it.
- Do not pass local filesystem paths to
--media-url.
Output style
Prefer short result summaries such as:
Published successfully from main-brand.Draft created for second-brand.Could not publish because confirmation was not provided.
Additional resources
- See examples.md for ready-to-copy scenarios.