ytsearch-cli — YouTube Search Command-Line Tool
Overview
ytsearch-cli is the command-line version of ytsearch.js, offering developers and power users the ability to search YouTube directly from their terminal. It supports videos, channels, playlists, video details, and playlist videos, with multiple display modes and an interactive search mode for a smooth terminal experience.
Published to the npm registry, ytsearch-cli is a globally installable package designed for speed, usability, and flexibility.
Features
- 🔍 Search YouTube videos, channels, and playlists directly from terminal.
- 📜 Fetch video details & playlist videos with one command.
- 🎛 Multiple display modes — default, compact, online, detailed.
- 🖥️ Interactive Mode (
--watch) with arrow key navigation. - ⚡ Lightweight & Fast — powered by
ytsearch.js. - 🎨 Styled output with tables, colors, and banners.
- 📦 Easy installation:
npm install -g ytsearch-cli. - 🔔 Update notifier — informs users of new versions.
Installation
npm install -g ytsearch-cli
Run help menu:
ytsearch --help
Usage
Video Search
ytsearch video "never gonna give you up"
Channel Search
ytsearch channel "RickAstleyVEVO"
Playlist Search
ytsearch playlist "Top Hits 2025"
Video Details
ytsearch details <videoId>
Playlist Videos
ytsearch playlist-videos <playlistId>
Search All Types
ytsearch search "lofi hip hop"
Options
-l, --limit <n>→ Number of results (default:10)-s, --sort <type>→relevance,upload_date,view_count,rating-m, --mode <type>→default,compact,online,detailed-j, --json→ Output raw JSON-w, --watch→ Interactive mode
Example:
ytsearch video "javascript tutorial" -l 5 -m compact
Display Modes
- default → Rich tables with video/channel/playlist info.
- compact → Minimal quick view.
- online → Clickable links in supported terminals.
- detailed → Full metadata (title, views, published date, duration, etc.).
Interactive Mode
Run:
ytsearch --watch
Features:
- 🔄 Continuous search without rerunning commands.
- ⌨️ Arrow key navigation.
- ⚙️ Live update of settings (limit, sort, mode).
- 🎬 Quick preview of video/channel info.
Example Output
ytsearch video "Black Panther" -l 3 -m compact
1. Marvel Studios Black Panther - Official Trailer | 50.5M views
2. Wakanda Battle - I’m Not Dead Scene - Black Panther Returns | 19.9M views
3. Hiding in the Shadows | The Real Black Panther | 4.2M views
Tech Stack
- ytsearch.js — Core YouTube scraping/search library.
- commander — CLI framework for commands & options.
- inquirer — Interactive prompts.
- chalk — Colors and terminal styling.
- figlet — ASCII banners.
- cli-table3 — Structured tables in terminal.
- ora — Loading spinners.
- update-notifier — Auto version check.
Status
✅ Completed (September 30, 2025) 🛠️ Maintained with regular updates for features and bug fixes.
Links
- 📦 NPM Package: npmjs.com/package/ytsearch-cli
- 💻 GitHub Repository: github.com/RJRYT/ytsearch-cli
Related Projects
Discover more projects with similar technologies or categories.
Minecraft Cat Adventure: Infinite Falling (2D)
A real-time Phaser + Matter.js survival game where live YouTube chat and keyboard commands directly control gameplay through a resilient command queue and cooldown system.
ZUA Dashboard - Discord Bot Dashboard (MERN)
A modern MERN-based Discord management dashboard for the ZUA bot, with applications, tickets, moderation tools, analytics, and webhook integrations.
E2EE Chat — End-to-End Encrypted Chat App
A secure real-time MERN chat app with true end-to-end encryption using client-side RSA-OAEP, built as a personal project.
