Stream Ninja Interface — terminal-based anime streaming CLI + TUI
Project description
SNI — Stream Ninja Interface
A terminal-based anime streaming client inspired by ani-cli. Search, browse, and stream anime from multiple providers directly in your terminal.
Features
- Multi-mirror AllAnime support — auto-tries api.allanime.day + api.allmanga.to on captcha
- Full TUI mode — Rich terminal UI built with Textual
- Interactive CLI — fzf-based selection with numbered-input fallback
- Watch history — Resume from where you left off
- Episode queuing — Play ranges (e.g.
sni play "X" -e 1-12) - mpv/VLC integration — IPC socket controls (next, prev, reload, quit)
- Captcha-bypass built-in — Cloudflare Worker fallback + browser-cookie injection for AllAnime
- Configurable — TOML config with interactive wizard
- Cross-platform — Linux, macOS, Windows
Installation
One-command install
Pick the command for your OS, paste it into a terminal, and you're done. The installer detects your package manager, installs Python + mpv + fzf if missing, installs SNI, and adds sni to your PATH automatically — no manual steps required.
Linux
curl -fsSL https://raw.githubusercontent.com/sundeepyt2/SNI/main/install.sh | bash
macOS
curl -fsSL https://raw.githubusercontent.com/sundeepyt2/SNI/main/install.sh | bash
(Homebrew will be bootstrapped automatically if missing.)
Windows (PowerShell)
iex (irm https://raw.githubusercontent.com/sundeepyt2/SNI/main/install.ps1)
If PowerShell blocks the script with an execution-policy error, run this first:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Then re-run the install command.
Install from PyPI
Once SNI is published to PyPI (after the v1.1.1 release), you can install it with plain pip — no cloning required:
# Linux / macOS
pip install --user sni-cli
# Windows
pip install sni-cli
Why
sni-cliand notsni? PyPI rejected the baresniname as too similar to existing projects (sni-auth,sni-bin,sni-sdk,snib,snic,snid, ...). The package name on PyPI issni-cli, but the console command is still justsni(e.g.sni play,sni tui,sni search).
This installs the SNI Python package and the sni command, but does not install mpv or fzf — install those separately if you don't have them already:
- Linux:
sudo apt install mpv fzf(or your distro's equivalent) - macOS:
brew install mpv fzf - Windows:
winget install mpv.net junegunn.fzf
For a fully-automatic install (including mpv + fzf), use the one-command installers above instead.
Install from a local clone
If you've already cloned the repo (or want to hack on SNI), run the installer from the repo root:
git clone https://github.com/sundeepyt2/SNI.git
cd SNI
# Linux / macOS:
./install.sh
# Windows PowerShell:
.\install.ps1
What the installer does
Both install.sh and install.ps1 perform the same four steps:
- Detects your package manager and installs system dependencies:
- Linux:
apt/dnf/pacman/zypper/apk— installspython3,python3-pip,mpv,fzf,git - macOS: Homebrew — installs
python@3.12,mpv,fzf - Windows:
winget/scoop/choco(auto-detected) — installs Python, mpv.net, fzf
- Linux:
- Verifies Python >= 3.10
- Installs SNI itself via
pip install --user .(no admin/sudo needed) - Adds SNI to your PATH idempotently:
- Linux/macOS: injects an
export PATH=...line into your~/.bashrc/~/.zshrc/~/.profile/~/.config/fish/config.fish(whichever is appropriate for your shell) - Windows: calls
[Environment]::SetEnvironmentVariable("Path", ..., "User")to persist across reboots
- Linux/macOS: injects an
The installer is idempotent — safe to re-run as many times as you want. It will skip packages that are already installed and won't add duplicate PATH entries.
Manual install (alternative)
If you prefer to install everything by hand:
Linux (Debian/Ubuntu)
sudo apt update
sudo apt install python3 python3-pip mpv fzf git
git clone https://github.com/sundeepyt2/SNI.git
cd SNI
pip install --user --break-system-packages .
# Add ~/.local/bin to PATH (one-time)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
sni --version
macOS
brew install python@3.12 mpv fzf git
git clone https://github.com/sundeepyt2/SNI.git
cd SNI
pip3 install --user .
# Add ~/Library/Python/3.12/bin to PATH (one-time)
echo 'export PATH="$HOME/Library/Python/3.12/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
sni --version
Windows
# Install Python from https://python.org (check "Add to PATH")
# Install mpv from https://sourceforge.net/projects/mpv-player-windows/
# Install fzf from https://github.com/junegunn/fzf/releases
git clone https://github.com/sundeepyt2/SNI.git
cd SNI
pip install .
sni --version
First-run setup
After installing, run the interactive config wizard to pick your default provider, quality, sub/dub, etc:
sni config --interactive
Or just start using SNI directly — sensible defaults are baked in.
Usage
# Search and play (interactive)
sni play "one piece"
# Watch with ani-cli like flow (continue/resume support)
sni watch "naruto"
# Play specific episode range
sni play "attack on titan" -e 1-12
# Use a specific provider
sni play "jujutsu kaisen" -p allanime
# Watch dubbed
sni play "demon slayer" -d
# Resume from watch history
sni watch --resume
# Search only
sni search "spy x family"
# Launch full TUI
sni tui
# Configure
sni config --interactive
sni config --update quality=720
sni config --update default_provider=allanime
Commands
| Command | Description |
|---|---|
sni search <query> |
Search for anime titles |
sni play <query> |
Search and play with interactive flow |
sni watch <query> |
Watch with continue/resume support |
sni tui |
Launch full terminal UI |
sni config |
Manage configuration |
sni config --interactive |
Interactive config wizard |
sni config --cookie-info |
Show how to bypass AllAnime captcha (3 options) |
sni provider list |
List available providers |
sni provider status |
Health-check providers |
Providers
| Provider | Sub | Dub | Status |
|---|---|---|---|
| AllAnime | Yes | Yes | Active (with multi-mirror auto-fallback) |
Note: HiAnime and Animepahe providers were removed in v1.2.0 — both were dead (hianime.to domain gone, animepahe API deprecated). AllAnime is now the only provider, but it auto-tries multiple API mirrors (api.allanime.day + api.allmanga.to) on captcha, so most users never see a captcha error.
Configuration
Config file: ~/.config/sni/config.toml (Linux/macOS) or %APPDATA%\sni\config.toml (Windows)
[general]
default_provider = "allanime"
selector = "fzf"
icons = true
[stream]
player = "mpv"
quality = "1080"
translation_type = "sub"
auto_next = true
use_ipc = true
[ui]
show_description = true
show_score = true
show_genres = true
[providers]
allanime_cookies = ""
allanime_cf_worker_url = ""
Run sni config --interactive to set up via a guided wizard.
TUI Mode
Launch the full terminal UI with:
sni tui
Keybinds
| Key | Action |
|---|---|
/ |
Focus search input |
j / k |
Navigate up/down |
Enter |
Select / Play |
Escape |
Go back / Close |
? |
Show help |
! |
Player controls |
@ |
Watch history |
$ |
About |
q |
Quit |
AllAnime captcha fix
SNI v1.2.1+ auto-fixes captcha for you. When api.allanime.day captcha-walls your IP, SNI automatically retries the request through a free public CORS proxy (proxy.cors.sh). This happens silently, with zero setup. Most users can just run sni play "one piece" and it works — no cookies, no CF Worker, no config changes.
If you STILL see NEED_CAPTCHA (rare — means all proxies were also captcha-walled), try these in order. Run sni config --cookie-info to see all options in a single panel.
Option 1 — Browser cookies (if your IP isn't permanently flagged)
Get cookies from a working AllAnime mirror — NOT allanime.day (which is currently broken with a redirect loop, see Troubleshooting). Working mirrors include:
Open one in your browser, solve any captcha, then copy the cookie string from DevTools → Application → Cookies. Save it:
# Option A — config key:
sni config --update allanime_cookies='cf_clearance=...;'
# Option B — cookies file (easier to refresh):
echo 'cf_clearance=...;' > ~/.config/sni/allanime_cookies.txt
# Option C — one-off flag:
sni play "one piece" --cookie 'cf_clearance=...;'
Option 2 — Cloudflare Worker (last resort for VPN/shared IPs that are permanently captcha-walled AND cookies + public proxies don't work)
This is the most powerful bypass — it proxies AllAnime API requests through Cloudflare's own IPs, which AllAnime rarely challenges. Only set this up if Option 1 fails AND SNI's built-in proxy fallback doesn't work for you.
Deploy via Cloudflare (free, requires a Cloudflare account):
-
Go to https://dash.cloudflare.com → Workers & Pages → Create
-
Paste the contents of
cf-worker/worker.jsfrom the XAN repo -
Deploy, copy the worker URL (e.g.
https://xan-proxy.you.workers.dev) -
Save it to SNI:
sni config --update allanime_cf_worker_url='https://xan-proxy.you.workers.dev'
Can't create a Cloudflare account? Deploy the same worker.js code to any of these alternative platforms (all have free tiers, none require a credit card):
- Deno Deploy (https://dash.deno.com) — free, no card required, fastest setup. Wrap the worker's
fetchhandler in aDeno.serve()call. - Vercel Edge Functions (https://vercel.com) — free tier. Adapt the handler to Vercel's
export default function handler(req: Request)signature. - Netlify Functions (https://netlify.com) — free tier. Convert to Netlify's
exports.handlerformat.
The worker code is platform-agnostic — it's just a fetch handler that proxies a request. The only thing that changes between platforms is the entry-point wrapper.
Troubleshooting
sni: command not found after install
The installer added SNI to your PATH, but your current shell session hasn't picked it up yet. Fix:
- Linux/macOS: open a new terminal, or run
source ~/.bashrc(orsource ~/.zshrc) - Windows: open a new PowerShell window
Verify with sni --version.
mpv not found
SNI needs a video player to actually play streams. Install mpv:
- Linux:
sudo apt install mpv/sudo dnf install mpv/sudo pacman -S mpv - macOS:
brew install mpv - Windows:
winget install mpv.netor download from https://sourceforge.net/projects/mpv-player-windows/
fzf not found
fzf is optional — SNI falls back to numbered selection if it's missing. To install:
- Linux:
sudo apt install fzf/sudo dnf install fzf/sudo pacman -S fzf - macOS:
brew install fzf - Windows:
winget install junegunn.fzf
allanime.day says "too many redirects"
This is a server-side bug on AllAnime's website — not a problem with your browser, your cookies, or SNI. As of July 2026, https://allanime.day returns Location: https://allanime.day// (note the double slash), which redirects to itself infinitely. It affects everyone globally.
You don't need to visit allanime.day to use SNI. SNI only talks to api.allanime.day (the API endpoint), which is independent of the broken website and is working normally.
If you need to grab browser cookies for the captcha bypass, use a working mirror instead:
If you just want to watch anime, skip the website entirely and run sni play "one piece" directly.
AllAnime NEED_CAPTCHA error
SNI v1.2.0+ automatically tries multiple AllAnime API mirrors before giving up. If you still see this error, all mirrors failed. See the AllAnime captcha fix section above. TL;DR in order of preference:
- Browser cookies from a working mirror:
sni config --update allanime_cookies='cf_clearance=...;' - CF Worker (only for VPN/shared IPs): deploy the worker and
sni config --update allanime_cf_worker_url='https://...'
Python version too old
SNI requires Python 3.10 or newer. Check your version with python3 --version. If it's older:
- Linux: install
python3.12from your package manager (Debian Backports, Ubuntu deadsnakes PPA, etc.) - macOS:
brew install python@3.12 - Windows: download from https://python.org
pip install fails with "externally-managed-environment"
This happens on Debian 12+ / Fedora 38+ / PEP 668 systems. The installer handles it automatically with --break-system-packages. If you're installing manually:
pip install --user --break-system-packages .
Or, better, use a virtualenv:
python3 -m venv ~/.venvs/sni
source ~/.venvs/sni/bin/activate
pip install .
sni --version
Uninstall
# Remove the Python package
pip uninstall sni-cli # Linux/macOS
pip uninstall sni-cli # Windows
# Remove config + cookies
rm -rf ~/.config/sni # Linux/macOS
Remove-Item -Recurse $env:APPDATA\sni # Windows
# Remove PATH entries (search for "sni-path-inject" in your shell rc files)
# Linux/macOS: edit ~/.bashrc / ~/.zshrc / ~/.profile and delete the marked lines
# Windows: System Properties → Environment Variables → edit user Path
Development
git clone https://github.com/sundeepyt2/SNI.git
cd SNI
pip install --user -e ".[test]"
# Run tests
pytest -q
# Lint
ruff check .
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sni_cli-1.2.2.tar.gz.
File metadata
- Download URL: sni_cli-1.2.2.tar.gz
- Upload date:
- Size: 49.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a29e61ec9a47f692e48edca4a5dc9d2538b04a89806c99811bdde9ff184b277
|
|
| MD5 |
7058a5e617ec5066705e4ce01a9f15be
|
|
| BLAKE2b-256 |
d49b5c767143fdb2eaa6c5ec546f5d9a89fc66fd097825068c841b0fd1352439
|
Provenance
The following attestation bundles were made for sni_cli-1.2.2.tar.gz:
Publisher:
release.yml on sundeepyt2/SNI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sni_cli-1.2.2.tar.gz -
Subject digest:
1a29e61ec9a47f692e48edca4a5dc9d2538b04a89806c99811bdde9ff184b277 - Sigstore transparency entry: 2048579602
- Sigstore integration time:
-
Permalink:
sundeepyt2/SNI@3554af3e8fb75eaf846fc5aba84d7beea0074100 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/sundeepyt2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3554af3e8fb75eaf846fc5aba84d7beea0074100 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sni_cli-1.2.2-py3-none-any.whl.
File metadata
- Download URL: sni_cli-1.2.2-py3-none-any.whl
- Upload date:
- Size: 47.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
035d6cccb73681f37d5c11ac2bbd4114fd1e1055edc204f88d03036b0c9415b2
|
|
| MD5 |
73855b7b1756b767ccf05c00bd828540
|
|
| BLAKE2b-256 |
7b0d78f22f43e73f6cb6d3608412c2e0a2452bc26011df193e3926596502fc66
|
Provenance
The following attestation bundles were made for sni_cli-1.2.2-py3-none-any.whl:
Publisher:
release.yml on sundeepyt2/SNI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sni_cli-1.2.2-py3-none-any.whl -
Subject digest:
035d6cccb73681f37d5c11ac2bbd4114fd1e1055edc204f88d03036b0c9415b2 - Sigstore transparency entry: 2048579625
- Sigstore integration time:
-
Permalink:
sundeepyt2/SNI@3554af3e8fb75eaf846fc5aba84d7beea0074100 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/sundeepyt2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3554af3e8fb75eaf846fc5aba84d7beea0074100 -
Trigger Event:
release
-
Statement type: