ani-cli-rs 0.11.1

Cross-platform Rust port of ani-cli with Anikoto providers and a reusable provider/playback library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610

<div align="center">

# ani-cli-rs

**A fast, cross-platform anime CLI written in Rust.**

Search, stream, and download anime directly from your terminal with native playback, multiple Anikoto catalogs, and support for MegaPlay/KotoCDN sources.

[![Documentation](https://img.shields.io/badge/docs-online-blue?style=flat-square)](https://vorlie.github.io/ani-cli-rs/)
[![GitHub](https://img.shields.io/github/stars/vorlie/ani-cli-rs?style=flat-square)](https://github.com/vorlie/ani-cli-rs)
[![License](https://img.shields.io/github/license/vorlie/ani-cli-rs?style=flat-square)](LICENSE)
[![Discord](https://img.shields.io/discord/F7EFsnvz8g?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/F7EFsnvz8g)

Crates:
[![Crates.io Version](https://img.shields.io/crates/v/ani-cli-rs?style=flat-square)](https://crates.io/crates/ani-cli-rs)
[![Crates.io Total Downloads](https://img.shields.io/crates/d/ani-cli-rs?style=flat-square)](https://crates.io/crates/ani-cli-rs)

Github:
[![Latest Release](https://img.shields.io/github/v/release/vorlie/ani-cli-rs?style=flat-square)](https://github.com/vorlie/ani-cli-rs/releases)
[![Downloads](https://img.shields.io/github/downloads/vorlie/ani-cli-rs/total?style=flat-square)](https://github.com/vorlie/ani-cli-rs/releases)

[**Documentation**](https://vorlie.github.io/ani-cli-rs/) ยท
[**Installation**](https://vorlie.github.io/ani-cli-rs/guides/installation/) ยท
[**CLI Reference**](https://vorlie.github.io/ani-cli-rs/reference/cli/) ยท
[**Contributing**](CONTRIBUTING.md) ยท
[**Discord**](https://discord.gg/F7EFsnvz8g)

</div>

![Automated ani-cli-rs showcase](docs/assets/ani-cli-rs-showcase.gif)

---

## What is ani-cli-rs?

`ani-cli-rs` is an independent Rust implementation inspired by [ani-cli](https://github.com/pystardust/ani-cli).

It provides the familiar interactive terminal experience across **Windows, Linux, macOS, and Termux**, while using a native Rust implementation for searching, provider resolution, playback, downloads, and local HLS handling.

Unlike the original Bash project, the executable is intentionally named `ani-cli-rs` and the underlying functionality is also available as the `ani_lib` Rust library.

### Highlights

* ๐Ÿฆ€ Native Rust implementation
* ๐Ÿ–ฅ๏ธ Windows, Linux, macOS, and Termux support
* ๐Ÿ”Ž Interactive anime and episode search
* ๐ŸŒ Two independent Anikoto catalogs
* ๐ŸŽฌ Native MegaPlay source extraction
* ๐Ÿ“ก Local KotoCDN HLS relay
* ๐Ÿ’ฌ External provider subtitle support
* โฌ‡๏ธ Parallel and fallback download support
* ๐Ÿ“บ mpv, IINA, VLC, Android mpv, and Syncplay
* ๐Ÿค– Scriptable commands with JSON output
* ๐Ÿ“š Reusable Rust library API

---

## Community

ani-cli-rs is built in the open and improved through code, bug reports, documentation, testing, and provider work.

### Discord

For support, troubleshooting, provider issues, join the [ani-cli Discord](https://discord.gg/F7EFsnvz8g) and use `#support`.

<div align="center">

**โญ Star the project if you find it useful**

[![GitHub stars](https://img.shields.io/github/stars/vorlie/ani-cli-rs?style=for-the-badge)](https://github.com/vorlie/ani-cli-rs)
[![GitHub forks](https://img.shields.io/github/forks/vorlie/ani-cli-rs?style=for-the-badge)](https://github.com/vorlie/ani-cli-rs)
[![GitHub contributors](https://img.shields.io/github/contributors/vorlie/ani-cli-rs?style=for-the-badge)](https://github.com/vorlie/ani-cli-rs/graphs/contributors)

</div>

### Contributors

Thank you to everyone who has contributed code, fixes, ideas, documentation, testing, and feedback.

---

## Quick start

### Search and watch

```console
ani-cli-rs "frieren"
```

### Common commands

```console
ani-cli-rs --dub -q 720p "cowboy bebop"

ani-cli-rs -e 2-4 "one piece"

ani-cli-rs --continue

ani-cli-rs --download "anime title"

ani-cli-rs --allow-adult "search query"

ani-cli-rs --provider anikoto2 "black torch"
```

### Termux

```sh
ani-cli-rs "cyberpunk"

ani-cli-rs --vlc "cyberpunk"
```

See the **[CLI reference](https://vorlie.github.io/ani-cli-rs/reference/cli/)** for all commands, options, environment variables, JSON workflows, and keyboard controls.

---

## Features

### Playback

* Interactive anime, season, and episode selection
* Subbed and dubbed results
* Quality selection
* Episode ranges and multi-selection
* Playback history and continuation
* Next, previous, replay, and episode-selection controls
* mpv, IINA, VLC, Android mpv, and Syncplay
* Optional `--exit-after-play` and `--no-detach` modes

### Providers

* Independent Anikoto API and Anikoto.cz catalogs
* Native MegaPlay source extraction
* Transparent KotoCDN HLS handling
* Provider subtitles exposed as normal HLS subtitle tracks
* Provider-aware IDs and history entries
* Explicit provider selection without silent catalog switching

### Downloads

* Batch episode resolution before transfers begin
* aria2 parallel downloads
* yt-dlp and FFmpeg fallbacks
* HLS downloads
* Provider subtitle embedding into MP4 where supported

### Automation

Commands can return machine-readable JSON for scripting and integrations:

```console
ani-cli-rs search --json "frieren"

ani-cli-rs episodes --json SHOW_ID --mode sub

ani-cli-rs links --json SHOW_ID 1 --quality 1080p

ani-cli-rs play SHOW_ID 1 --title "Frieren" --no-detach

ani-cli-rs download SHOW_ID 1 --output ./downloads

ani-cli-rs update --check
```

`episodes`, `links`, `play`, and `download` expect the show ID returned by `search`.

---

## Installation

Official releases are currently provided for:

| Platform     | Distribution     |
| ------------ | ---------------- |
| Windows x64  | Prebuilt release |
| Linux x86-64 | Prebuilt release |
| macOS        | Source build     |
| Termux       | Source build     |
| Linux ARM64  | Source build     |

Prebuilt macOS, Android/Termux, and Linux ARM64 binaries are not currently published.

### Linux

```sh
curl -fsSL https://raw.githubusercontent.com/vorlie/ani-cli-rs/master/scripts/install.sh -o install.sh
sh install.sh
rm install.sh
```

### Windows PowerShell

Portable installation:

```powershell
Invoke-WebRequest https://raw.githubusercontent.com/vorlie/ani-cli-rs/master/scripts/install.ps1 -OutFile install.ps1
.\install.ps1
Remove-Item .\install.ps1
```

For the Inno Setup installer:

```powershell
.\install.ps1 -UseSetup
```

### Android / Termux

```sh
pkg update
pkg install git rust termux-tools

git clone https://github.com/vorlie/ani-cli-rs.git
cd ani-cli-rs

cargo build --release --locked
install -Dm755 target/release/ani-cli-rs "$PREFIX/bin/ani-cli-rs"
```

Install an Android video player such as mpv-android or VLC from an Android app source.

> **Do not use `pkg install vlc`.**
> That installs a terminal VLC build rather than the Android VLC application used by this integration.

The installation scripts verify release archives against their published SHA-256 checksums and install to `~/.local/bin` by default.

For PATH configuration, custom installation locations, uninstalling, and source builds, see the **[installation guide](https://vorlie.github.io/ani-cli-rs/guides/installation/)**.

---

## Requirements

### Desktop

* **Linux / Windows:** [mpv]https://mpv.io/ for default playback
* **macOS:** [IINA]https://iina.io/ for tested out-of-the-box playback

  * `brew install --cask iina`

Optional:

* [VLC]https://www.videolan.org/vlc/
* [Syncplay]https://syncplay.pl/
* [aria2]https://aria2.github.io/
* [yt-dlp]https://github.com/yt-dlp/yt-dlp
* [FFmpeg]https://ffmpeg.org/

Desktop programs must be available through `PATH`.

### Termux

Tested Android playback options include:

* mpv-android
* VLC
* Amnis
* Samsung Video Player

On Termux, normal playback uses mpv-android. `--vlc` requests Android VLC when the explicit activity bridge works; otherwise ani-cli-rs falls back to Android's media handler through `termux-open`.

See **[Playback and Players](https://vorlie.github.io/ani-cli-rs/guides/playback-and-players/)** and **[Downloads](https://vorlie.github.io/ani-cli-rs/guides/downloads/)** for details.

---

## CLI compatibility

The primary interface follows Bash ani-cli conventions:

```text
ani-cli-rs [OPTIONS] [QUERY]
```

Common compatibility options include:

```text
-c, --continue           Continue from history
-d, --download           Download instead of play
-D, --delete             Delete history
-s, --syncplay           Use Syncplay
-S, --select-nth         Select the nth search result
-q, --quality            best, worst, or a resolution
-v, --vlc                Use VLC
-e, --episode            Episode or range
-r, --range              Episode range alias
-a, --allow-adult        Include adult results
-N, --nextep-countdown   Show release timing
-U, --update             Update from GitHub Releases
-p, --provider           anikoto or anikoto2

    --dub                Use dubbed results
    --multi-selection    Select multiple episodes
    --no-detach          Keep the player attached
    --exit-after-play    Skip the post-playback menu
```

Run:

```console
ani-cli-rs --help
```

for the authoritative list.

---

## Rust library

The provider and playback functionality is also available as the `ani_lib` Rust library.

This allows applications to integrate ani-cli-rs provider resolution directly instead of spawning the CLI as a subprocess.

```toml
[dependencies]
ani-cli-rs = "0.9.6"
```

Example:

```rust
use ani_lib::{
    AnikotoCzClient,
    TranslationType,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = AnikotoCzClient::new()?;

    let results = client
        .search("Frieren", TranslationType::Sub)
        .await?;

    for result in results {
        println!("{}", result.name);
    }

    Ok(())
}
```

The library exposes the APIs used by the CLI for:

* Provider and catalog access
* Search and stream resolution
* Playback
* Downloads
* History
* HLS relay
* Internationalization
* Shared data models

### Public API

The current public API includes:

* `AnikotoClient`
* `AnikotoClientBuilder`
* `AnikotoCzClient`
* `AnikotoCzClientBuilder`
* `SearchResult`
* `StreamLink`
* `SubtitleTrack`
* `TranslationType`
* `SearchOptions`
* `CatalogProvider`
* `HlsRelay`
* `relay_stream`
* `relay_stream_without_hls_subtitles`
* `download_stream`
* `HistoryStore`
* `HistoryEntry`
* `Player`
* `PlayerKind`
* `PlayerOptions`
* `I18n`
* `Locale`

For application integration, see the **[Rust library integration guide](https://vorlie.github.io/ani-cli-rs/development/using-as-a-library/)**.

---

## Kioku

**[Kioku](https://github.com/vorlie/kioku)** is a native desktop AniList manager built around `ani-cli-rs`.

It combines AniList library management with integrated anime search and media playback without requiring a separate player application.

> [!NOTE]
> Kioku is currently in early development and is **not feature-complete**. Expect incomplete features, UI changes, and breaking changes.

---

## Provider architecture

ani-cli-rs currently supports two independent catalogs:

```text
Anikoto API
    โ””โ”€โ”€ anikoto:<id>

Anikoto.cz
    โ””โ”€โ”€ anikoto2:<slug>
```

The prefixes are preserved through search, episode resolution, playback, and history so the correct catalog can be selected automatically.

The catalogs are intentionally **not merged**, and playback never silently switches between them.

To change the default interactive provider:

```sh
ANI_CLI_RS_PROVIDER=anikoto2 ani-cli-rs "black torch"
```

Provider internals are documented in:

* [`docs/ANIKOTO-KOTOCDN.md`]docs/ANIKOTO-KOTOCDN.md
* [`docs/ANIKOTO-CZ.md`]docs/ANIKOTO-CZ.md

---

## Security and diagnostics

Official Windows binaries are currently unsigned and may trigger SmartScreen or heuristic antivirus warnings.

ani-cli-rs performs network requests, launches media players and downloaders, and temporarily creates a loopback HLS relay for KotoCDN playback. These behaviors may produce misleading automated classifications.

Release installers verify published checksums.

For diagnostic logging:

```powershell
$env:RUST_LOG = "ani_cli_rs=debug,ani_cli=debug"
ani-cli-rs "cyberpunk edgerunners"
```

```bash
RUST_LOG=ani_cli_rs=debug,ani_cli=debug ani-cli-rs "cyberpunk edgerunners"
```

Use `trace` instead of `debug` for full stream-resolution and relay tracing.

See **[Security and Privacy](https://vorlie.github.io/ani-cli-rs/development/security/)** for manual verification and privacy details.

---

## Development

ani-cli-rs uses Rust 2024 and requires a current stable Rust toolchain.

```console
cargo build --release

cargo fmt --check

cargo check --all-targets

cargo clippy --all-targets -- -D warnings

cargo test
```

The repository also contains a deterministic showcase generator that produces the terminal recording, screenshots, and README GIF without contacting anime providers:

```powershell
.\showcase\showcase.ps1
```

See **[Building and Releasing](https://vorlie.github.io/ani-cli-rs/development/building/)** and the **[showcase guide](showcase/README.md)** for more information.

---

## Documentation

The complete documentation is available at:

**https://vorlie.github.io/ani-cli-rs/**

It covers:

* Installation
* Configuration
* Playback and players
* Downloads
* CLI commands
* JSON automation
* Provider internals
* HLS relay behavior
* Library integration
* Development
* Security and privacy
* Troubleshooting

Documentation lives alongside the source code in [`website/docs/`](website/docs/index.md), so documentation changes can be reviewed together with code changes.

---

## Troubleshooting

When something goes wrong, first identify which stage failed:

```text
Installation / PATH
        โ†“
Search / episode discovery
        โ†“
Provider resolution
        โ†“
Source resolution
        โ†“
KotoCDN / HLS relay
        โ†“
Player launch
        โ†“
Download transfer
        โ†“
Finalization
```

This distinction matters: reinstalling ani-cli-rs will not fix a provider outage, and changing players will not fix an episode that failed during source resolution.

### Error codes

ani-cli-rs uses stable error codes to make failures easier to understand and report. Error codes follow the format `ACL-xxxx`:

- **ACL-1xxx**: Network / provider errors
- **ACL-2xxx**: Search / anime / episode errors  
- **ACL-3xxx**: Streaming / source errors
- **ACL-4xxx**: Download errors
- **ACL-5xxx**: Playback errors
- **ACL-6xxx**: Filesystem / configuration errors
- **ACL-7xxx**: Authentication / external services
- **ACL-9xxx**: Internal / unexpected errors

When reporting issues, always include the error code (e.g., `ACL-3001`) along with the complete error message.

Example error output:
```
error[ACL-3001]: No playable sources found

No playable sources were found for episode 7.

help: Try another provider or try again later.
docs: https://vorlie.github.io/ani-cli-rs/errors#ACL-3001
```

For a complete error code reference with causes and solutions, see the **[Error codes documentation](https://vorlie.github.io/ani-cli-rs/errors/)**.

See the **[Troubleshooting guide](https://vorlie.github.io/ani-cli-rs/support/troubleshooting/)** for diagnostic steps and logging information.

---

## Scope

ani-cli-rs currently targets:

* Windows
* Linux
* macOS source builds
* Termux source builds

The following are intentionally outside the current scope:

* iSH adapters
* rofi/dmenu integration
* Intro skipping
* System-journal logging

---

## Media hosting and legal notice

`ani-cli-rs` does **not** host, mirror, or distribute media.

The application retrieves search and stream information from third-party providers and passes resolved streams to the user's selected playback or download tool.

For HLS sources requiring local processing, ani-cli-rs can create a temporary loopback relay on the user's device. This relay is local and is not an internet-facing media proxy.

Users are responsible for complying with applicable laws and the terms of service of the services they access.

See [`DMCA.md`](DMCA.md) for the project's copyright and takedown policy.

---

## Contributing

Contributions are welcome.

You can help by:

* Reporting bugs
* Improving documentation
* Adding tests
* Improving provider handling
* Fixing playback or download issues
* Improving cross-platform support
* Contributing to the Rust library
* Reviewing pull requests

See [`CONTRIBUTING.md`](CONTRIBUTING.md) to get started.

Security issues should be reported according to [`SECURITY.md`](SECURITY.md).

---

## License

Licensed under [GPL-3.0-only](LICENSE).