Stream Lofi Girl from your terminal. A lightweight CLI for beats to code/study to.
- Rust 100%
- Bump rustls-webpki 0.103.12 → 0.103.13 via cargo update to close RUSTSEC-2026-0104 (reachable panic in CRL parsing, reached via reqwest → hyper-rustls → rustls → rustls-webpki). - Add .cargo/audit.toml ignoring two ratatui-transitive warnings: RUSTSEC-2024-0436 (paste unmaintained) and RUSTSEC-2026-0002 (lru IterMut unsound). Both are non-vulnerability warnings pulled via ratatui 0.28 and would require a major-version bump to clear; tracked in comments to revisit on next ratatui upgrade. cargo audit --deny warnings now passes (exit 0); cargo test --locked still green. |
||
|---|---|---|
| .cargo | ||
| .github/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
locli-girl
Stream Lofi Girl from your terminal. A lightweight CLI for beats to code/study to.
Heads up: this project is full vibe-coded. It was built as a test for Claude Code — essentially every line here was produced or edited by an agent. Expect charm, not rigor.
What it does
- Discovers Lofi Girl's currently-live radio streams via the Piped public API.
- Resolves the chosen station's HLS manifest, demuxes the MPEG-TS segments, and decodes the AAC audio.
- Plays through your system's default output with cpal, pinned to 48 kHz stereo.
- Renders a ratatui TUI with an FFT-based visualizer.
- Integrates with MPRIS (via souvlaki) so your keyboard media keys control playback on Linux.
Build & run
Requires a recent stable Rust toolchain and the usual Linux audio/D-Bus libs (ALSA or PipeWire, D-Bus for MPRIS).
cargo run --release
Config is persisted to ~/.config/locli-girl/config.toml (last station + volume).
Keybindings
| Key | Action |
|---|---|
space |
toggle pause |
+ / - |
volume up / down (by 5%) |
m |
toggle mute |
s |
open / close the station panel |
↑ / ↓ |
navigate stations (panel open) |
enter |
switch to selected station |
esc |
close the station panel |
q |
quit |
Architecture notes
src/piped.rs— fetches stations from Piped's channel +/channels/tabsendpoints, filtering byduration == -1(currently-live).src/hls.rs— master/media playlist parsing and RFC-3986 URL joining viareqwest::Url.src/ts.rs— minimal MPEG-TS demuxer that extracts the AAC-ADTS payload (symphonia doesn't demux TS itself).src/stream.rs— polling loop, decode, linear resampling to the output rate, non-evicting bounded push into the audio buffer.src/player.rs— cpal stream pinned toOUTPUT_SAMPLE_RATE × OUTPUT_CHANNELSto avoid rate drift.src/tui/— ratatui layout + event loop.src/visualizer.rs— Hann-windowed FFT bars.src/mpris.rs— D-Bus media key integration (best-effort; silent failure when unavailable).
Caveats
- HE-AAC is decoded at the AAC-LC core rate (22050 Hz) and linearly upsampled. No SBR → high frequencies are attenuated; audio sounds a little muffled compared to a full-fidelity decoder.
- Piped instances come and go. If
fetch stationsfails, check the live instance list and add a fresh entry toPIPED_INSTANCESinsrc/piped.rs.
License
Unspecified — treat as "all rights reserved" unless a license file is added.