How stefodev/cliflix-cache works
Project type and purpose
• CLIFlix is a command‐line interface (CLI) tool written in TypeScript/Node.js.
• Its purpose is to let users search for a torrent by name, stream it via WebTorrent, and launch it in a local media player (e.g., VLC, mpv), optionally fetching subtitles.
File structure
Top‐level files and folders
• package.json, tsconfig.json – Node/TypeScript config and dependencies
• src/bin/index.ts – CLI entry point (npm “bin” target)
• src/cli.ts – Argument parsing & command dispatch (wizard, “lucky”, manual)
• src/config.ts – Loads and validates ~/.cliflix.json, merges defaults
• src/index.ts – Core orchestrator: ties search, torrent, subtitles, player
• src/utils.ts – Shared helpers (e.g., path resolution, logging)
• src/temp.ts – Manages temporary download directory or cleanup
• resources/ – Contains assets like the wizard.gif for README
• .gitignore, .editorconfig, LICENSE, README.md, .todo
README for additional insights
• Describes three usage modes: interactive wizard, “I’m feeling lucky” (first result), and manual streaming with a magnet URI.
• Configuration sections show how the user can customize downloads path, torrent providers, subtitle languages, WebTorrent flags, and preferred output apps.
• Relies on external libraries: WebTorrent (torrent streaming), parse-torrent (magnet parsing), OpenSubtitles API (subtitle search), child_process (to launch media players).