CLI for SRT Kit — utilities for processing SRT (SubRip) subtitle files.
pnpx @srtkit/cli
# npm
npx @srtkit/cli
# pnpm
pnpm dlx @srtkit/cli
# bun
bunx @srtkit/cli
# deno
deno run -A npm:@srtkit/clisrtkit clean [-o,--output #0] <input>Clean and process SRT subtitle files
This command processes SRT files to clean and normalize them. It can remove SDH cues, speaker labels, music cues, and more.
If no output file is specified, the cleaned file will be saved with "_cleaned" suffix. Use --overwrite to replace the original file.
Examples
-
Clean with auto-generated output
srtkit clean input.srt
-
Clean and overwrite original
srtkit clean input.srt --overwrite
-
Clean with custom output
srtkit clean input.srt -o output.srt
-
Remove SDH and speaker labels
srtkit clean input.srt -o output.srt --remove-sdh --remove-speaker-labels
Options
-
--overwrite— Overwrite the original file Required: No -
--remove-sdh— Remove Subtitles for the Deaf and Hard of Hearing (SDH) cues Required: No -
--remove-speaker-labels— Remove speaker identification labels Required: No -
--remove-music-cues— Remove cues containing music notes (♪) Required: No -
--remove-line-breaks— Remove all line breaks within cues Required: No -
--merge-same-text— Merge consecutive cues with identical text Required: No -
--remove-trailing-period— Remove trailing period (。or.) at the end of cues Required: No -
--normalize-text-case— Change fully UPPERCASE cues to normal case Required: No
srtkit merge [-o,--output #0] <firstFile> <secondFile>Merge two subtitle files into a bilingual subtitle
This command merges two monolingual subtitle files into a single bilingual file. The text from both files will be combined with a newline separator.
If no output file is specified, the merged file will be saved in the same directory as the first file with an auto-generated name:
-
If filenames are different:
<file1>+<file2>_merged.srt -
If filenames are same:
<filename>_merged.srt
Examples
-
Merge with custom output
srtkit merge english.srt chinese.srt -o bilingual.srt
-
Merge with auto-generated output
srtkit merge english.srt chinese.srt
Options
--mode— Merge mode (currently only "simple" is supported) Required: No
srtkit split <input> [outputA] [outputB]Split a bilingual subtitle into two separate files
This command splits a bilingual subtitle file into two monolingual files. It can split by newlines or by even/odd index positions.
Examples
-
Split by newlines
srtkit split bilingual.srt -a first.srt -b second.srt
-
Split by even/odd indices
srtkit split bilingual.srt -a odd.srt -b even.srt --mode evenOdd
Options
--mode— Split mode (newline | evenOdd) Required: No
🤖 auto updated with automd