publish

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Publish

发布

One finished video out, on the creator's own accounts. Making it is
/short-editing
.
Nothing is posted before the creator's explicit yes on the plan of step 5. That yes covers that video only.
Talk to them in their language.
<edit>
=
video-agent/edits/<slug>/
.
将一个成品视频发布到创作者自己的账号。视频制作请使用
/short-editing
。
在创作者对第 5 步的计划明确同意之前,不得发布任何内容。该同意仅适用于该视频。
使用用户的语言与其沟通。
<edit>
=
video-agent/edits/<slug>/
。

1. Which video

1. 选择视频

First match wins:
  1. A path, a slug or a title they give:
    <edit>/final.mp4
    .
  2. The video finished in this conversation.
  3. Nothing: the newest
    video-agent/edits/*/final.mp4
    . Name it in the plan.
Then check
<edit>/published.md
: already there with this platform, say so and stop (unless they want to post it again).
Read the format with ffprobe: vertical (a short, for YouTube Shorts, Reels and TikTok) or horizontal (a long video, YouTube only by default).
先按以下顺序匹配,第一项匹配成功即停止:
  1. 用户提供的路径、slug 或标题:
    <edit>/final.mp4
    。
  2. 本次对话中已完成的视频。
  3. 如果以上都没有:选择最新的
    video-agent/edits/*/final.mp4
    ,并在计划中写明其名称。
接着检查
<edit>/published.md
:如果其中已记录该平台,则说明情况并停止(除非用户希望再次发布)。
使用 ffprobe 读取格式:竖版(短视频,可用于 YouTube Shorts、Reels 和 TikTok)或横版(长视频,默认仅发布到 YouTube)。

2. Setup Treg (once)

2. 设置 Treg(仅需一次)

