-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ChetanXpro/feat/autosub-cli
feat: add cli support
- Loading branch information
Showing
9 changed files
with
663 additions
and
790 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env node | ||
|
||
const { program } = require('commander') | ||
const { generate } = require('../dist') | ||
program.name('autosub').version('1.0.0').description('Auto-generate subtitles for videos.') | ||
|
||
program | ||
.command('generate') | ||
.description('Automatically generate subtitles for a video file') | ||
.option('-i, --input <videoPath>', 'Path to the input video file') | ||
.option('-o, --output <outputVideoPath>', 'Path to the output video file') | ||
.action(options => { | ||
const { input } = options | ||
const { output } = options | ||
|
||
if (!input) return console.log('Please provide a path to the input video file') | ||
|
||
generate(input, output) | ||
}) | ||
|
||
program.parse(process.argv) |
Oops, something went wrong.