Skip to content

Commit

Permalink
feat: add cli support
Browse files Browse the repository at this point in the history
  • Loading branch information
ChetanXpro committed Feb 16, 2024
1 parent 440c2e0 commit 61a89fb
Show file tree
Hide file tree
Showing 9 changed files with 663 additions and 790 deletions.
21 changes: 21 additions & 0 deletions bin/index.js
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)
Loading

0 comments on commit 61a89fb

Please sign in to comment.