Echo/Docs

CLI command

content threads

Thread drafts from published blog posts: each new post of a surface is drafted as a thread for the social accounts the surface declares, and waits in the content queue unposted.

Invocation#

Shell
echo-cli content threads targets
echo-cli content threads target --surface <surface-slug> --account <social-account-id> --part-limit <characters> --by <name>
echo-cli content threads untarget --id <target-id>
echo-cli content threads draft --post <post-id>
echo-cli content threads drafts --post <post-id>

Inputs and output#

targets writes every target (id, surface_slug, social_account_id, part_limit, declared_by, declared_at); target and untarget write the target. draft writes, per target of the post's surface, target_id, social_account_id, draft_id (the queued content post), parts and error (why no draft was made, or null). drafts writes the thread drafts queued from the post, newest first: id, social_account_id, platform, caption, status, metadata and created_at.

State effect#

The verbs call Echo Web's authenticated /api/analytics/thread-drafts with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the Thread drafts section of the blog admin and of Echo Desktop's GEO screen do the same, and echo-mcp runs them as echo_thread_targets, echo_thread_target, echo_thread_untarget, echo_thread_draft and echo_thread_drafts. Targets are stored in thread_draft_targets, one per surface and account. A post's thread is its title and description, then each second-level section as its heading and first paragraph, then its address; markdown is reduced to its text and a part longer than --part-limit is split between words. Publishing a post — by the blog admin or an approved publish_blog_post request — queues the drafts by itself and answers them as threads beside the post; each is a content_posts row of content_type thread and status draft carrying the parts and the post in its metadata, posted only once the operator schedules it. A changelog entry is threaded the same way: echo-cli changelog draft writes its release notes as a post of the product's blog, and publishing that post queues threads whose metadata names source changelog_entry, changelog_entry_id and version beside the post (a post written otherwise names source blog_post).

Refusals#

  • A wrong invocation is refused before anything is sent: "content threads takes …; got <word>", "content threads <verb> does not take <flag>; …", "<flag> needs a value" and "content threads <verb> needs <flag>".
  • Echo Web answers a bad request with "surface_slug is required: the blog surface whose published posts are drafted as threads", "social_account_id is required: the social account the threads are drafted for", "part_limit must be a positive whole number: the most characters one part may hold on the account's platform; got <value>", "declared_by is required: an internal caller has no signed-in user, so it names who is acting", "id is required: the target to remove, as echo-cli content threads targets lists it", "post_id is required: the published blog post whose thread is drafted" or "blog post <id> is <status>; only a published post has an address to thread"; not found with "no blog surface has slug <slug>", "no social account has id <id>", "no thread target has id <id>", "no blog post has id <id>" or "the surface <slug> does not exist, so the post has no public address"; and a conflict with "<surface> already drafts threads for account <id> (target <target>); remove it first". The command prints Echo Web's sentence and exits 1.