subrato-ytmusic
v1.0.0
Published
A beautiful cross-platform CLI YouTube music player
Maintainers
Readme
🎵 YTMusic CLI
A beautiful cross-platform CLI YouTube music player with interactive controls.
✨ Features
- 🔍 Search YouTube - Search and play any song
- 📋 Queue Management - Add, remove, shuffle tracks
- 💾 Playlists - Save and load custom playlists
- 🎮 Interactive Controls - Beautiful CMD interface
- ⌨️ Keyboard Support - Full keyboard control
- 🎛️ Volume Control - Adjust playback volume
- 📜 Playback History - Track recently played songs
🎮 Controls
╔══════════════════════════════════════╗
║ 🎮 Controls ║
╚══════════════════════════════════════╝
▶ Play / Resume - Start or resume playback
⏸ Pause - Pause current track
⏭ Next Track - Skip to next track
⏮ Previous Track - Go to previous track
🔊 Volume - Adjust volume (0-100)
➕ Add to Queue - Add new track
📋 Show Queue - View all queued tracks
🔀 Shuffle Queue - Randomize queue order
🗑 Clear Queue - Remove all tracks
❌ Quit - Exit player🚀 Installation
Prerequisites
- Node.js 18+ - Download
- yt-dlp - YouTube downloader
- FFmpeg - Audio processing
Install Dependencies
Windows (using Chocolatey):
choco install nodejs yt-dlp ffmpegmacOS:
brew install node yt-dlp ffmpegLinux (Ubuntu/Debian):
sudo apt update
sudo apt install nodejs npm yt-dlp ffmpegInstall the App
# Clone or download the project
cd ytmusic-cli
# Install dependencies
npm install
# Link globally (optional)
npm link📖 Usage
Basic Commands
# Search and play a song
npm start -- play "Never Gonna Give You Up"
# Just search without playing
npm start -- search "Beatles"
# Show current queue
npm start -- queue
# Create a playlist
npm start -- playlist create Favorites
# View settings
npm start -- configInteractive Mode
# Start interactive player
npm start
# With keyboard controls
npm start -- play -k🌐 Deployment for Others
Option 1: Publish to npm (Recommended)
- Update package.json with your details:
{
"name": "ytmusic-cli",
"version": "1.0.0",
"description": "A beautiful CLI YouTube music player",
"main": "src/cli.js",
"bin": {
"ytmusic": "./src/cli.js"
}
}- Publish to npm:
npm login
npm publish- Others install via:
npm install -g ytmusic-cli
ytmusic play "song name"Option 2: Git Repository
- Push to GitHub:
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/username/ytmusic-cli.git
git push -u origin main- Others clone and use:
git clone https://github.com/username/ytmusic-cli.git
cd ytmusic-cli
npm install
npm start -- play "song"Option 3: Create Windows Executable
- Install pkg:
npm install -g pkg- Build executable:
npm install
pkg -t win32-x64 src/cli.js -o ytmusic.exe- Distribute ytmusic.exe with these files:
ytmusic.exe
package.json (for reference)
README.mdOption 4: Batch File Runner
Create start.bat:
@echo off
echo Installing YTMusic CLI...
npm install
echo.
echo Starting YTMusic CLI...
npm start -- play "%~1"📁 Project Structure
ytmusic-cli/
├── src/
│ ├── cli.js # Main CLI entry
│ ├── player/
│ │ └── Player.js # Audio playback engine
│ └── utils/
│ ├── youtube.js # YouTube API
│ ├── queue.js # Queue management
│ ├── playlist.js # Playlist management
│ ├── config.js # Settings
│ ├── ui.js # Beautiful UI
│ └── keyboard.js # Keyboard controls
├── data/ # Queue & playlist storage
├── package.json
└── README.md⚙️ Configuration
Config file: ~/.ytmusic-cli/config.json
{
"downloadPath": "~/Music/ytmusic-cli",
"audioQuality": "high",
"volume": 80,
"loop": false,
"shuffle": false
}🔧 Troubleshooting
"yt-dlp not found"
choco install yt-dlp"ffmpeg not found"
choco install ffmpegAudio not playing
- Check system volume
- Make sure speakers are connected
- Try running as administrator
📝 License
MIT License
🤝 Contributing
Pull requests welcome!
Made with ❤️ for music lovers
