npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@illyism/transcribe

v4.0.0

Published

CLI tool to transcribe audio/video files to SRT format using OpenAI Whisper API

Readme

@illyism/transcribe

npm version npm downloads skills.sh License: MIT

Transcribe audio/video files to SRT subtitles in one command. Optimized for large files, long movies, and video editing workflows.

Quick Start

# 1. Try it instantly (no install needed)
npx @illyism/transcribe video.mp4

# 2. Set your OpenAI API key (one-time setup)
export OPENAI_API_KEY=sk-...

# 3. Transcribe anything
npx @illyism/transcribe video.mp4
npx @illyism/transcribe https://www.youtube.com/watch?v=VIDEO_ID

That's it! Get your free API key here and start transcribing.


Why Use This Instead of Whisper CLI?

While OpenAI's Whisper has multiple ways to use it, this tool provides a simpler, more convenient experience:

| Feature | @illyism/transcribe | Official Whisper CLI | Local Whisper (whisper.cpp) | |---------|---------------------|---------------------|----------------------------| | Setup | Zero setup with npx/bunx | Install Python package | Download models (~1-5GB) | | Video Support | ✅ Automatic with FFmpeg | ❌ Audio only | ❌ Audio only | | YouTube Support | ✅ Built-in | ❌ Manual download | ❌ Manual download | | SRT Output | ✅ Built-in | ❌ Manual formatting | ✅ Available | | Processing | ☁️ Cloud (fast) | ☁️ Cloud (fast) | 💻 Local (slower) | | Cost | $0.006/min | $0.006/min | Free (after setup) | | Internet Required | ✅ Yes | ✅ Yes | ❌ No | | Best For | Quick tasks, videos, YouTube | API integration | Privacy, offline use |

Key Advantages

  • 🎬 Handles videos directly - No need to manually extract audio
  • 🎥 YouTube support - Transcribe YouTube videos with just the URL
  • 📝 SRT format ready - Generates subtitles automatically
  • 🚀 Zero installation - Just run npx @illyism/transcribe video.mp4
  • 🔧 Simple config - One-time API key setup
  • 🌐 Cross-platform - Works on macOS, Linux, Windows

Perfect for: Content creators, podcasters, and developers who need quick, accurate transcriptions with minimal setup.

Real-World Use Case

Got a 30-60 minute video that's 2-4GB? Other tools like Descript upload the entire video file, which takes forever and costs more.

This tool:

  1. 🎬 Extracts only the audio locally (takes seconds with FFmpeg)
  2. ☁️ Uploads only ~20-40MB of audio to Whisper
  3. 📝 Generates SRT subtitles

Result: 10-100x faster than uploading multi-GB video files. Same quality, fraction of the time and bandwidth.

Features

  • 🎬 Video & Audio Support: Works with MP4, MP3, WAV, M4A, WebM, OGG, MOV, AVI, and MKV
  • 🎥 YouTube & Social Video: Download and transcribe YouTube, Instagram Reels, and X/Twitter videos directly
  • 🎯 High Accuracy: Powered by OpenAI's Whisper API + optional 2-Pass AI Autofix (--autofix)
  • 👥 Speaker Diarization: Automatically labels speaker turns ([Speaker 1]: ..., [Speaker 2]: ...)
  • 📝 SRT Format: Generates standard SRT subtitle files with frame-accurate timestamps
  • 🎞️ Long Movies: Automatic chunking for feature-length content (45+ minutes), transcribed in parallel
  • 🎬 Editor-Friendly: Timecode offset, custom output paths, chunk size control
  • 🌐 OpenAI-Compatible Gateways: Connect to OpenRouter, LiteLLM, Groq, or self-hosted models
  • 🔧 Simple Setup: Easy configuration via environment variable or config file

Installation & Setup

🍏 macOS & Automation Integrations

Make transcribing effortless on macOS with right-click Quick Actions, Apple Shortcuts, Raycast, or Drop Zone folders:

Install the native Finder Quick Action in one second:

npx @illyism/transcribe --install-mac-action

Usage: Right-click any video or audio file in Finder → Quick Actions → Transcribe Subtitles. Runs in the background and sends a Mac System Notification when the .srt is ready next to your media file.

  1. Open Shortcuts.app on Mac → Create a new Shortcut.
  2. Enable Use as Quick Action in shortcut settings.
  3. Add action: Run Shell Script (/bin/zsh):
    export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
    npx @illyism/transcribe "$1"
  4. Pin it to your Mac Menu Bar or assign a global keyboard shortcut (e.g. Cmd + Opt + T) to transcribe selected files or copied URLs!

Create a Raycast Script Command (transcribe.sh):