Treg posts for them on their own accounts, free. Check:
bash
treg --version
treg connections ls
Each platform they post on must show in the list with posting rights (
scopes
with
content_publish
on Instagram,
video.publish
on TikTok,
youtube.upload
or
youtube
on YouTube).
Missing: explain in one line, ask, then:
  • Install (macOS and Linux; on Windows use the MCP:
    claude mcp add --transport http treg https://treg.to/mcp/
    , then
    /mcp
    to sign in):
    bash
    curl -fsSL https://treg.to/install.sh | sh
    treg login
  • Connect only the platforms they post on, each opens the platform's own login:
    bash
    treg connections connect --provider instagram --capability post
    treg connections connect --provider tiktok --capability post
    treg connections connect --provider youtube --capability post
    Instagram needs a professional account (Creator or Business, free switch in the app's settings).
They don't want Treg: the manual route (6a) works with no setup.
Treg 可免费代用户使用其自己的账号发布。检查:
bash
treg --version
treg connections ls
用户要发布的每个平台都必须出现在列表中,并具备发布权限(Instagram 的
scopes
中包含
content_publish
,TikTok 中包含
video.publish
,YouTube 中包含
youtube.upload
或
youtube
)。
如果缺少配置:用一行说明情况,询问用户,然后执行:
  • 安装(macOS 和 Linux;在 Windows 上使用 MCP:
    claude mcp add --transport http treg https://treg.to/mcp/
    ,然后运行
    /mcp
    登录):
    bash
    curl -fsSL https://treg.to/install.sh | sh
    treg login
  • 连接仅需连接用户要发布的平台,每个命令都会打开对应平台自己的登录页面:
    bash
    treg connections connect --provider instagram --capability post
    treg connections connect --provider tiktok --capability post
    treg connections connect --provider youtube --capability post
Instagram 需要专业账号(Creator 或 Business,可在应用设置中免费切换)。
用户不想使用 Treg:无需任何设置即可采用手动发布流程(6a)。

3. The files

3. 文件

  • Master:
    <edit>/final.mp4
    , full quality, for YouTube.
  • Social export (shorts only):
    <edit>/social.mp4
    , H.264 + AAC, under 30 MB so Treg can host it for Instagram (TikTok accepts up to 64 MB). Missing or older than the master, re-encode at a bitrate that fits (about 28 MB × 8000 ÷ duration in seconds, minus 160 kb/s of audio, in kb/s):
    bash
    ffmpeg -y -i <edit>/final.mp4 -c:v libx264 -preset slow -b:v <rate>k -maxrate <rate>k -bufsize <2x rate>k -pix_fmt yuv420p -c:a aac -b:a 160k -movflags +faststart <edit>/social.mp4
    Check its size, and that it decodes:
    ffmpeg -v error -i <edit>/social.mp4 -f null -
    .
  • Cover:
    <edit>/cover.jpg
    , always. Without one, Instagram takes frame 0, often a blink or a blank frame. Pick it from the hook: the face with the eyes open, the hook card fully in. Contact sheet of the first 3 seconds, read it, then extract the chosen time
    <t>
    :
    bash
    ffmpeg -v error -y -ss 0.1 -t 3 -i <edit>/final.mp4 -vf "fps=10,scale=270:-1,tile=6x5" -frames:v 1 video-agent/.tmp/hook-sheet.jpg
    ffmpeg -v error -y -ss <t> -i <edit>/final.mp4 -frames:v 1 -q:v 2 <edit>/cover.jpg
    Vertical: keep the key visual inside the central 3:4 (y 240 to 1680), the profile grid crops to it. A long video: a 1280x720 thumbnail is better; offer
    /codex-images
    to make one, or use a frame.
  • 母版:
    <edit>/final.mp4
    ,完整画质,用于 YouTube。
  • 社交媒体导出文件(仅短视频):
    <edit>/social.mp4
    ,H.264 + AAC,小于 30 MB,以便 Treg 为 Instagram 托管该文件(TikTok 接受最大 64 MB)。如果文件缺失,或其修改时间早于母版,则按符合大小限制的码率重新编码。码率计算方式约为:28 MB × 8000 ÷ 时长(秒)− 160 kb/s 的音频码率,结果单位为 kb/s:
    bash
    ffmpeg -y -i <edit>/final.mp4 -c:v libx264 -preset slow -b:v <rate>k -maxrate <rate>k -bufsize <2x rate>k -pix_fmt yuv420p -c:a aac -b:a 160k -movflags +faststart <edit>/social.mp4
    检查文件大小,并确认可以正常解码:
    ffmpeg -v error -i <edit>/social.mp4 -f null -
    。
  • 封面:
    <edit>/cover.jpg
    ,始终需要。如果没有封面,Instagram 会截取第 0 帧,往往正好是眨眼或空白画面。从视频的 hook 中选取:眼睛睁开的人脸、hook 卡片完整显示的画面。生成前 3 秒的接触表并查看,然后从选定时间
    <t>
    提取画面:
    bash
    ffmpeg -v error -y -ss 0.1 -t 3 -i <edit>/final.mp4 -vf "fps=10,scale=270:-1,tile=6x5" -frames:v 1 video-agent/.tmp/hook-sheet.jpg
    ffmpeg -v error -y -ss <t> -i <edit>/final.mp4 -frames:v 1 -q:v 2 <edit>/cover.jpg
    竖版:将关键画面保留在中央 3:4 区域内(y 为 240 到 1680),因为个人主页网格会裁剪到该区域。长视频:1280x720 缩略图更合适;建议使用
    /codex-images
    制作,或直接使用视频中的某一帧。

4. The texts

4. 文案

From
<edit>/post.md
(written by short-editing) when it exists, else from the video's script or transcript and
video-agent/voice.md
, in the video's language:
  • Caption (Instagram and TikTok): a first line that hooks without repeating the spoken hook word for word (the first 125 characters show before "more"), 2 to 4 short lines on what the viewer gets, the ask from voice.md, then 3 to 5 hashtags of the topic. No #fyp, no wall of emoji.
  • TikTok caption only when it should differ (shorter, other hashtags).
  • YouTube title: Shorts under 60 characters, long under 70, the promise of the video, true to it.
  • YouTube description: the caption, the chapters for a long video (from post.md), then their links (ask once and add them to voice.md).
Run the humanize pass of
studio-script
(its
references/humanize.md
) on all of them when that skill is installed. Every name, number and claim comes from the video; none is added. Save them in
<edit>/post.md
, one heading per text.
如果
<edit>/post.md
存在,则使用其中的内容(由 short-editing 写入);否则使用视频脚本或转录稿以及
video-agent/voice.md
,并使用视频本身的语言:
  • Caption(说明文案)(Instagram 和 TikTok):首行应吸引注意,但不要逐字重复口播中的 hook(前 125 个字符会在“more”之前显示);接着用 2 到 4 个短句说明观众能获得什么,再加入 voice.md 中的行动号召,最后添加 3 到 5 个与主题相关的 hashtag。不要使用 #fyp,也不要堆砌 emoji。
  • TikTok caption:仅在需要使用不同文案时采用,例如文案更短或使用其他 hashtag。
  • YouTube 标题:Shorts 少于 60 个字符,长视频少于 70 个字符;呈现视频的承诺,并且必须与内容相符。
  • YouTube 描述:使用 caption,长视频还需加入章节(来自 post.md),然后附上用户的链接(询问一次并添加到 voice.md)。
安装了该 skill 后,对所有文案执行
studio-script
的 humanize 处理(使用其
references/humanize.md
)。所有姓名、数字和陈述都必须来自视频,不得添加任何内容。将文案保存在
<edit>/post.md
中,每段文案使用一个标题。

5. The plan (mandatory)

5. 计划(必须执行)

  • Platforms: a short goes to YouTube + Instagram + TikTok, a long video to YouTube, unless they name others.
  • Time: the one they give (written in their local time and in UTC), else now.
  • Route per platform: Treg (connected) or manual. Instagram and TikTok have no scheduling through Treg: they post now. YouTube can wait for a date (private +
    publishAt
    ). A later time on Instagram or TikTok: run
    /publish
    again at that time, or go manual and use the app's scheduler.
Show it and wait for a clear yes:
text
PLAN · budget-margins · 0:47 · social.mp4 18 MB
Cover: cover.jpg (0.8 s)  [shown as an image]
YouTube Shorts · Treg · 2026-10-11 18:00 Paris (16:00 UTC) · private until then
Instagram Reel · Treg · now
TikTok · manual (not connected)
Title: Your margin is lying to you
Caption: ...
Reply yes to publish, or tell me what to change.
A change on the plan: apply it, show the plan again.
  • 平台:短视频发布到 YouTube + Instagram + TikTok,长视频发布到 YouTube,除非用户指定其他平台。
  • 时间:使用用户提供的时间(同时列出其本地时间和 UTC),否则为现在。
  • 每个平台的方式:Treg(已连接)或手动。Instagram 和 TikTok 无法通过 Treg 定时发布,只能立即发布。YouTube 可以指定未来日期(先设为
    private
    ,并使用
    publishAt
    )。如需在稍后的时间发布到 Instagram 或 TikTok:在届时再次运行
    /publish
    ,或者采用手动方式并使用应用自带的定时发布功能。
展示计划并等待用户明确同意:
text
PLAN · budget-margins · 0:47 · social.mp4 18 MB
Cover: cover.jpg (0.8 s)  [shown as an image]
YouTube Shorts · Treg · 2026-10-11 18:00 Paris (16:00 UTC) · private until then
Instagram Reel · Treg · now
TikTok · manual (not connected)
Title: Your margin is lying to you
Caption: ...
Reply yes to publish, or tell me what to change.
如果用户要求修改计划:应用修改,重新展示计划。

6a. Manual

6a. 手动发布

Open the folder (macOS
open <edit>
, Windows
explorer <edit>
, Linux
xdg-open <edit>
), then give the steps:
  • YouTube: studio.youtube.com → Create → Upload videos →
    final.mp4
    → title and description from
    post.md
    ,
    cover.jpg
    as thumbnail → Visibility → Schedule or Public.
  • Instagram: the app → + → Reel →
    social.mp4
    → the caption → Edit cover → Add from camera roll →
    cover.jpg
    → Share (or Schedule in the advanced settings of a professional account).
  • TikTok: the app or tiktok.com/upload →
    social.mp4
    → the caption → cover at the cover time → Post (or Schedule on the web).
打开文件夹(macOS 使用
open <edit>
,Windows 使用
explorer <edit>
,Linux 使用
xdg-open <edit>
),然后提供以下步骤:
  • YouTube:studio.youtube.com → Create → Upload videos →
    final.mp4
    → 使用
    post.md
    中的标题和说明 → 将
    cover.jpg
    设为缩略图 → Visibility → Schedule 或 Public。
  • Instagram:应用 → + → Reel →
    social.mp4
    → caption → Edit cover → Add from camera roll →
    cover.jpg
    → Share(或在专业账号的高级设置中选择 Schedule)。
  • TikTok:应用或 tiktok.com/upload →
    social.mp4
    → caption → 在封面时间点设置封面 → Post(或在网页端选择 Schedule)。

6b. Treg

6b. Treg

Before each call,
treg catalog get <id>
for the exact parameters (they change). All of these are free on their own accounts. Keep stdout only (
2>/dev/null
). One platform failing never blocks the others.
Instagram reel
  1. Host the files (30 MB max each, 7 days):
    treg host <edit>/social.mp4
    and
    treg host <edit>/cover.jpg
    print public URLs.
  2. instagram.instagram.media.container.create
    with
    ig_user_id
    (the
    resource_ref
    of their Instagram in
    treg connections ls
    ),
    media_type=REELS
    ,
    video_url
    ,
    cover_url
    ,
    caption
    .
  3. Poll
    instagram.instagram.media.container.status
    every 10 s until
    FINISHED
    (
    ERROR
    : show it and stop for Instagram).
  4. instagram.instagram.post.publish
    with the container id. Then its
    permalink
    (
    instagram.instagram.user.posts
    with
    fields=id,permalink
    , the newest one).
TikTok
  1. tiktok.tiktok.creator.info
    : the privacy options they may use.
  2. tiktok.tiktok.video.publish.init
    with the caption, a
    privacy_level
    from that list (public when it is there),
    video_cover_timestamp_ms
    = the cover time in ms (TikTok takes a frame, never an image), and
    source_info
    FILE_UPLOAD
    with the file size as one chunk.
  3. PUT
    social.mp4
    to the returned
    upload_url
    with
    Content-Type: video/mp4
    and
    Content-Range: bytes 0-<size-1>/<size>
    .
  4. Poll
    tiktok.tiktok.publish.status
    until it is published.
An answer
unaudited_client_can_only_post_to_private_accounts
(or only
SELF_ONLY
in the options): send it to their TikTok inbox instead with
tiktok.tiktok.video.inbox.init
(same upload, no caption), and tell them to open TikTok within 24 hours, paste the caption and post.
YouTube
  1. youtube.youtube.video.upload
    with
    uploadType=resumable
    , the snippet (title, description) and
    status
    {"privacyStatus": "private", "selfDeclaredMadeForKids": false}
    plus
    "publishAt": "<UTC ISO time>"
    for a date (
    "public"
    for now).
  2. PUT
    final.mp4
    to the session URL it returns.
  3. youtube.youtube.video.thumbnail.set
    with
    cover.jpg
    (works on verified YouTube accounts; a refusal is fine, say it).
No session URL in the answer: go manual for YouTube.
每次调用前,运行
treg catalog get <id>
获取准确参数(参数会发生变化)。所有这些操作在用户自己的账号上免费进行。只保留 stdout(
2>/dev/null
)。一个平台失败时,不得阻止其他平台继续发布。
Instagram reel
  1. 托管文件(每个文件最大 30 MB,有效期 7 天):
    treg host <edit>/social.mp4
    和
    treg host <edit>/cover.jpg
    会输出公开 URL。
  2. 调用
    instagram.instagram.media.container.create
    ,传入
    ig_user_id
    (
    treg connections ls
    中其 Instagram 的
    resource_ref
    )、
    media_type=REELS
    、
    video_url
    、
    cover_url
    和
    caption
    。
  3. 每 10 秒轮询
    instagram.instagram.media.container.status
    ,直到状态为
    FINISHED
    (如果为
    ERROR
    :显示错误并停止 Instagram 发布)。
  4. 使用 container id 调用
    instagram.instagram.post.publish
    。然后通过
    instagram.instagram.user.posts
    (使用
    fields=id,permalink
    )获取最新一条帖子的
    permalink
    。
TikTok
  1. 调用
    tiktok.tiktok.creator.info
    :获取用户可使用的隐私选项。
  2. 调用
    tiktok.tiktok.video.publish.init
    ,传入 caption、选项列表中的
    privacy_level
    (如果列表中有 public,则使用 public)、
    video_cover_timestamp_ms
    = 封面时间(毫秒;TikTok 使用视频帧,不使用图片),以及
    source_info
    FILE_UPLOAD
    ,并以单块方式提供文件大小。
  3. 使用
    Content-Type: video/mp4
    和
    Content-Range: bytes 0-<size-1>/<size>
    ,将
    social.mp4
    PUT 到返回的
    upload_url
    。
  4. 轮询
    tiktok.tiktok.publish.status
    ,直到内容发布成功。
如果返回
unaudited_client_can_only_post_to_private_accounts
(或选项中只有
SELF_ONLY
):改用
tiktok.tiktok.video.inbox.init
将其发送到用户的 TikTok 收件箱(使用相同的上传方式,不带 caption),并告知用户在 24 小时内打开 TikTok,粘贴 caption 后发布。
YouTube
  1. 调用
    youtube.youtube.video.upload
    ,设置
    uploadType=resumable
    ,提供 snippet(标题、说明)和 status
    {"privacyStatus": "private", "selfDeclaredMadeForKids": false}
    ;指定日期时再加入
    "publishAt": "<UTC ISO time>"
    ,立即发布时使用
    "public"
    。
  2. 将
    final.mp4
    PUT 到返回的 session URL。
  3. 使用
    cover.jpg
    调用
    youtube.youtube.video.thumbnail.set
    (适用于已验证的 YouTube 账号;如果被拒绝也可以接受,如实告知用户)。
如果响应中没有 session URL:改用 YouTube 手动发布流程。

7. Record it

7. 记录发布结果

Write
<edit>/published.md
, one line per platform: date, time, route, and the link (
https://youtube.com/shorts/<id>
or
https://youtu.be/<id>
, the reel, the TikTok) once live. Manual route: write it when they say it is posted.
Then say what is live, the links, and offer
/insta-audit
in a week to see how it did.
写入
<edit>/published.md
,每个平台一行:日期、时间、发布方式和链接(
https://youtube.com/shorts/<id>
或
https://youtu.be/<id>
、Reel 链接、TikTok 链接);仅在内容上线后记录。手动方式:在用户表示已发布后写入。
然后说明哪些内容已上线,提供链接,并建议一周后使用
/insta-audit
查看效果。

Honest limits

如实说明限制

  • Instagram and TikTok can't be scheduled through Treg, only posted now. Their own apps can schedule.
  • TikTok keeps posts from new third-party apps private until the app is audited; the inbox route works around it.
  • A platform can refuse a video (length, format, music rights). The error is shown as is; the manual route always works.
  • Only post videos the creator owns or has the rights to, music included.
  • Instagram 和 TikTok 无法通过 Treg 定时发布,只能立即发布。它们的应用本身支持定时发布。
  • 新第三方应用发布的 TikTok 帖子在应用通过审核前会保持私密;收件箱流程可以绕过此限制。
  • 平台可能因视频长度、格式或音乐版权问题拒绝发布。错误信息将按原样显示;手动发布流程始终可用。
  • 只能发布创作者拥有或拥有相关权利的视频,包括音乐版权。