krillinai-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

KrillinAI CLI

KrillinAI CLI

Use this as the top-level routing skill for KrillinAI command-line work.
将此 skill 作为 KrillinAI 命令行工作的顶层路由 skill。

Build And Locate The Binary

构建并定位二进制文件

Build both KrillinAI binaries through the repository script:
bash
pnpm krillinai:build
For the current machine, locate the CLI without assuming a platform or architecture:
bash
TARGET="$(node -p "process.platform + '-' + process.arch")"
SUFFIX="$(node -p "process.platform === 'win32' ? '.exe' : ''")"
KRILLINAI_CLI="$PWD/.runtime/build/krillinai/$TARGET/bin/krillinai-cli$SUFFIX"
test -f "$KRILLINAI_CLI"
The CLI loads
config/config.toml
relative to its process working directory. For real runs from a source checkout, use
runtime/krillinai
as the process working directory and create its ignored
config/config.toml
from
config/config-example.toml
without overwriting an existing file. A release archive should be run from its unpacked package root.
For build layout, configuration, JSON, manifest, output, and error details, read:
text
skills/krillinai-cli/references/cli-contract.md
通过仓库脚本构建两个 KrillinAI 二进制文件:
bash
pnpm krillinai:build
对于当前机器,在不预设平台或架构的情况下定位 CLI:
bash
TARGET="$(node -p "process.platform + '-' + process.arch")"
SUFFIX="$(node -p "process.platform === 'win32' ? '.exe' : ''")"
KRILLINAI_CLI="$PWD/.runtime/build/krillinai/$TARGET/bin/krillinai-cli$SUFFIX"
test -f "$KRILLINAI_CLI"
CLI 会相对于其进程工作目录加载
config/config.toml
。对于从源代码检出执行的真实运行,应使用
runtime/krillinai
作为进程工作目录,并根据
config/config-example.toml
创建被忽略的
config/config.toml
,但不要覆盖现有文件。发布归档包应从解压后的包根目录运行。
有关构建布局、配置、JSON、manifest、输出和错误详情,请阅读:
text
skills/krillinai-cli/references/cli-contract.md

Choose The Command

选择命令

User intentCommand / skill
Generate source, target, bilingual, and short vertical subtitles
subtitle
; use
krillinai-subtitle
Generate target-language dubbing from subtitles
tts
; use
krillinai-tts
Create landscape videos
render-horizontal
; use
krillinai-render-horizontal
Create portrait/short-form videos
render-vertical
; use
krillinai-render-vertical
Generate a cover from a complete image prompt
cover
; use
krillinai-cover
Generate speech from plain text
speech
List provider voice codes for Aliyun, OpenAI, or MiniMax
voices
Validate a requested multi-stage output plan
pipeline --dry-run
; use
krillinai-pipeline
pipeline
only validates plans in dry-run mode; non-dry-run execution returns
unsupported_command
.
status
is reserved and unsupported.
用户意图命令 / skill
生成源语言、目标语言、双语和竖版短视频字幕
subtitle
; 使用
krillinai-subtitle
根据字幕生成目标语言配音
tts
; 使用
krillinai-tts
创建横屏视频
render-horizontal
; 使用
krillinai-render-horizontal
创建竖屏/短视频
render-vertical
; 使用
krillinai-render-vertical
根据完整的图像提示词生成封面
cover
; 使用
krillinai-cover
根据纯文本生成语音
speech
列出 Aliyun、OpenAI 或 MiniMax 的提供商声音代码
voices
验证请求的多阶段输出计划
pipeline --dry-run
; 使用
krillinai-pipeline
pipeline
仅在 dry-run 模式下验证计划;非 dry-run 执行会返回
unsupported_command
。
status
为保留命令,目前不支持。

Operating Rules For Agents

Agent 操作规则

  • Use a dedicated
    --workdir
    ; do not scatter outputs in the repo root.
  • Use
    --dry-run
    for command-shape validation before external calls.
  • Parse stdout as JSON lines. The terminal response is the object containing
    ok
    ; OpenCreator mode may emit progress frames first.
  • Treat
    krillinai_manifest.json
    and actual output files as the source of truth after a real stage.
  • Reuse manifest outputs for later stages instead of guessing filenames.
  • If a command fails, classify by
    error.kind
    :
    usage
    ,
    retryable
    ,
    dependency
    , or
    internal
    .
  • Avoid rerunning expensive stages if the manifest already has valid upstream outputs.
  • Do not claim that
    cover
    consumed a reference image: the current CLI accepts a complete text prompt and size only.
  • Do not request an Edge TTS voice catalog:
    voices
    currently supports
    aliyun
    ,
    openai
    , and
    minimax
    .
  • 使用专用的
    --workdir
    ;不要将输出散落在仓库根目录。
  • 在进行外部调用之前,使用
    --dry-run
    验证命令结构。
  • 将 stdout 解析为 JSON Lines。终端响应是包含
    ok
    的对象;OpenCreator 模式可能会先输出进度帧。
  • 真实阶段完成后,以
    krillinai_manifest.json
    和实际输出文件为准。
  • 后续阶段应复用 manifest 输出,不要猜测文件名。
  • 如果命令失败,按
    error.kind
    分类:
    usage
    、
    retryable
    、
    dependency
    或
    internal
    。
  • 如果 manifest 中已有有效的上游输出,避免重新运行耗时的阶段。
  • 不要声称
    cover
    使用了参考图像:当前 CLI 仅接受完整的文本提示词和尺寸。
  • 不要请求 Edge TTS 声音目录:
    voices
    目前支持
    aliyun
    、
    openai
    和
    minimax
    。

Minimal Workflow

最小工作流

bash
REPO_ROOT="$PWD"
WORKDIR="$REPO_ROOT/tasks/demo"
mkdir -p "$WORKDIR"

(cd "$REPO_ROOT/runtime/krillinai" && "$KRILLINAI_CLI" subtitle \
  "https://www.youtube.com/watch?v=VIDEO_ID" \
  --origin-lang en \
  --target-lang zh_cn \
  --workdir "$WORKDIR" \
  --caption-source any \
  --prepare-video)

(cd "$REPO_ROOT/runtime/krillinai" && "$KRILLINAI_CLI" render-vertical \
  --workdir "$WORKDIR")
bash
REPO_ROOT="$PWD"
WORKDIR="$REPO_ROOT/tasks/demo"
mkdir -p "$WORKDIR"

(cd "$REPO_ROOT/runtime/krillinai" && "$KRILLINAI_CLI" subtitle \
  "https://www.youtube.com/watch?v=VIDEO_ID" \
  --origin-lang en \
  --target-lang zh_cn \
  --workdir "$WORKDIR" \
  --caption-source any \
  --prepare-video)

(cd "$REPO_ROOT/runtime/krillinai" && "$KRILLINAI_CLI" render-vertical \
  --workdir "$WORKDIR")