TuMusic
A small program written in Go that lets you play music from the command line. It uses FFmpeg to play audio and was built using an ELM architecture.
Project README
🎵 TuMusic
A lightweight terminal music player for YouTube songs, built with Go.
Features
- Search and download songs
- Play songs directly from the terminal
- Pause and resume playback
Dependencies
- Go 1.21+
- ffmpeg - Audio processing and conversion
- Bubbletea - Terminal UI framework
- Beep - Audio playback
- kkdai/youtube - Video downloader
Configuration
YouTube Data API v3
TuMusic uses the YouTube Data API to search for songs. You need to create an API key:
- Go to Google Cloud Console
- Create a new project
- Enable YouTube Data API v3
- Create credentials → API Key
- Create a
.envfile in the root of the project:
YOUTUBE_API_KEY = your_api_key_here
Installation
1. Install ffmpeg
Windows:
winget install ffmpeg
Linux:
sudo apt install ffmpeg
Mac:
brew install ffmpeg
2. Clone and run
git clone https://github.com/nestorgonate/tumusic.git
cd tumusic
go run .
Or build the binary:
go build -o tumusic.exe .
./tumusic.exe
Usage
- Select Add song to search and download a song
- Select Play songs to browse your downloaded songs
- Use arrow keys to navigate and
Enterto select - Use Pause/Resume or Stop to control playback
- Press
Escto go back,Ctrl+Cto exit
License
MIT