Communitygithub.com

HKUDS/CLI-Anything

AI 驅動的影片字幕工具 — 轉錄語音、最佳化/翻譯字幕,並透過穩定的 VideoCaptioner 後端將字幕燒錄到影片中。內建免費的 ASR 與翻譯功能。

CLI-Anything 是什麼?

這是一個以 AI 驅動的影片字幕 CLI 工具,專為需要快速轉錄、最佳化、翻譯並燒錄字幕的開發者與 AI 代理而設計。它支援多種語音辨識引擎(如本地的 bijian 與 jianying,以及 Whisper 系列),內建免費的 Bing 翻譯,並提供完整的管線流程:從影片轉錄到字幕硬燒錄,一次完成。該工具支援 JSON 輸出,方便 AI 代理解析結果,也提供互動式 REPL 模式便於手動操作。相容於 Python 3.10 至 3.12,需搭配 VideoCaptioner 後端與 FFmpeg 使用。它特別適合需要在地化影片內容的團隊,因為它無需外部 API 金鑰即可免費使用基礎的語音辨識與翻譯功能。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/HEAD/skills/cli-anything-videocaptioner

在你喜歡的 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 輸出(供代理使用)
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]
  • 鏡像穩定的後端合成介面
  • 字幕外觀由字幕資產/後端版本控制,而非額外的 harness 標誌
  • --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

>-

相關技能