How to Search, Stream, and Download Anime Using ani-cli

Vulnerability Manager Plus
ani-cli is a POSIX shell script that lets you search for anime, choose an episode, and stream it directly through mpv. It uses fzf to select titles and episodes and curl to fetch the required data.

You enter the anime title, fzf shows the available matches, you choose one, select an episode, and mpv starts streaming it. No browser, no ads, no pop-ups, and no need to open multiple tabs just to find the next episode.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.

What ani-cli Actually Does

ani-cli is a shell script maintained by pystardust on GitHub. It searches a third-party streaming site, processes the results using tools like grep command and sed command, and sends the selected stream URL to your media player.

ani-cli does not host any videos itself. When you search for and play an anime, the video is streamed directly from the source site.

If you’re setting up a fresh system to try tools like this, the Learn Linux in 7 Days course can help you get comfortable with the shell environment where ani-cli runs.

Dependencies ani-cli Needs

ani-cli is a lightweight script, but it relies on a few other tools to handle searching, downloading, and playback. Make sure these are installed before you start.

  • grep and sed – process the HTML and JSON responses from the source site.
  • curl – fetch search results and episode information.
  • mpv – play the video stream. On macOS, iina can be used instead.
  • fzf – provides the interactive search and episode picker.
  • yt-dlp – downloads episodes when you use the download option.
  • ffmpeg – acts as a fallback downloader if yt-dlp can’t fetch a stream.
  • patch – needed only when using ani-cli’s built-in self-update feature.

One tool worth knowing about is fzf. It’s a command-line fuzzy finder that turns a list of text into an interactive, searchable menu. That’s what gives ani-cli a simple interface instead of making you work through a long list of scraped links.

Installing ani-cli

The easiest way to install ani-cli depends on your Linux distribution, so use the method that matches your system.

On Debian 13 (unstable) and derivatives:

sudo apt install ani-cli

On Fedora:

Fedora requires RPM Fusion for mpv, followed by the maintainer’s COPR repository for ani-cli.

sudo dnf copr enable derisis13/ani-cli
sudo dnf install ani-cli

On Arch and Arch-based distributions:

yay -S ani-cli

There is no official package for RHEL or Rocky Linux, and the project currently doesn’t support that family beyond the Fedora COPR build. If you’re using RHEL, Rocky Linux, Ubuntu outside the Debian unstable package, or another distribution without a native package, installing from source is the simplest option.

From source:

This method works on any distribution as long as the required dependencies are already installed.

git clone "https://github.com/pystardust/ani-cli.git"
sudo cp ani-cli/ani-cli /usr/local/bin
rm -rf ani-cli

Here’s what each command does:

  • git clone – downloads the ani-cli repository into a local directory.
  • sudo cp – copies the script to /usr/local/bin, which is normally included in your $PATH.
  • rm -rf ani-cli — removes the cloned directory after the script has been copied.

The sudo command is needed because /usr/local/bin is usually owned by root. If you get a Permission denied error, make sure you’re using sudo and that your account has permission to use it.

After installation, check that ani-cli is available:

ani-cli --help

You should see output similar to this:

Usage:
    ani-cli [options] [query]
    ani-cli [query] [options]
    ani-cli [options] [query] [options]

    Options:
      -c, --continue
        Continue watching from history
      -d, --download
        Download the video instead of playing it
      -D, --delete
        Delete history
      -s, --syncplay
        Use Syncplay to watch with friends
      -S, --select-nth
        Select nth entry
      -q, --quality
        Specify the video quality
...

If this help message appears, ani-cli is installed correctly and is available from your $PATH. It also gives you a quick overview of the options you can use for streaming, downloading, selecting episodes, choosing video quality, and more.

If the source-install steps helped you understand how /usr/local/bin works, share this guide with someone who’s still confused about where manually installed tools go.
If you want a structured, from-zero introduction to shell scripting, the Bash Scripting Course on Pro Tecmint covers the concepts you need to get started.
If you’d rather test tools like this on a disposable system instead of your daily driver, DigitalOcean offers reliable cloud VPS plans starting at $4/month. TecMint Pro members also get $200 in free credits to spin up a first server and try it themselves. We may earn a commission at no extra cost to you.

Basic Usage

Run ani-cli without any arguments to open its interactive search prompt:

ani-cli

This opens an interactive search prompt. Type the name of an anime and press Enter. ani-cli uses fzf to display the search results, so you can move through the list with the arrow keys or start typing to narrow it down.

After selecting a title, ani-cli shows the available episodes. Choose an episode, and the selected stream is passed to mpv for playback.

You can also provide the anime title directly on the command line:

ani-cli "one piece"

This skips the initial search prompt and searches for the title immediately.

Keep in mind that ani-cli depends on an external source for its search results. If you see “No results found!” it doesn’t necessarily mean that the anime is unavailable or that you entered the title incorrectly. The upstream source can change, become temporarily unavailable, or block requests, which can cause searches to fail.

If you want to see the options available in your installed version, run:

ani-cli --help