#!/bin/bash
# @raycast.schemaVersion 1
# @raycast.title Transcribe File or URL
# @raycast.mode compact
# @raycast.argument1 { "type": "text", "placeholder": "File path or YouTube/Reel URL" }

export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
npx @illyism/transcribe "$1"

Trigger with Cmd + Space → Transcribe → paste any URL or file path!

  1. Create a folder on your Desktop: ~/Desktop/Transcribe Drop Zone
  2. Open Automator.app → New Document → Folder Action → choose ~/Desktop/Transcribe Drop Zone.
  3. Add action: Run Shell Script:
    export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
    for f in "$@"; do
      npx @illyism/transcribe "$f"
    done

Whenever you drop video or audio files into ~/Desktop/Transcribe Drop Zone, subtitles are generated automatically in the background.

Agent Skills (skills.sh)

Install AI agent skills directly via skills.sh:

npx skills add Illyism/transcribe-cli

Includes transcribe, summarize-transcript, video-to-social, youtube-chapters, and format-converter. See skills/ for details.

Option 1: Use Instantly (No Install)

npx @illyism/transcribe video.mp4

Option 2: Install Globally

npm install -g @illyism/transcribe
# or: bun install -g @illyism/transcribe

Prerequisites

# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt-get install ffmpeg

# Windows
choco install ffmpeg
# macOS
brew install yt-dlp

# Ubuntu/Debian
sudo apt install yt-dlp

# Windows
winget install yt-dlp

# Or with pip
pip install yt-dlp
  1. Go to platform.openai.com/api-keys
  2. Create a new API key
  3. Copy it and set it up below ⬇️

API Key Setup (30 seconds)

One-time setup - Choose your preferred method:

Method 1: Config File (Recommended)

mkdir -p ~/.transcribe && echo '{"apiKey": "sk-YOUR_KEY"}' > ~/.transcribe/config.json

Dual-Key Supercharging (Auto-Mixing): If you have both keys, you can add them to ~/.transcribe/config.json:

{
  "openaiApiKey": "sk-...",
  "openrouterApiKey": "sk-or-..."
}

@illyism/transcribe will automatically route Pass 1 through Whisper-1 (for frame-accurate timestamps) and Pass 2 through Gemini 3.7 Flash (for deep context jargon fixing and multi-speaker diarization)!

Method 2: Environment Variables

# Standard OpenAI
export OPENAI_API_KEY=sk-YOUR_KEY

# Or use OpenRouter / OpenAI-compatible gateways (LiteLLM, vLLM, Deepgram)
export OPENROUTER_API_KEY=sk-or-YOUR_KEY
export OPENAI_BASE_URL=https://openrouter.ai/api/v1
export TRANSCRIBE_MODEL=google/gemini-2.5-flash

# Or export BOTH for the best hybrid pipeline:
export OPENAI_API_KEY=sk-YOUR_OPENAI_KEY
export OPENROUTER_API_KEY=sk-or-YOUR_OPENROUTER_KEY

Don't have a key? Get an OpenAI key or OpenRouter key.

Usage Examples

# Local video file
transcribe video.mp4

# 2-Pass Hybrid Pipeline: Frame-perfect Whisper timestamps + automatic AI cleanup & speaker diarization
# Works with your single OPENAI_API_KEY (uses gpt-5.6-luna) or OPENROUTER_API_KEY (uses gemini-3.7-flash)
transcribe podcast.mp3 --autofix

# Optionally specify a custom model for autofix
transcribe podcast.mp3 --autofix google/gemini-3.7-flash
transcribe podcast.mp3 --autofix gpt-5.6-luna

# Disable automatic speaker labels
transcribe podcast.mp3 --autofix --no-diarize

# Custom model and endpoint (e.g. OpenRouter, LiteLLM, Groq)
transcribe video.mp4 --model google/gemini-2.5-flash --base-url https://openrouter.ai/api/v1
transcribe video.mp4 --model whisper-large-v3 --base-url https://api.groq.com/openai/v1

# YouTube video
transcribe https://www.youtube.com/watch?v=VIDEO_ID

# Instagram Reel (uses your browser login cookies automatically)
transcribe https://www.instagram.com/reel/SHORTCODE/
transcribe https://www.instagram.com/reel/SHORTCODE/ --cookies-from-browser chrome

# Audio file
transcribe podcast.mp3

# Disable optimization (use original audio)
transcribe video.mp4 --raw

Outputs: Creates video.srt in the same directory.

Editor-Friendly Features

Perfect for video editing workflows:

# Custom output path (file or directory)
transcribe movie.mkv --output ./subtitles
transcribe movie.mkv --output ./subtitles/movie.srt

