Musix
Musix - A minimalist terminal-based MP3 music player built with Rust.
Install / Use
/learn @coolcode/MusixREADME
MUSIX
A minimalist terminal-based MP3 music player built with Rust.
Features
- Beautiful TUI: Clean terminal interface with cyberpunk green theme
- High-Quality Playback: MP3 audio support with crystal-clear sound
- Visual Progress: Real-time progress bar with time display
- Smart Controls: Intuitive keyboard controls with popup help
- Smooth Seeking: Instant seek without playback interruption
- Playback Modes: Normal sequential and random shuffle
- Keyboard-Driven: Lightning-fast keyboard-only interface
- Fuzzy Search: Real-time search with
/key - find songs instantly - Vim-Style Navigation: Full vim keybinding support (hjkl, gg/G, n/N, q)
Quick Start
Prerequisites
- Rust 1.70+ - Install Rust
- Audio Libraries (Linux):
libasound2-dev pkg-config
Installation
# Clone the repository
git clone git@github.com:coolcode/musix.git
cd musix
# Build and run
cargo run
# Or build optimized release version
cargo build --release
./target/release/musix
Quick Usage
- Start the player:
cargo run - Navigate: Use
j/kor arrow keys to browse songs - Search: Press
/and type to find songs instantly - Play: Press
EnterorSpaceto play selected song - Jump: Use
gg(first song) orG(last song) - Help: Press
xto see all controls - Quit: Press
qorEscto exit
Setup Music Files
MUSIX automatically searches for MP3 files in these directories:
~/Music- Your system's Music directory./data- Local data folder
# Option 1: Use local data folder
mkdir -p ./data
cp /path/to/your/music/*.mp3 ./data/
# Option 2: Use system Music directory
cp /path/to/your/music/*.mp3 ~/Music/
# Option 3: Create symbolic link
ln -s /path/to/your/music ./data
Controls
Tip: Press x anytime to view the interactive controls popup!
Essential Keys
| Key | Action |
|-----|--------|
| Space/↵ | Smart Play - Play selected song or pause current |
| / | Search Mode - Enter fuzzy search |
| x | Show/Hide help popup |
| q/Esc | Exit |
Navigation & Playback
| Key | Action |
|-----|--------|
| ↑/↓ or j/k | Navigate songs (vim-style) |
| Space/↵ | Play/pause (same functionality) |
| ←/→ or h/l | Play previous/next song |
| gg / G | Jump to first/last song |
| , / . | Seek backward/forward 5 seconds |
| < / > | Same as above |
| r | Toggle Random mode |
Search Mode
| Key | Action |
|-----|--------|
| / | Enter search mode |
| n / N | Navigate to next/previous search result |
| ↑/↓ or j/k | Navigate through filtered results |
| Enter | Play selected song and exit search |
| Esc | Exit search mode |
| Backspace | Delete characters from search query |
| Any text | Type to search (fuzzy matching) |
Interface
MUSIX features a clean, 4-panel interface that maximizes space for your music:
┌─────────────────────────────────┐
│ MUSIX │ ← Title Bar
├─────────────────────────────────┤
│ Songs - Search: rock │ ← Song List (Search Mode)
│ → ♪ 1. Rock Song │ or "Songs" (Normal Mode)
│ 5. Another Rock Song │ (Scrollable, Filtered)
│ 12. Rock Ballad │
│ More filtered results... │
├─────────────────────────────────┤
│ ████████████████░░░░ 02:30/04:15│ ← Progress Bar
├─────────────────────────────────┤
│ Search Mode | Songs: 15/120 |.. │ ← Status & Search Info
└─────────────────────────────────┘
Interactive Controls Popup (Press x)
┌─────────────────────────────────┐
│ CONTROLS │
│ │
│ ↑/↓ or j/k - Navigate songs │
│ Space/↵ - Play/Pause │
│ ←/→ or h/l - Play prev/next song│
│ gg/G - Jump to first/last │
│ / - Enter search mode │
│ n/N - Next/prev search │
│ ,/. - Seek ±5 seconds │
│ r - Toggle random mode │
│ q/Esc - Exit application │
│ x - Close this popup │
└─────────────────────────────────┘
Smart Features
Fuzzy Search
- Instant Search: Press
/to enter search mode - Real-time Filtering: Results update as you type
- Fuzzy Matching: Finds songs even with partial or misspelled text
- Smart Scoring: Prioritizes exact matches → substring matches → fuzzy matches
- Search Navigation: Use
n/Nto quickly jump between results - Quick Play: Press Enter on any result to play immediately
Example: Searching "btl" will match "Battle Song", "Beautiful", "Subtitle"
Visual Indicators
→Currently selected song in the list♪Currently playing song indicator- Progress Bar Real-time playback progress with time
- Search Title Shows current search query in song list header
- Result Count Displays filtered results count (e.g., "15/120 songs")
Playback Modes
- Normal Mode: Sequential playback through your playlist
- Random Mode: Intelligent shuffle (excludes current song)
Smart Space/Enter Key
- Initial state: Plays the first selected song
- Different song selected: Plays the selected song immediately
- Same song selected: Toggles play/pause for current song
Vim-Style Navigation
- Movement:
hjklfor navigation (h=left, j=down, k=up, l=right) - Jumping:
ggjumps to first song,Gjumps to last song - Search Navigation:
n/Nfor next/previous search results - Quit:
qas alternative to Escape
Technical Details
Architecture
- Player Engine: State management with smart playback control
- Terminal UI: Ratatui-powered responsive interface
- Audio Engine: Rodio-based high-quality MP3 processing
- Performance: Efficient seeking without playback interruption
Core Dependencies
rodio- Professional audio playback and MP3 decodingratatui- Modern terminal user interface frameworkcrossterm- Cross-platform terminal controlrand- Cryptographically secure random shuffle
Development
Project Structure
musix/
├── src/
│ └── main.rs # Complete application (~700 lines)
├── data/ # MP3 files (optional)
├── .github/workflows/ # CI/CD automation
├── Cargo.toml # Dependencies and metadata
├── rustfmt.toml # Code formatting rules
└── README.md # Documentation
Building & Testing
# Development build
cargo build
# Optimized release build
cargo build --release
# Run all tests
cargo test
# Code quality checks
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --check
Troubleshooting
No Music Files Found
Issue: No MP3 files found in any accessible directory
Solutions:
# Option 1: Copy files to data folder
mkdir -p ./data
cp /path/to/your/music/*.mp3 ./data/
# Option 2: Create symbolic link
ln -s /path/to/your/music ./data
# Option 3: Check permissions
ls -la ~/Music
macOS Music Access
Issue: Cannot access ~/Music directory on macOS
Solution: Enable Full Disk Access for your terminal:
- System Settings → Privacy & Security → Full Disk Access
- Click lock icon to unlock settings
- Click + and add your terminal app (Terminal/iTerm2)
- Enable the checkbox
- Restart your terminal
Linux Audio Issues
Issue: No audio output or initialization errors
Solutions:
# Install required audio libraries
sudo apt-get update
sudo apt-get install libasound2-dev pkg-config
# For other distributions
sudo pacman -S alsa-lib pkg-config # Arch
sudo dnf install alsa-lib-devel pkgconf # Fedora
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Acknowledgments
- Rodio team for excellent Rust audio library
- Ratatui team for powerful TUI framework
- Rust community for amazing ecosystem
Built with Claud Code
Related Skills
node-connect
334.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
334.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.1kCommit, push, and open a PR
