Yarr
A Terminal User Interface (TUI) for managing Sonarr, built as a Rust workspace with separate API client library.
> ✨ Note: This project was fully vibe coded with AI assistance, showcasing modern development workflows and comprehensive feature implementation.
Project Structure
This workspace contains two crates:
yarr-api- A standalone Rust library for interacting with the Sonarr APIyarr-cli- The main TUI application that uses the API library
Features
- View system status and health
- Browse series and episodes
- Monitor download queue
- View download history
- Search for new series and download releases - Interactive search with release selection and download
- Interactive TUI interface with vim-like keybind support
- Configurable UI preferences and keybind modes
- In-app configuration editing for Sonarr connection and UI settings
- Configurable via config files, environment variables, or CLI arguments
Installation
Install the TUI Application
cargo install --path yarr-cli
Use the API Library
Add to your Cargo.toml:
[dependencies]
yarr-api = { path = "yarr-api" }
Configuration
Yarr supports multiple configuration methods with the following priority order (highest to lowest):
- Command line arguments
- Environment variables
- Configuration file
- Default values
Configuration File
Create a configuration file in one of these locations:
./yarr.toml(current directory)~/.config/yarr/config.toml(user config directory)
Example configuration:
[sonarr]
url = "http://localhost:8989"
api_key = "your-api-key-here"
[ui]
# Keybind mode: "Normal" or "Vim"
keybind_mode = "Normal"
# Show help text in footer
show_help = true
Environment Variables
Set these environment variables:
export YARR_SONARR_URL="http://localhost:8989"
export YARR_SONARR_API_KEY="your-api-key-here"
export YARR_UI_KEYBIND_MODE="Vim"
export YARR_UI_SHOW_HELP="true"
Command Line Arguments
yarr --sonarr-url="http://localhost:8989" --sonarr-api-key="your-api-key"
Usage
TUI Mode (Default)
Launch the interactive TUI:
yarr
# or explicitly
yarr tui
Search and Download Functionality
The Search tab provides powerful functionality for finding and downloading new series:
- Search for Series: Press
/to enter search mode, type a series name, and press Enter - View Releases: Navigate to a search result and press Enter to view available releases
- Download: In the releases popup, select a release and press Enter to download it
Release Information Display:
- Status indicators: ✅ Available, ❌ Rejected, ⛔ Not Allowed
- File size, quality rating, indexer name
- Seeders/peers count for torrent releases
- Full release title for identification
Download Selection:
- Only releases marked as "Available" can be downloaded
- Choose based on quality, file size, and seed count
- Downloads are sent to your configured download client
Command Line Mode
List all series:
yarr list
List only monitored series:
yarr list --monitored
Add a new series:
yarr add --name "Series Name"
Configuration Management
Create a sample config file:
yarr config init
Create config file at specific location:
yarr config init --path /path/to/config.toml
Show current configuration:
yarr config show
Show configuration file search paths:
yarr config paths
Edit configuration file with your preferred editor:
yarr config edit
Edit specific config file:
yarr config edit --path /path/to/config.toml
Shell Completions
Generate shell completions:
# Bash
yarr completions bash > /etc/bash_completion.d/yarr
# Zsh
yarr completions zsh > ~/.zfunc/_yarr
# Fish
yarr completions fish > ~/.config/fish/completions/yarr.fish
# PowerShell
yarr completions powershell > yarr.ps1
TUI Controls
Normal Mode (Default)
q- Quit↑/↓orj/k- Navigate up/downEnter- Select/expand item or show releases (in Search tab)Tab- Switch between tabsd- Toggle detailsr- Refresh data/- Search (in Search tab)Esc- Close popups or cancel searchs- Save configuration changes
Vim Mode
q- Quith/j/k/l- Navigate left/down/up/rightw/b- Next/previous tabgg- Go to first itemG- Go to last itemv- Toggle details (visual mode)u- Refresh data (undo)/- Search modei- Insert/input modeEnter- Select/expand item or show releases (in Search tab)Esc- Close popups or cancel operationss- Save configuration changes
Settings Tab
Use the Settings tab to:
- Toggle between Normal and Vim keybind modes
- Enable/disable help text display
- Edit Sonarr server URL and API key
- Save configuration changes to file
Access the Settings tab by navigating to the last tab or pressing Tab repeatedly.
Search Tab Usage
The Search tab provides comprehensive series search and download functionality:
- Enter Search Mode: Press
/to start typing a search query - Search: Type the series name and press Enter to search
- Browse Results: Use ↑/↓ or j/k to navigate through search results
- View Releases: Press Enter on a search result to open the releases popup
- Download: In the releases popup, select a release and press Enter to download
- Close Popup: Press Esc to close the releases popup
Release Popup Features:
- Shows all available releases for the selected series
- Displays quality, size, indexer, and availability status
- Color-coded status indicators for easy identification
- Download progress feedback through status messages
In-App Configuration
You can configure Sonarr connection settings directly within the application:
- Navigate to the Settings tab
- Select "Sonarr URL" or "API Key" and press Enter
- Type the new value and press Enter to save
- Press 's' to save all changes to the config file
This eliminates the need to manually edit config files for basic setup.
Getting Started
- Install yarr
- Create a configuration file:
yarr config init - Edit the configuration file to set your Sonarr URL and API key
- Launch the TUI:
yarr
Finding Your Sonarr API Key
- Open your Sonarr web interface
- Go to Settings > General
- Find the "Security" section
- Copy the "API Key" value
API Library Usage
The yarr-api crate can be used independently in your own projects:
use yarr_api::{SonarrClient, Result};
#[tokio::main]
async fn main() -> Result<()> {
let client = SonarrClient::new(
"http://localhost:8989".to_string(),
"your-api-key".to_string()
);
let series = client.get_series().await?;
println!("Found {} series", series.len());
Ok(())
}
See the yarr-api README for detailed API documentation and examples, including the new download after search functionality.
Development
Building the Workspace
# Build all crates
cargo build
# Build just the CLI
cargo build -p yarr
# Build just the API library
cargo build -p yarr-api
# Run tests
cargo test
# Run the API library example
cargo run --example basic_usage
License
MIT