CLI command
content adapt
Viral formats adapted to a product: a classified format written in the product's approved messaging and queued as a draft video.
Invocation#
echo-cli content adapt list [--format <format-id>]
echo-cli content adapt run --format <format-id> --product <product-id> --account <social-account-id> --by <who>Inputs and output#
list writes every queued post adapted from a viral format, newest first (of one format with --format): id, status, social_account_id, caption, created_at and metadata (source viral_format, format_id, format_name, product_id, messaging_version, script, route, requested_by). run writes post_id (the queued draft), format_id, product_id, messaging_version, social_account_id, caption, script and route.
State effect#
The verbs call Echo Web's authenticated /api/analytics/format-adaptations with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the Viral formats for a product section of the ecosystem's analytics and of Echo Desktop's GEO screen do the same, and echo-mcp runs them as echo_format_adaptations and echo_format_adapt. run reads the format the viral scrape stored (tiktok_formats) once /api/cron/classify-formats classified it, and the product's approved messaging version (echo-cli messaging), and asks the route Echo Web's ECHO_ADAPT_ROUTE declares, through Brama, for a caption and a script following the format and saying only what the messaging supports. The draft is queued in content_posts as a draft video for --account on its platform; nothing is scheduled or published by adapting.
Refusals#
- A wrong invocation is refused before anything is sent: "content adapt takes list …; run …; got <word>", "content adapt <verb> does not take <flag>; it takes …", "<flag> needs a value" and "content adapt <verb> needs <flag>".
- Echo Web answers a bad request with "format_id must be the whole-number id of a viral format; got <value>", "product_id is required: …", "social_account_id is required: …", "requested_by is required: an internal caller has no signed-in user, so it names who is acting" or "format <id> (<name>) is not classified yet; /api/cron/classify-formats classifies it"; not found with "no viral format has id <id>", "product <id> has no approved messaging; echo-cli messaging approve approves a version" or "no social account has id <id>". A deployment without ECHO_ADAPT_ROUTE answers naming the setting. The command prints Echo Web's sentence and exits 1.
- A caption or script the route wrote that holds one of the product's banned phrases (echo-cli glossary) is refused before anything is queued, as unprocessable: "the adapted draft uses banned phrases, so nothing was queued: \"<phrase>\" in <caption|script> at line <n>, column <n>[; write \"<use instead>\" instead]", every occurrence named, with violations (phrase, use_instead, field, line, column) beside it. Running it again asks the route for a new draft.