Communitygithub.com

HKUDS/CLI-Anything

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

CLI-Anything 是什麼?

這是一個專為開發者與 AI 代理設計的指令列工具,用於自動化影片字幕處理流程。它支援完整的管道:從語音轉文字(ASR)、字幕優化、翻譯,到最終將字幕嵌入影片(軟字幕或硬燒錄)。內建免費的 ASR 引擎(如 Bijian)與翻譯服務(Bing、Google),覆蓋 38 種語言,適合多語言內容創作者與自動化工作流程。工具提供 JSON 輸出模式,可直接被 AI 代理或腳本解析。支援平台包括 Python 3.10-3.12 環境,需安裝 FFmpeg 與 `videocaptioner` 套件。內建互動式 REPL 模式,便於除錯與批次操作。

相容平台~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 輸出(供 AI 代理使用)
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian

REPL 模式

在不帶子指令的情況下啟動時,CLI 會進入互動式 REPL 階段:

cli-anything-videocaptioner
# 以互動方式輸入指令,支援自動補全與歷史記錄

指令群組

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]
  • 對應穩定後端的合成介面
  • 字幕外觀由字幕資產/後端版本控制,而非額外的工具旗標
  • --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

>-

相關技能