@contenthero/ cli (中文(简体) )
官方内容英雄命令行界面. 生成媒体, 运行内容
从终端或任何代理人读取您的品牌和研究背景
壳. 它骑着 @contenthero/sdk
内核,所以它说话相同 /api/v1 表面为 SDK 和
MCP 服务器。 。 。 .
默认为 JSON, 可预测的退出代码和 a schema 命令
因此,一个代理可以发现每个命令的输入,而不需要文件.
安装
npm install -g @contenthero/cli
需要节点20+. 二进制是 contenthero。 。 。 .
认证
CLI 按此顺序解决您的 API 密钥 : --api-key 旗帜,然后是
CONTENTHERO_API_KEY 环境变量,然后是存储的证书.
# Browser-assisted (recommended): opens your browser, mints a key for this machine
contenthero login
# Bring your own key (CI / headless): create one in the app under API Keys
export CONTENTHERO_API_KEY=ch_live_...
# ...or store it:
contenthero login --with-key ch_live_... # or: echo "$KEY" | contenthero login --with-key
contenthero auth status # verify the active key and show the account
contenthero logout # remove the stored credential
存储的证书住在 ~/.contenthero/credentials (第0600节). 洞穴
var 总是胜过存储文件,因此 CI 可以覆盖本地登录.
产出
JSON为默认值(为代理和脚本所建). 添加 --human 可读性
表格和关键/价值产出.
contenthero account get
contenthero model list --type image --human
生成
generate 覆盖图像,视频,音频,相板,和相唇同步. 等待的种类
份额 --cost (飞行前,收费无), --wait 编号 : --no-wait (默认)
等会)和 --timeout <seconds>。 。 。 .
# Model ids come from `contenthero model list`
# Preflight the cost, then generate and wait for the URLs
contenthero generate image "a red ceramic cube on white" --model <imageModelId> --cost
contenthero generate image "a red ceramic cube on white" --model <imageModelId>
# Submit without blocking, then poll
ID=$(contenthero generate video "drone shot over a canyon" --model <videoModelId> --no-wait | jq -r .outputId)
contenthero status "$ID" --no-wait
contenthero status "$ID" --timeout 300
# Chain: feed a previous output id straight in as a reference (URL or output id)
contenthero generate video "slow zoom in" --model <videoModelId> --start-frame "$ID"
# Audio (synchronous) and upscaling
contenthero generate audio --model <audioModelId> --text "Hello there" --voice <voiceId>
contenthero upscale "$ID" --model <upscaleModelId> --factor 2x
出站码4意味着一个渲染被接受,但在超时前没有完成. 这个
outputId 仍然被排放,所以你可以保持投票.
其余的表面
每个命令以它运行的 MCP 工具来命名(export get 实值 get_export, (中文(简体) ), post publish 实值
publish_post)),所以一个代理人在一个表面学到的东西在另一个表面读取相同.
contenthero view see what the user is looking at; render, hear or watch your work; see a raw clip
contenthero project list | get | create | update | duplicate | share | delete | apply
| transcript get | edit undo|redo
| settings get|update | version list|save|restore|update|delete
contenthero media list | search | get | zoom | share
contenthero import <url> | --pptx <url> | --canva <id>: bring a file, video page or deck in
contenthero export <projectId> | get | list: render a project into a file
contenthero download <id> [path]: write any file of yours, or an export, to disk (free)
contenthero upload <file...>: put local files in your library, large ones in parts, a progress line each, `--resume <outputId>` finishes one that stopped
contenthero transcribe [audioUrl] | --content-id <id> [--slide <n>]: speech to text
contenthero status <ids...> [--kind <kind>]: where any background job is
contenthero card list | get | create | update
contenthero post publish
contenthero tag list | create | update | delete
contenthero stage list | create | update | delete
contenthero space list | get | create | update | delete
contenthero folder list | get | create | update | delete
contenthero brand-kit list | get | create | extract | update | knowledge list|get|search|add|remove
contenthero template list | get | create | update | delete
contenthero kling-element list | get | create | update | delete
contenthero avatar list | get | create | update | delete | look add|remove
contenthero voice list | get
contenthero audio isolate | enhance | enhance-clips | split | split-clips
contenthero content list | get | analyze
contenthero tracked-account list | get | add | update | remove
contenthero connected-account list | get
contenthero account get | update
contenthero model list | get
contenthero schema get
对于特工
schema get commands 丢弃每个命令的参数和选项为 JSON, 所以代理
可以不读这些文件就监听电话:
contenthero schema get commands # the whole surface
contenthero schema get commands generate image # just one command
退出代码
0 成功吗, 1 一般错误, 2 使用错误, 3 认证错误,
4 暂停(工程已接受,但未及时完成), 5 限额拒绝了(信用,每月)
支出上限、存储、计划限额;没有运行,也没有收取任何费用)。 在 JSON 模式中,限制错误也带有它
code 编号 actions。 。 。 .
图像控制和发现
现有 generate image 命令接受 --quality, (中文(简体) ), --output-format, (中文(简体) ), --background, (中文(简体) ), --frame-count, (中文(简体) ), --frame-duration-ms,以及 --frame-size读取 model list 财务报告和审定财务报表 model get <id> 用于选定模型的当前选择、默认、条件、格式兼容性和GIF工作表规则. --json 保留完整的发现反应.
CLI 在 --frame-count 提供,发送一个用于滑动控制的数字和一个用于选定控制的字符串。 框架持续时间是一个以毫秒为单位的整数. 仅用 GIF 输出发送 GIF 控制 。 升起的旗帜被忽略了。 使用 --cost 在不生成的情况下预览同一请求。 服务器拥有模型验证,其拒绝文本被保存.
视频草稿控件
在生成前发现模型声明 。 示范清单和细节包括已接受的投入、投入模式、宣布的决议草案,以及宣布后升级决议和提供情况。 在仍可使用时,更新已完工的草稿。 射击设置是继承的,不能改变。 服务器执行所有权,完成,到期,以及选取的草稿输出是否已经升级.
generate video 接受 --draft, (中文(简体) ), --upgrade-from-output-id, (中文(简体) ), --upgrade-slot, (中文(简体) ), --output-format 财务报告和审定财务报表 --return-last-frame。关闭即时和射击设置进行升级。 选择第一个输出 。 添加 --cost 在不生成的情况下预览同一请求.
对于 generate lip-sync读取 model get 先说 供应 --image 模型声明 singleImage,或 --ref-video 模型声明 singleVideo添加 --audio,或 --script 与 --voice。通过 --cost 预览同一请求。 服务器验证了模型所需的源.