Communitygithub.com

HKUDS/CLI-Anything

AI 驱动的视频字幕工具 — 转录语音、优化/翻译字幕,并通过稳定的 VideoCaptioner 后端将字幕烧录到视频中。包含免费的 ASR 和翻译服务。

CLI-Anything 是什么?

这是一个基于 AI 的智能视频字幕工具,能够从视频中转录语音、优化字幕、翻译并最终烧录到视频中。它通过 CLI(命令行界面)和交互式 REPL 模式提供完整的视频字幕制作流水线。该工具支持多种 ASR(自动语音识别)引擎(如免费的中英双语 bijian 引擎、Whisper API 等)和多种翻译器(包括免费的 Bing 翻译和 Google 翻译),覆盖 38 种目标语言(以 BCP 47 编码指定)。用户可以使用 `transcribe`、`subtitle`、`synthesize` 和 `process` 等命令字灵活组合工作流程,并通过 `review` 命令在硬烧录前检查字幕与脚本的一致性。所有命令均支持 `--json` 参数输出 JSON 格式结果,方便 AI Agent 或其他程序化调用。该工具要求 Python 3.10-3.12 环境,并依赖 FFmpeg 进行视频合成,底层基于稳定的 VideoCaptioner 后端。对于开发者或内容创作者来说,该技能通过免费且可编程的方式大幅简化了多语言视频字幕的生成与后期处理。 支持平台: CLI (Python 包),可通过 pip 安装并在任何 Python 3.10-3.12 环境中运行。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/HEAD/videocaptioner/agent-harness/cli_anything/videocaptioner/skills

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

cli-anything-videocaptioner

AI 驱动的视频字幕工具。转录语音 → 优化字幕 → 翻译 → 烧录到视频中。

安装

pip install cli-anything-videocaptioner

前提条件:

  • Python 3.10-3.12(videocaptioner 1.4.1 要求 >=3.10,<3.13)
  • 必须安装 videocaptioner(pip install videocaptioner)
  • 需要 FFmpeg 来进行视频合成

使用方法

基本命令

# 显示帮助
cli-anything-videocaptioner --help

# 启动交互式 REPL 模式
cli-anything-videocaptioner

# 转录视频(免费,无需配置)
cli-anything-videocaptioner transcribe video.mp4 --asr bijian

# 翻译字幕(免费 Bing 翻译器)
cli-anything-videocaptioner subtitle input.srt --translator bing --target-language en

# 完整流水线:转录 → 翻译 → 烧录字幕
cli-anything-videocaptioner process video.mp4 --asr bijian --translator bing --target-language en --subtitle-mode hard

# 在最终硬烧录前检查字幕/脚本的一致性
cli-anything-videocaptioner synthesize video.mp4 -s subtitles.srt \
  --subtitle-mode hard \
  --review-script approved_script.txt

# 渲染一帧字幕预览以供审查
cli-anything-videocaptioner review subtitles.srt \
  --script approved_script.txt \
  --preview-video video.mp4 \
  --preview-output review_5s.png

# JSON 输出(供 Agent 使用)
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian

REPL 模式

当不带子命令调用时,CLI 会进入交互式 REPL 会话:

cli-anything-videocaptioner
# 以交互方式输入命令,支持 Tab 补全和历史记录

命令组

transcribe — 语音转字幕

transcribe <input> [--asr bijian|jianying|whisper-api|whisper-cpp] [--language CODE] [--format srt|ass|txt|json] [-o PATH]
  • bijian(默认):免费,支持中文和英文,无需配置
  • whisper-api:支持所有语言,需要 --whisper-api-key

subtitle — 优化和翻译

subtitle <input.srt> [--translator llm|bing|google] [--target-language CODE] [--layout target-above|source-above|target-only|source-only] [--no-optimize] [--no-translate] [-o PATH]
  • 三个步骤:分割 → 优化 → 翻译
  • Bing/Google 翻译器免费使用
  • 支持 38 种目标语言(BCP 47 编码)

synthesize — 将字幕烧录到视频中

synthesize <video> -s <subtitle> [--subtitle-mode soft|hard] [--quality ultra|high|medium|low] [-o PATH] [--review-script PATH] [--max-script-diff-ratio FLOAT]
  • 与稳定后端的 synthesize 接口保持一致
  • 字幕外观由字幕资产/后端版本控制,而非额外的工具标志位
  • --review-script 在最终导出前检查字幕/脚本的偏差
  • 当副本准确性比容错性更重要时,降低 --max-script-diff-ratio

process — 完整流水线

process <input> [--asr ...] [--translator ...] [--target-language ...] [--subtitle-mode ...] [--layout ...] [--no-optimize] [--no-translate] [--no-synthesize] [-o PATH]

review — 一致性检查和预览

review <input.srt|input.ass> [--script PATH] [--max-diff-ratio FLOAT] [--preview-video PATH] [--preview-at TC] [--preview-output PATH]
  • 在硬烧录前检测字幕/脚本偏差
  • 可以渲染单帧预览,而非生成完整最终视频

styles — 列出样式预设

styles
  • 报告已安装的后端是否支持预设样式

config — 管理设置

config show
config set <key> <value>

download — 下载在线视频

download <URL> [-o DIR]

JSON 输出

所有命令都支持 --json 参数以输出机器可读的结果:

cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
# {"output_path": "/path/to/output.srt"}

后端注意事项

  • 上游后端目前要求 Python >=3.10,<3.13;对于矩阵运行,建议使用 Python 3.12。
  • 合成时的高级样式标志依赖于后端版本。请使用 styles 命令检查已安装的后端是否支持它们。
  • 诸如 layout、render_mode、style、style_override 和 font_file 等兼容性标志应视为不稳定,除非通过 styles 确认已安装的后端支持它们。

目标语言

BCP 47 编码: zh-Hans zh-Hant en ja ko fr de es ru pt it ar th vi id 及另外 23 种。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相关技能