@srtkit/cli
v0.2.0
Published
Command line interface for SRTKit - utilities for processing SRT subtitle files
Readme
Usage
# npm
npx @srtkit/cli
# pnpm
pnpm dlx @srtkit/cli
# bun
bunx @srtkit/cli
# deno
deno run -A npm:@srtkit/cliCommands
srtkit clean
srtkit 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.srtClean and overwrite original
srtkit clean input.srt --overwriteClean with custom output
srtkit clean input.srt -o output.srtRemove 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
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.srtIf filenames are same:
<filename>_merged.srt
Examples
Merge with custom output
srtkit merge english.srt chinese.srt -o bilingual.srtMerge with auto-generated output
srtkit merge english.srt chinese.srt
Options
--mode— Merge mode (currently only "simple" is supported) Required: No
srtkit split
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.srtSplit by even/odd indices
srtkit split bilingual.srt -a odd.srt -b even.srt --mode evenOdd
Options
--mode— Split mode (newline | evenOdd) Required: No
License
🤖 auto updated with automd
