lo-pi
pi coding agent extension: toggle a lofi radio stream (/lopi) with an animated gradient equalizer in the footer
Package details
Install lo-pi from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:lo-pi- Package
lo-pi- Version
1.0.0- Published
- Sep 9, 2026
- Downloads
- 143/mo · 143/wk
- Author
- shreyashp7
- License
- MIT
- Types
- extension
- Size
- 5.5 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./lopi.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
lo-pi
A pi coding agent extension that toggles a lofi radio stream from inside the terminal. One command starts/stops playback (via mpv) and animates a gradient equalizer in the footer while it plays.
Features
/lopi— start the default Radio Paradise lofi stream (https://stream.radioparadise.com/mp3-128?genre=lofi)/lopi <stream-url>— play any MP3 stream URL instead/lopiagain — stop- Footer indicator: 5-shape equalizer with a per-bar 256-color gradient (coral → pink → purple → blue → cyan) that drifts in sync with the animation; auto-clears on stop or if
mpvexits (stream ended / crashed) - Cleanup on session shutdown — no orphaned
mpvprocesses
Requirements
- pi coding agent
mpvon yourPATH
Setup
Install from npm:
pi install npm:lo-pi
Restart pi (or reload extensions). Then in any session:
/lopi # start default lofi stream
/lopi <stream-url> # play a custom stream
/lopi # stop
How it works
- Spawns
mpv --no-video --no-terminal <url>with ignored stdio. - A 400ms
setIntervalticks 4 height frames; each frame colors its 5 shapes individually with raw ANSI 256-color codes (\x1b[38;5;Nm), offset by the frame index so the gradient sweeps left→right. Raw ANSI is used because pi'stheme.fg()only accepts theme color names. proc.on("exit")andsession_shutdownboth callstop(), which clears the timer, deletes the footer status entry, and killsmpv.