For example, you can use -q to request a specific video quality, -e to select particular episodes, --dub to search for dubbed versions, or -v to use VLC instead of mpv.

The simplest workflow is therefore:

Search → Select anime → Select episode → Play

Once that basic workflow is working, you can use ani-cli’s other options to control quality, episode selection, playback, and downloading.

Setting Video Quality

Use -q followed by the resolution you want:

ani-cli -q 1080 "one piece"

ani-cli will try to use the requested quality when it is available. If that resolution isn’t available for an episode, it uses the best quality the source provides.

Switching to VLC

mpv is the default media player, but you can use VLC instead by adding the --vlc option:

ani-cli --vlc "one piece"

If you prefer VLC every time, you can set it as the default in your shell profile, such as ~/.bashrc or ~/.zshrc:

export ANI_CLI_PLAYER=vlc

After adding the variable, reload your shell profile or open a new terminal.

Downloading Episodes

Use -d when you want to download an episode instead of streaming it:

ani-cli -d "one piece"

By default, downloaded files are saved in the current working directory. You can set ANI_CLI_DOWNLOAD_DIR in your shell profile if you want to use a different download location.

Downloading Multiple Episodes

You can combine -d with -e to download a range of episodes:

ani-cli -d -e 1-50 "one piece"

Here:

  • -d – downloads the episodes instead of streaming them.
  • -e 1-50 – selects episodes 1 through 50.
  • "one piece" – specifies the anime you want to search for.

Downloading a large range can take a while, depending on your internet connection and the number of episodes, so start with a smaller range if you’re testing the feature.

If the bulk-download option just saved you from downloading 50 episodes one at a time, share this guide with someone who’s doing exactly that right now.
If shell commands like these are new to you, the 100+ Essential Linux Commands course on Pro Tecmint builds your Linux fundamentals step by step.

Common Mistake: Cloudflare Blocking

If ani-cli shows Blocked by cloudflare. Try installing curl-impersonate, it means the source site is blocking requests made by regular curl. This can happen when the site detects that the request does not look like it came from a normal web browser.

Installing curl-impersonate can help because it makes curl behave more like a real browser when connecting to the site. You can install it through your distribution’s package manager if it’s available, or install it manually if your distribution doesn’t provide a package.

After installing it, run your ani-cli search again. If the source is accessible and the request is no longer blocked, the search should work normally.

Common Mistake: Stale Version Errors

ani-cli relies on a live website, so changes to the site’s structure can sometimes break things that were working before. If ani-cli suddenly stops working after an update to the source site, the first thing to try is updating ani-cli itself.

sudo ani-cli -U

Here, -U updates the local ani-cli script to the latest version available on GitHub. The update process uses the patch utility mentioned earlier.

On Windows, run the update without sudo. On other supported platforms, you may need sudo because ani-cli is usually installed in a system directory that requires root permissions to modify.

Keeping Intros Under Control

ani-cli doesn’t skip openings by itself. You can pair it with ani-skip to automatically skip intros and outros.

This works with mpv, because ani-skip relies on mpv’s Lua scripting support. It does not currently have a Windows-compatible build. You can find the installation instructions in the ani-skip repository.

If this saved you from digging through GitHub issues to find the Cloudflare workaround, share it with someone dealing with the same error.

Uninstalling ani-cli

How you remove ani-cli depends on how you installed it. If you installed it through a package manager, use the corresponding removal command:

sudo apt remove ani-cli

On Fedora:

sudo dnf remove ani-cli

On Arch-based distributions:

yay -R ani-cli

If you installed ani-cli from source, remove the script from /usr/local/bin:

sudo rm "/usr/local/bin/ani-cli"

That’s all you need to remove from a source installation. The dependencies you installed separately can stay on your system, since other command-line tools may use them.

If this made your terminal media setup a little more useful, share it with someone who’s still juggling five browser tabs to watch a single show.
Conclusion

ani-cli makes anime streaming from the terminal simple: search, choose an episode, and start watching. In this guide, you’ve learned how to install it on Debian, Fedora, and Arch, switch between subbed and dubbed versions, choose video quality and your preferred media player, and download individual episodes or a range of episodes with -e.

Give it a try with:

ani-cli -q 1080 --dub "your favorite show"

It’s a quick way to see how a terminal-based workflow compares with opening a browser, dealing with ads, and searching through multiple pages just to find an episode.

Have you run into the Cloudflare block or a stale-script error while using ani-cli? Share what fixed it for you in the comments. It might save someone else from going through the same troubleshooting process.

If this article helped, with someone on your team.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.
TecMint has been free for 14 years. Help keep it that way.
Google AI Overviews and tools like ChatGPT have cut into search traffic for independent tech sites like TecMint. Running this site costs over $2,000 every month for hosting, infrastructure, and paying authors to keep the content accurate and tested.

There are two ways to help:
Ravi Saive
I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Free Course
Get a free Linux course before you go.
Subscribe to TecMint Weekly and get the Learn Linux 7 Days Crash Course free. Read by 34,000+ Linux professionals every Thursday.
Something went wrong. Please try again.
Check your email for a magic link to get started.