Agent Skills
› Illyism/transcribe-cli
› format-converter
format-converter
GitHub将SRT字幕文件转换为WebVTT、纯文本、JSON或Markdown格式,提供转换逻辑及Node脚本示例。
Trigger Scenarios
用户请求将SRT文件转换为其他格式
需要提取字幕中的纯文本内容
需要将字幕数据解析为结构化JSON
Install
npx skills add Illyism/transcribe-cli --skill format-converter -g -y
SKILL.md
Frontmatter
{
"name": "format-converter",
"description": "Convert SRT subtitle files into WebVTT (.vtt), plain text (.txt), JSON segment arrays (.json), or Markdown notes (.md). Use whenever the user asks to convert an SRT file to VTT, plain text, JSON, or Markdown."
}
Subtitle & Transcript Format Converter
Convert .srt subtitle files into WebVTT (.vtt), plain text (.txt), JSON (.json), or Markdown (.md).
Format Decision Procedure
Walk this procedure based on target format:
Which format is requested?
├── Plain Text (.txt)
│ └── Strip all sequence numbers and timestamps. Join continuous paragraphs with single blank lines.
├── WebVTT (.vtt)
│ └── Add "WEBVTT" header at line 1. Replace commas in timestamps with periods (00:00:01,000 → 00:00:01.000).
├── JSON Array (.json)
│ └── Parse into structured array:
│ [
│ { "id": 1, "start": 0.0, "end": 4.5, "text": "..." }
│ ]
└── Markdown Transcript (.md)
└── Group text into time-stamped sections [MM:SS] with formatted headers and clean paragraphs.
Quick CLI / Script One-Liners
For automated file conversions via Node/Bun or standard tools:
# Extract plain text from SRT using node/bun
node -e "
const fs = require('fs');
const text = fs.readFileSync('input.srt', 'utf8')
.replace(/\d+\r?\n\d{2}:\d{2}:\d{2},\d{3} --> \d{2}:\d{2}:\d{2},\d{3}\r?\n/g, '')
.replace(/\r?\n\r?\n/g, ' ');
fs.writeFileSync('output.txt', text.trim());
"
Version History
- 0983893 Current 2026-08-20 15:23