# Timecode offset (for editorial timelines)
transcribe movie.mkv --offset 01:00:00.000  # Start at 1 hour
transcribe movie.mkv --offset 3600         # Same, in seconds

# Force chunking for very long movies
transcribe long_movie.mkv --chunk-minutes 15

Why chunking? Movies 45+ minutes are automatically split into ~20-minute chunks for reliability. Chunks are transcribed in parallel with up to 8 concurrent requests, then merged seamlessly with correct timestamps.

What Happens Automatically

By default, the tool optimizes large video and audio files:

2.7GB video → Extract speech audio (mono, 16kHz) → Auto-chunk if >45min → Transcribe chunks in parallel → Merge & adjust timestamps

For long media (45+ minutes):

  • Automatically splits into ~20-minute chunks
  • Transcribes chunks in parallel with up to 8 concurrent requests
  • Merges results with frame-accurate timestamps
  • Handles 2+ hour movies reliably

2-Pass Hybrid Pipeline (--autofix):

  • Pass 1: Whisper-1 generates frame-accurate subtitle timing anchors.
  • Pass 2: Multimodal AI (Gemini Flash) fixes domain jargon, acronyms, and names, and adds speaker labels ([Speaker 1], [Speaker 2]).

Result:

  • ⚡ 99.5% smaller uploads (2.7GB → ~20MB audio)
  • 🚀 10-100x faster than uploading full video
  • 🎯 Frame-accurate timecode synchronization
  • 💰 Low cost ($0.006/min)

Use as a Library

npm install @illyism/transcribe
import { transcribe } from '@illyism/transcribe'

const result = await transcribe({
  inputPath: 'video.mp4',
  apiKey: process.env.OPENAI_API_KEY,
  optimize: true // default, set false to disable
})

console.log(result.srtPath)  // Path to generated SRT file
console.log(result.text)     // Full transcription text
interface TranscribeOptions {
  inputPath: string        // Path to video/audio file
  apiKey?: string         // OpenAI / OpenRouter API key (or use env var)
  baseURL?: string        // Custom base URL for OpenAI-compatible endpoints
  model?: string          // Model name (default: "whisper-1")
  outputPath?: string     // Custom output path (optional)
  optimize?: boolean      // Enable optimization (default: true)
  offsetSeconds?: number  // Shift timestamps by N seconds
  chunkMinutes?: number   // Chunk size in minutes (default: 20)
}

interface TranscribeResult {
  srtPath: string         // Path to generated SRT file
  text: string           // Full transcription text
  language: string       // Detected language
  duration: number       // Duration in seconds
}

Details

  • Video: MP4, WebM, MOV, AVI, MKV
  • Audio: MP3, WAV, M4A, OGG, Opus
  • YouTube: All videos, Shorts, youtu.be links
  • Instagram: Reels, posts, and IGTV (requires a logged-in browser for cookies)

OpenAI Whisper API: $0.006 per minute

Examples:

  • 5 min: $0.03
  • 30 min: $0.18
  • 2 hours: $0.72
  1. Extract audio from video (mono, 16kHz - speech optimized)
  2. Auto-chunk if >45 minutes (for parallel processing and reliability)
  3. Upload chunks to Whisper API (or OpenAI-compatible gateway)
  4. Generate SRT subtitles with frame-accurate timestamps
  5. Optional 2-pass AI Autofix (--autofix): Corrects domain jargon & adds speaker diarization
  6. Merge chunks and apply timecode offsets (if specified)
  7. Clean up temporary files
1
00:00:00,000 --> 00:00:03,420
Hey and thank you for getting the SEO roast.

2
00:00:03,420 --> 00:00:06,840
I'll take a look at your website and see what things we can improve.

Troubleshooting

Set up your API key using one of the methods in API Key Setup.

Install FFmpeg:

brew install ffmpeg  # macOS
sudo apt install ffmpeg  # Ubuntu
choco install ffmpeg  # Windows

Install yt-dlp:

brew install yt-dlp  # macOS
sudo apt install yt-dlp  # Ubuntu
pip install yt-dlp  # Any platform

Use absolute paths:

transcribe /full/path/to/video.mp4

OpenAI API may be temporarily down. Wait 30 seconds and try again.

If you're using Bun runtime, switch to Node.js:

# Use Node.js instead of Bun
node dist/cli.js video.mp4

# Or install globally and use the transcribe command
npm install -g @illyism/transcribe
transcribe video.mp4

The CLI works best with Node.js 18+ due to OpenAI SDK compatibility.


Links

Contributing

Pull requests welcome! See GitHub repo.

License

MIT © Ilias Ismanalijev