ani-cli Kept Missing Episodes, So I Built a Go mpv Client
I used to rely on ani-cli whenever I wanted to watch something quickly from the terminal, and after a few weeks the same two things kept breaking. One night I tried looking up Fate/Grand Order and Liar Game dubs, and eit
I used to rely on ani-cli whenever I wanted to watch something quickly from the terminal, and after a few weeks the same two things kept breaking. One night I tried looking up Fate/Grand Order and Liar Game dubs, and either half the episodes were missing or the stream wasn't there at all because a single upstream scraper didn't index them. Even when a show existed, piping curl, grep, sed, and fzf together on Windows meant dealing with Git Bash or WSL quirks, and one dropped mirror meant restarting the whole command from scratch.
I wanted a single terminal client that actually finds what I search for across multiple sources instead of forcing me to hop websites in a browser. So I built Kaze (v4.3.0) in Go as one static binary (Windows, macOS, Linux) talking straight to mpv over IPC.
Searching multiple mirrors without crashing the TUI
Leaning on one source is always a gamble. One gateway gets updated seasonal dubs early (26 episodes present), while another only has 24 or goes down halfway through an episode.
In internal/search/fanout.go, FanOut queries multiple sources at the same time using goroutines under a 3s timeout and streams matches straight into the Bubble Tea UI as each source responds. In AUTO mode, if a CDN node throws HTTP 403 or stalls mid-stream, Kaze switches over to another working mirror automatically instead of kicking you back to your shell prompt.
The catch with concurrent scrapers hitting websites you do not own is one weird HTML snippet or nil field triggering an index out-of-bounds panic. Wrapping every worker goroutine in defer recover() catches panics inside individual providers and sends an Event.Err instead of killing the terminal UI while healthy mirrors finish loading.
Talking to mpv over Named Pipes instead of shell wrappers
If a CLI launches mpv once as a fire-and-forget subprocess, you give up live control inside the terminal. On Linux and macOS, you pass --input-ipc-server=/tmp/kaze-ipc-*.sock and write over a Unix socket (internal/mpv/dial_unix.go). On native Windows terminals, Unix socket workarounds break constantly unless you switch to Windows Named Pipes (\\.\pipe\kaze-mpv-<pid>-<unixnano>).
Using build-tagged Go files (dial_windows.go backed by Microsoft's go-winio), Kaze dials the pipe directly:
// internal/mpv/dial_windows.go
func dialIPC(ctx context.Context, address string) (net.Conn, error) {
return winio.DialPipeContext(ctx, address)
}
Once connectIPC polls the endpoint every 75ms until mpv binds it, Kaze talks over sanitized JSON-RPC without calling a shell. That means weird brackets or quotes in anime titles never cause shell injection, s and e trigger AniSkip OP/ED chapter jumps, and Ctrl+1 through Ctrl+8 hot-swaps stacked Anime4K GLSL shaders (Retro Deblur, Modern Sharp, and 2K/4K upscalers) live mid-episode with zero restarts (Ctrl+0 clears shaders to zero GPU load).
Seven security and packaging fixes before tagging v4.3.0
While cleaning everything up for v4.3.0, an audit caught a few mistakes that are way too easy to leave sitting inside personal CLI tools.
Early builds passed --tls-verify=no into mpv to avoid picky stream certificate errors, which left HTTPS video playlists open to trivial MITM interference. Removing that flag forces mpv to verify against the OS certificate store cleanly.
Checking URL strings with url.ParseRequestURI also wasn't enough against SSRF or DNS rebinding (evil.nip.io pointing to 127.0.0.1 or 169.254.169.254). internal/provider/http.go now checks resolved IPs inside safeDialContext at socket dial time (net.DefaultResolver.LookupIP), rejecting loopback (127.0.0.0/8), RFC1918 subnets, Carrier-Grade NAT (100.64.0.0/10), link-local metadata (169.254.0.0/16), and .localhost/.local/.internal hosts before opening a connection, plus re-validating redirects. Passing kaze play http://127.0.0.1:8080/stream.m3u8 rejects with exit code 1 immediately.
Earlier releases also had an embarrassing updater glitch in v4.2.2: Linux tarballs extracted kaze-linux-amd64 instead of kaze, breaking install.sh and self-updates. On top of fixing archive layout, every decoder now wraps resp.Body in io.LimitReader, .gitattributes keeps SHA256SUMS and install.sh at 0 BOM / 0 CR bytes, and install.sh, install.ps1, plus VerifyArchiveChecksum all fail closed if SHA256SUMS is missing or mismatched (with 139cd282... pinned for Anime4K shaders too). On Windows, where the OS locks running executables, ApplyBinaryUpdate writes a verified temp file, renames kaze.exe to kaze.exe.old, swaps the new binary in, and rolls back cleanly if anything fails.
All 11/11 Go packages (46 top-level tests and 17 subtests) pass go test -count=1 ./... and go vet ./....
Honest current state
Right now Kaze distributes prebuilt MIT binaries for windows/amd64, linux/amd64, linux/arm64, darwin/amd64, and darwin/arm64 along with install.sh, install.ps1, SHA256SUMS, and Scoop/Homebrew/AUR packaging recipes, while the internal Go aggregator code sits in a private repo while I finish refactoring and cleaning it up. My plan is to open-source the full Go codebase cleanly later on. Meanwhile every binary runs with zero accounts, zero ads, and zero telemetry, and THIRD_PARTY_NOTICES.md bundles notices for all Go libraries and shaders inside every archive.
One hard requirement before installing: you still need mpv on your PATH (scoop install mpv, brew install mpv, or your Linux package manager), because Kaze is a terminal search aggregator and IPC controller rather than a built-in media decoder. And if upstream mirrors all change markup during the same week, even automatic failover has to wait until adapters catch up.
Installers if you want to try the TUI locally:
- Windows PowerShell:
irm https://raw.githubusercontent.com/yashh1323/kaze/main/install.ps1 | iex - Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/yashh1323/kaze/main/install.sh | bash
Release binaries and SHA256SUMS: github.com/yashh1323/kaze
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.

