βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ββββββββββββββββββββββββ ββββββββ ββββββ ββββ ββββββββββββββ
β ββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββ
β ββββββββ βββ ββββββββββββββ βββββββββββββββββββ βββ β
β ββββββββ βββ ββββββββββββββ βββββββββββββββββββ βββ β
β ββββββββ βββ βββ ββββββββββββββ ββββββ βββ βββ βββ β
β ββββββββ βββ βββ ββββββββββββββ ββββββ βββ βββ β
β ββββββββββββ ββββββ β
β ββββββββββββ ββββββ β
β βββ βββ ββββββ β
β βββ βββ ββββββ β
β βββ ββββββββββββ β
β βββ βββββββ βββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A neon-soaked terminal interface for streaming to Chromecast
StreamTUI is a cyberpunk-themed Terminal User Interface for searching movies and TV shows, selecting stream quality, and casting to your Chromecast β all from the comfort of your terminal.
Built with performance in mind: zero cold start (instant launch), full keyboard navigation, and complete CLI automation for scripting and AI agent integration.
- π¨ Cyberpunk neon theme with WCAG-compliant contrast ratios
- β¨οΈ Vim-style navigation (j/k, /, Esc)
- π Real-time search with trending content
- πΊ Multi-quality streams (4K, 1080p, 720p, 480p)
- π Subtitle support with language selection and trust indicators
- π Live playback status with progress bar
- π€ JSON output for scripting and automation
- π§ Semantic exit codes for error handling
- β‘ Single-command casting for quick access
- π― Claude Code / AI agent friendly β designed for LLM integration
βΆοΈ Play / βΈοΈ Pause / βΉοΈ Stop- β© Seek (absolute, relative, timestamp)
- π Volume control
- π± Device discovery and selection
# Clone the repository
git clone https://github.com/your-username/streamtui.git
cd streamtui
# Build and install
cargo install --path .StreamTUI requires these external tools for full functionality:
# webtorrent-cli - Torrent streaming
npm install -g webtorrent-cli
# catt - Chromecast control
pip install catt# Check webtorrent
webtorrent --version
# Check catt
catt --version
# Check streamtui
streamtui --helpSimply run without arguments to launch the interactive interface:
streamtui| Key | Action |
|---|---|
/ |
Start search |
β/β or j/k |
Navigate lists |
Page Up/Down |
Navigate by page |
Home/End |
Jump to first/last |
Enter |
Select item |
c |
View sources (from detail view) |
u |
Select subtitles |
Space |
Play/Pause |
β/β |
Seek Β±10s |
Esc |
Go back |
q |
Quit |
Every TUI action is available as a CLI command with JSON output. Commands support short aliases for faster typing.
| Command | Alias | Description |
|---|---|---|
search |
s |
Search for movies and TV shows |
trending |
tr |
Get trending content |
info |
i |
Get details for a movie or show |
streams |
st |
Get available streams for content |
subtitles |
sub |
Search for subtitles |
devices |
dev |
List available Chromecast devices |
cast |
β | Start casting content to a device |
cast-magnet |
cm |
Cast a raw magnet link directly |
play-local |
pl |
Play locally in VLC or mpv |
status |
β | Get current playback status |
play |
β | Resume playback |
pause |
β | Pause playback |
stop |
β | Stop playback and disconnect |
seek |
β | Seek to a position |
volume |
vol |
Set volume level |
# Basic search
streamtui search "blade runner"
streamtui s "blade runner" # alias
# Filter by type
streamtui search "breaking bad" --media-type tv
# Limit results and filter by year
streamtui search "batman" --limit 5 --year-from 2020
# JSON output (automatic when piped)
streamtui search "inception" --jsonOptions:
--limit, -l <N>β Maximum results (default: 20)--media-type, -t <movie|tv>β Filter by type--year-from <YYYY>β Minimum year--year-to <YYYY>β Maximum year
# Today's trending
streamtui trending
streamtui tr # alias
# This week's trending movies
streamtui trending --window week --media-type movieOptions:
--window, -w <day|week>β Time window (default: day)--limit, -l <N>β Maximum results (default: 20)--media-type, -t <movie|tv>β Filter by type
# Get movie/show details
streamtui info tt1877830
streamtui i tt1877830 # alias# Movie streams
streamtui streams tt1856101
streamtui st tt1856101 # alias
# TV episode streams
streamtui streams tt0903747 --season 1 --episode 1
# Filter by quality and sort by seeds
streamtui streams tt1877830 --quality 1080p --sort seedsOptions:
--season, -s <N>β Season number (TV only)--episode, -e <N>β Episode number (TV only)--quality, -Q <4k|1080p|720p|480p>β Filter by minimum quality--limit, -l <N>β Maximum results (default: 20)--sort <seeds|quality|size>β Sort criterion (default: seeds)
# English subtitles
streamtui subtitles tt1856101 --lang en
streamtui sub tt1856101 -l en # alias
# Multiple languages
streamtui subtitles tt0903747 --lang "en,es,fr" -s 1 -e 1
# Only trusted/verified subtitles
streamtui subtitles tt1877830 --trustedOptions:
--lang, -l <codes>β Comma-separated language codes (default: en)--season, -s <N>β Season number (TV only)--episode, -e <N>β Episode number (TV only)--hearing-impairedβ Only show hearing-impaired subtitles--trustedβ Only show trusted/verified subtitles--limit <N>β Maximum results (default: 20)
# List available Chromecasts
streamtui devices
streamtui dev # alias
# Extended scan with longer timeout
streamtui devices --timeout 10
# Force refresh device cache
streamtui devices --refreshOptions:
--timeout, -t <secs>β Scan timeout (default: 5)--refresh, -rβ Refresh device cache
# Cast movie to device
streamtui cast tt1856101 --device "Living Room TV"
# Cast with quality preference
streamtui cast tt1877830 -d "Bedroom TV" -Q 1080p
# Cast TV episode with subtitles
streamtui cast tt0903747 -s 1 -e 1 -d TV --subtitle en
# Cast specific stream index
streamtui cast tt1877830 -d TV --index 0
# Play locally in VLC instead of casting
streamtui cast tt1877830 --vlcOptions:
--device, -d <name>β Target device (required unless default set)--quality, -Q <4k|1080p|720p|480p>β Preferred quality--season, -s <N>β Season number (TV only)--episode, -e <N>β Episode number (TV only)--index, -i <N>β Stream index fromstreamsoutput--subtitle <lang>β Subtitle language code--subtitle-id <id>β Specific subtitle ID fromsubtitlesoutput--no-subtitleβ Explicitly disable subtitles--start <secs>β Start position in seconds--vlcβ Play locally in VLC instead of casting
# Cast a magnet link
streamtui cast-magnet "magnet:?xt=urn:btih:..." --device TV
streamtui cm "magnet:?xt=..." -d TV # alias
# With subtitles
streamtui cast-magnet "magnet:?xt=..." -d TV --subtitle en
# With local subtitle file
streamtui cast-magnet "magnet:?xt=..." -d TV --subtitle-file /path/to/subs.srtOptions:
--device, -d <name>β Target device--subtitle <lang>β Search for subtitles in this language (via Stremio)--subtitle-file <path>β Path to local subtitle file (.srt, .vtt)--file-idx, -i <N>β File index within torrent (default: largest video)--start <secs>β Start position--vlcβ Play locally in VLC instead
# Play magnet in VLC
streamtui play-local "magnet:?xt=..."
streamtui pl "magnet:?xt=..." # alias
# Play in mpv instead
streamtui play-local "magnet:?xt=..." --player mpv
# With subtitles
streamtui play-local "magnet:?xt=..." --subtitle-file /path/to/subs.srtOptions:
--player, -p <vlc|mpv>β Player to use (default: vlc)--subtitle-file <path>β Path to local subtitle file--file-idx, -i <N>β File index within torrent
# Check status
streamtui status
streamtui status --json # For scripting
# Watch mode - continuously update
streamtui status --watch --interval 2
# Play/Pause
streamtui play
streamtui pause
# Seek - multiple formats supported
streamtui seek 3600 # To 1 hour (absolute seconds)
streamtui seek +30 # Forward 30 seconds
streamtui seek -10 # Back 10 seconds
streamtui seek 1:30:00 # To timestamp (HH:MM:SS)
streamtui seek 5:30 # To timestamp (MM:SS)
# Volume
streamtui volume 50 # Set to 50%
streamtui vol +10 # Increase by 10%
streamtui vol -5 # Decrease by 5%
# Stop
streamtui stop
streamtui stop --kill-stream # Also stop torrentThese flags work with any command:
--json, -j # Force JSON output (default for non-TTY)
--device, -d # Set default Chromecast device
--quiet, -q # Suppress non-essential output
--config, -c # Custom config file pathStreamTUI is designed for seamless AI agent integration. Every action is scriptable with JSON output and semantic exit codes.
# Agent searches for content
result=$(streamtui search "the matrix" --json | jq -r '.data[0].imdb_id')
# Agent gets available streams
streamtui streams "$result" --json | jq '.data[] | {quality, seeds, title}'
# Agent casts best quality
streamtui cast "$result" --device "TV" --quality 1080p --json# Check if something is playing
state=$(streamtui status --json | jq -r '.data.state')
if [ "$state" = "playing" ]; then
echo "Currently playing!"
fi
# Get playback progress
streamtui status --json | jq '{title: .data.title, progress: (.data.progress * 100 | floor | tostring + "%")}'#!/bin/bash
# Find a trending movie and cast it
movie=$(streamtui trending --media-type movie --json | jq -r '.data[0].imdb_id')
streamtui cast "$movie" --device "Living Room TV" --quality 1080p# Agent has a magnet link from external source
streamtui cast-magnet "$MAGNET_LINK" -d "TV" --subtitle en#!/bin/bash
# Robust casting with error handling
imdb_id="tt1877830"
device="Living Room TV"
# Try to cast
if streamtui cast "$imdb_id" -d "$device" -Q 1080p --json 2>/dev/null; then
echo "Casting started successfully"
else
exit_code=$?
case $exit_code in
4) echo "Device '$device' not found" ;;
5) echo "No streams available for $imdb_id" ;;
6) echo "Cast failed" ;;
*) echo "Unknown error: $exit_code" ;;
esac
exit $exit_code
fiFor robust scripting, StreamTUI uses semantic exit codes:
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Network error |
| 4 | Device not found |
| 5 | No streams available |
| 6 | Cast failed |
All commands output consistent JSON when --json is used or when stdout is not a TTY:
// Success
{
"data": { ... },
"exit_code": 0
}
// Error
{
"error": "Error message",
"exit_code": 4
}StreamTUI looks for configuration at ~/.config/streamtui/config.toml:
# Default Chromecast device
default_device = "Living Room TV"
# Preferred quality (4k, 1080p, 720p, 480p)
preferred_quality = "1080p"
# Preferred subtitle languages (first match wins)
subtitle_languages = ["en", "es"]
# API keys (optional - uses defaults)
# tmdb_api_key = "your-key"Manual screenshots coming soon...
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STREAMTUI β β blade runner β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β‘ RESULTS (5) β
β β
β βΈ Blade Runner 2049 (2017) [MOVIE] β
7.5 β
β Blade Runner (1982) [MOVIE] β
8.1 β
β Blade Runner: Black Lotus (2021) [TV] β
6.4 β
β Blade Runner: Black Out 2022 (2017) [MOVIE] β
7.4 β
β Making of Blade Runner (2007) [MOVIE] β
7.8 β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β NORMAL β SEARCH β πΊ Living Room TV β q:quit /:search ESC:back β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β βΆ NOW CASTING β
β β
β Blade Runner 2049 (2017) β
β ββββββββββββββββββββββββββββββ 1:23:45 / 2:43:00 β
β β
β πΊ Living Room TV β π 75% β π¬ 1080p β
β [Space] Pause [s] Stop [β/β] Seek [Esc] Hide β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ SELECT STREAM ββββββββββββββββββββββββββββββββββββββββββββββ
β β
β βΈ [1] 2160p WEB-DL HDR 12.1 GB Seeds: 89 β
β
β
β
β
β [2] 1080p BluRay x264 4.2 GB Seeds: 142 β
β
β
β
β [3] 1080p WEB-DL 2.8 GB Seeds: 234 β
β
β
β
β [4] 720p WEB 1.8 GB Seeds: 567 β
β
β
β [5] 480p WEB 890 MB Seeds: 123 β
β
β β
β [Enter] Cast [c] Cast to device [Esc] Back β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Run in development
cargo run
# Run tests (654 tests)
cargo test
# Run specific test module
cargo test --test tmdb_test
# Lint
cargo clippy
# Format
cargo fmt
# Build release binary
cargo build --releasestreamtui/
βββ src/
β βββ main.rs # Entry point, TUI loop
β βββ app.rs # Application state machine
β βββ cli.rs # CLI argument parsing
β βββ commands.rs # CLI command handlers
β βββ models.rs # Data structures
β βββ api/ # API clients
β β βββ tmdb.rs # TMDB for search/info
β β βββ torrentio.rs # Torrentio for streams
β βββ stream/ # Streaming components
β β βββ torrent.rs # webtorrent-cli wrapper
β β βββ cast.rs # catt wrapper
β β βββ subtitles.rs # Stremio subtitle client
β βββ ui/ # TUI components
β βββ theme.rs # Cyberpunk color palette
β βββ search.rs # Search view
β βββ browser.rs # Content browser
β βββ detail.rs # Detail view
β βββ subtitles.rs # Subtitle selection
β βββ player.rs # Now playing overlay
βββ tests/ # Integration tests
βββ specs/ # Design specifications
MIT License - see LICENSE for details.
Built with π by Gorka & Hermes
"The future is now, old man."