@viyuni/vidkit
v0.0.4
Published
AI video toolkit CLI for TTS and frame analysis.
Downloads
761
Readme
Vidkit
AI video helper CLI for text-to-speech audio generation and video frame sheet previews.
Install
Install Vidkit in a project:
pnpm add -D @viyuni/vidkitOr run it directly:
pnpm exec vidkit --help
npx vidkit --helpText To Speech
Generate one audio file:
pnpm exec vidkit tts "hello" -o hello.mp3Choose a provider, model, and voice:
pnpm exec vidkit tts "hello" --provider openai --model tts-1 --voice alloy -o hello.mp3
pnpm exec vidkit tts "hello" --provider minimax --model speech-02-hd --voice male-qn-qingse -o hello.mp3You can also use the provider/model shorthand:
pnpm exec vidkit tts "hello" --model openai/tts-1 --voice alloy -o hello.mp3
pnpm exec vidkit tts "hello" --model minimax/speech-02-hd --voice male-qn-qingse -o hello.mp3Configuration can come from flags or environment variables:
TTS_PROVIDER=openai
TTS_MODEL=tts-1
TTS_VOICE=alloy
TTS_API_KEY=sk-...
TTS_API_BASE_URL=https://api.openai.com/v1Load the TTS variables from an environment file with the TTS-only --env-file option. Relative paths are resolved from the current working directory, and existing environment variables take precedence over values from the file.
pnpm exec vidkit tts "hello" -o hello.mp3 --env-file .env
pnpm exec vidkit tts --json ./script.json -o ./audios --env-file ./config/tts.envBatch TTS
Render multiple audio files from JSON:
pnpm exec vidkit tts --json ./script.json -o ./audiosSupported JSON input:
[
"First narration line.",
{
"name": "intro.mp3",
"display": "Intro",
"tts": "Second narration line."
}
]String items are written as speech-001.mp3, speech-002.mp3, and so on. Object items require tts; name controls the output file name.
Frame Sheets
Vidkit uses ffmpeg to extract and stitch video frames. Make sure ffmpeg is installed and available on PATH, or pass --ffmpeg.
Generate a preview sheet:
pnpm exec vidkit sheet input.mp4 -o preview.jpgCapture interval frames:
pnpm exec vidkit sheet input.mp4 --start 00:01:30 --every 5 --limit 12 --cols 4 --width 320 -o preview.jpgCapture exact timestamps:
pnpm exec vidkit sheet input.mp4 --start 00:10:00 --at 0,10,20 -o preview.jpgUse --accurate for slower but more precise seeking.
Codex Skill
This repository also ships a Codex skill for adding Vidkit workflows to other projects:
skills/vidkitInstall it with a skill installer that supports GitHub paths:
npx skills add https://github.com/viyuni/vidkit/tree/main/skills/vidkitIf your installer uses owner/repo path syntax:
npx skills add github:viyuni/vidkit/skills/vidkitManual fallback:
target-project/
.codex/
skills/
vidkit/
SKILL.mdThen ask Codex in the target project:
Use $vidkit to add TTS and frame-sheet workflows to this project.Development
Install dependencies:
vp installRun checks and tests:
vp check
vp testBuild the package:
vp pack