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

tafrigh-cli

v1.4.3

Published

CLI for using the tafrigh library.

Readme

tafrigh-cli

wakatime codecov Node.js CI GitHub License GitHub Release typescript

tafrigh-cli is a Bun-powered command-line interface for the tafrigh transcription engine. It orchestrates downloading media, chunking audio, performing speech-to-text and formatting transcripts for rapid review.

The CLI is composed of small utilities documented with JSDoc and individually tested so that media discovery, option parsing and configuration persistence remain easy to maintain. The sections below highlight the most frequently used modules when extending the tool.

Feature highlights

  • 🎯 Broad input support – Local files & folders, YouTube videos/playlists, Facebook and X (Twitter) URLs.
  • 🪄 Automatic media discovery – Fetches the best downloadable sources for supported platforms via yt-dlp.
  • ⚙️ Configurable processing – Control chunk duration and concurrency for tafrigh workloads.
  • 🔑 Persistent wit.ai credentials – Securely stores API keys per language via conf.
  • 📄 Structured transcripts – Produces timestamped, filler-aware transcripts ready for editors.
  • 🪵 Rich logging – Uses pino + pino-pretty for actionable CLI feedback.

Key modules

| Location | Purpose | | --- | --- | | src/index.ts | CLI entrypoint that wires meow options to tafrigh execution. | | src/utils/mediaUtils.ts | Detects supported URLs, crawls playlists and discovers download targets using yt-dlp. | | src/utils/optionsMapping.ts | Normalizes CLI flags into tafrigh-friendly option objects. | | src/utils/config.ts | Persists per-language wit.ai credentials using conf. | | src/utils/io.ts | File system helpers for globbing media, verifying paths and ensuring output folders exist. | | src/utils/prompt.ts | Simplified prompt helpers for collecting credentials interactively. |

Requirements

  • Bun 1.3.2 or later
  • Node.js 22.0.0 or later (for compatibility)
  • Python 3.7+ available as python3 in your system PATH (required by yt-dlp)

The CLI uses youtube-dl-exec which wraps yt-dlp for YouTube downloads. The yt-dlp binary is auto-installed during bun install, but you can also use a global installation.

Installation

Install dependencies with Bun:

bun install

To run the CLI without installing globally, use bunx:

bunx tafrigh-cli --help

Usage

bunx tafrigh-cli [options] <inputs...>

Common options

| Flag | Alias | Description | | --- | --- | --- | | --chunk-duration | -d | Split audio into fixed-size segments (seconds). Default: 300. | | --concurrency | -c | Number of tafrigh worker threads. | | --keys | -k | wit.ai API keys. Repeat flag for multiple keys. Persisted per language. | | --language | -l | Namespace API keys for a locale. Default: global. | | --output | -o | Output file (single input) or directory (multiple inputs). |

Supported inputs

  • Absolute/relative paths to media files.
  • Directories containing audio/video files.
  • YouTube video links or playlists.
  • Facebook video URLs.
  • X (Twitter) video URLs.

Examples

Transcribe a local video and open the output automatically:

bunx tafrigh-cli "./video.mp4" --output "./transcript.txt" --keys "ABC" --keys "DEF"

Process an entire playlist using Arabic-specific keys:

bunx tafrigh-cli "https://www.youtube.com/playlist?list=abcd" \
  --output "./transcripts" \
  --language ar \
  --keys "XYZ"

Reuse stored keys for multiple mixed sources:

bunx tafrigh-cli \
  "https://www.facebook.com/watch/?v=1234" \
  "https://www.youtube.com/watch?v=5678" \
  "https://x.com/user/status/9012" \
  --output "./batch-output"

Development workflow

| Command | Description | | --- | --- | | bun run build | Bundles the CLI through tsdown using tsdown.config.ts. | | bun test | Runs the Bun test suite (bun:test). | | bun run lint | Lints the project with Biome. | | bun run format | Formats sources with Biome. |

The bundler configuration lives in tsdown.config.ts and is consumed directly by tsdown. Unit tests live beside their helpers as src/**/*.test.ts files so behaviour is verified right next to the implementation.

Logging

The CLI emits structured logs describing preprocessing, transcription progress and output destinations. Adjust LOG_LEVEL to change verbosity.

Migration Notes

v1.4.3+: Migrated from @distube/ytdl-core and @distube/ytpl to youtube-dl-exec for improved reliability and active maintenance. This requires Python 3.7+ for yt-dlp to function.

License

MIT © Ragaeeb Haq