Example of the terminal interface displaying status information and keyboard controls.
- Efficient downloads using the
yt-dlpbackend - High-quality audio extraction supporting 128kbps and 256kbps MP3 output
- URL extraction from clipboard text
- Asynchronous operations with real-time progress updates
- Terminal interface powered by
ratatui - Responsive layout that adapts to terminal size
- Real-time status updates with download progress and error handling
- Keyboard navigation with intuitive controls
- Focus management for consistent user experience
- Robust error handling - graceful failures that don't crash the interface
- Input sanitization - automatically cleans and validates pasted content
- Memory-safe operations with input length limits and cleanup
- Cross-platform support: macOS, Linux, Windows (via WSL)
- Zero external dependencies beyond yt-dlp and ffmpeg
- Automatic organization - downloads save directly to your Downloads folder
- Metadata embedding - includes thumbnails and track information
- Filename sanitization - handles special characters and long titles
- Duplicate detection - smart handling of existing files
cargo install dj-cligit clone https://github.com/henryoman/dj-cli.git
cd dj-cli
cargo build --release
cargo install --path .git clone https://github.com/henryoman/dj-cli.git
cd dj-cli
cargo run --release# Launch the interactive TUI
dj-cli
# Or download directly (non-interactive)
dj-cli "https://www.youtube.com/watch?v=dQw4w9WgXcQ"DJ-CLI requires Rust 1.78 or later. Install via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/envInstall the latest version of yt-dlp:
# macOS (Homebrew)
brew install yt-dlp
# Ubuntu/Debian
sudo apt update && sudo apt install yt-dlp
# Arch Linux
sudo pacman -S yt-dlp
# Or via pip (universal)
pip install yt-dlpRequired for audio extraction and format conversion:
# macOS (Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# Arch Linux
sudo pacman -S ffmpeg
# Windows (Chocolatey)
choco install ffmpegTest your setup:
yt-dlp --version
ffmpeg -version
cargo --version-
Launch DJ-CLI
dj-cli
-
Paste YouTube URL
- Simply paste any YouTube URL into the input field
- DJ-CLI automatically extracts and cleans the URL from messy clipboard content
-
Choose Quality & Download
- Enter for default 128kbps download
- Ctrl+1 for quick 128kbps download
- Ctrl+2 for quick 256kbps download
- Paste any text containing YouTube URLs - DJ-CLI extracts them automatically
- F5 to clean and extract URLs from current input
- Input validation prevents invalid URLs from processing
- Length limits protect against memory issues (500 chars max)
| Shortcut | Function |
|---|---|
| Ctrl+C | Quit application |
| Esc | Exit application |
| Enter | Download |
| Ctrl+1 | Quick 128kbps download |
| Ctrl+2 | Quick 256kbps download |
| F5 | Clean and extract URL from input |
| Delete | Clear input field |
| Backspace | Remove last character |
Files are automatically saved to your system's Downloads folder:
- macOS:
~/Downloads/ - Linux:
~/Downloads/ - Windows:
%USERPROFILE%\Downloads\
| Quality | Bitrate | Use Case |
|---|---|---|
| 128kbps | Standard quality | General listening, smaller files |
| 256kbps | High quality | Audiophile listening, DJ sets |
Downloaded files use the format: [Video Title].mp3
- Special characters are automatically sanitized
- Long titles are handled gracefully
- Metadata and thumbnails are embedded automatically
- Tokio - Async runtime for non-blocking operations
- Ratatui - Terminal UI framework with rich widgets
- Crossterm - Cross-platform terminal manipulation
- Color-eyre - Enhanced error reporting
- Tracing - Structured logging
- Regex - URL pattern matching
- Memory-efficient: Smart input limiting and cleanup
- CPU-light: Async operations prevent blocking
- Storage-aware: Downloads to standard user directories
- Network-optimized: Leverages yt-dlp's efficient downloading
- Memory safety through Rust's ownership system
- Error handling with graceful degradation
- Input validation and sanitization throughout
- Modular architecture for maintainability
# Ensure yt-dlp is installed and in PATH
which yt-dlp
# If not found, install via your package manager
brew install yt-dlp # macOS# Check if URL is accessible
yt-dlp --list-formats [YOUR_URL]
# Update yt-dlp to latest version
pip install -U yt-dlp# Check Downloads folder permissions
ls -la ~/Downloads/
# Create if missing
mkdir -p ~/Downloads/# Verify ffmpeg installation
ffmpeg -version
# Reinstall if needed
brew reinstall ffmpeg # macOSFor detailed error information:
# Enable verbose logging (modify source)
RUST_LOG=debug cargo run# Update DJ-CLI
cargo install dj-cli --force
# Update yt-dlp (important for YouTube compatibility)
pip install -U yt-dlp
# Update dependencies when building from source
cd dj-cli
cargo update- Minimum Rust version: 1.78.0
- Tested yt-dlp versions: 2023.12.30+
- Supported platforms: macOS 10.15+, Ubuntu 20.04+, Windows 10+ (WSL)
Contributions are welcome. To get started:
# Clone and setup development environment
git clone https://github.com/henryoman/dj-cli.git
cd dj-cli
cargo build
cargo test
# Install development tools
cargo install cargo-watch# Format code
cargo fmt
# Lint with Clippy
cargo clippy --all-targets --all-features -- -D warnings
# Run tests
cargo test- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with tests
- Ensure all checks pass:
cargo fmt && cargo clippy && cargo test - Commit with clear messages:
git commit -m 'Add amazing feature' - Push to your fork:
git push origin feature/amazing-feature - Open a Pull Request with detailed description
- UI/UX improvements
- Performance optimizations
- Additional audio formats (FLAC, AAC)
- Configuration file support
- Internationalization
- Documentation improvements
This project is licensed under the MIT License - see the LICENSE file for complete details.
MIT License
Copyright (c) 2024 Henryoman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...
- yt-dlp team - Powerful YouTube download engine
- Ratatui community - Excellent terminal UI framework
- Orhun Parmaksız - Maintainer of Ratatui and open source champion from Ankara, Turkey
- Rust community - Amazing language and ecosystem
- Language: Rust
- Lines of Code: ~850+
- Dependencies: 16 (carefully chosen)
- Binary Size: ~2MB (optimized)
- Performance: Downloads limited only by network speed
Built with Rust
Terminal-based YouTube audio downloads

