A terminal tool that installs packages from mirrors, benchmarks, and reports results, all with both simple TUI and CLI.
| Registry | Package Manager |
|---|---|
| PyPi | pip, uv |
| npm | npm |
- Install packages from mirrors. Switch to a different mirror if fails.
- Benchmarks mirrors and ranks them by dowload speed.
- Interactive keyboard-only TUI built with
ratatui.
Pickup desired binary from the releases Or build from source:
- Make sure you have Rust (stable) installed via rustup
git clone https://github.com/pasta-engineers/ayeneh.git
cd ayeneh
make
# or
cargo buildThe project ships two binaries:
ayeneh-cli— non-interactive CLI, suitable for CI pipelines, Docker images, and shell scripting.ayeneh-tui— interactive Ratatui application.
Get help:
ayeneh-cli --help
ayeneh-cli pip --help
ayeneh-cli npm --helpRuntime behavior can be tuned without rebuilding:
| Variable | Meaning | Default |
|---|---|---|
AYN_DATA_DIR |
Directory holding pypi.json/npm.json |
./data |
AYN_REPORTS_DIR |
Directory for generated reports | auto-detected reports/ |
AYN_TIMEOUT |
Per-attempt HTTP timeout (seconds) | 15 |
AYN_ATTEMPTS |
Benchmark attempts per mirror | 3 |
AYN_SCHEDULE_INTERVAL_SECS |
Delay between scheduler cycles (seconds) | 3600 |
The numeric variables fall back to their default if unset or given a non-numeric, zero, or negative value.
Launch the TUI:
ayeneh-tuiIn TUI, you can:
- Run benchmarks
- Reorder mirrors based on benchmark results, so faster mirrors are listed first in installation processes
- Add/remove mirrors manually CLI features are available in TUI as well.
Install python packages from mirrors:
ayeneh-cli pip install <package>or install from requirements file:
ayeneh-cli pip install -r requirements.txtInstall npm packages from mirrors:
ayeneh-cli npm install <package>Run a one-off benchmark from the command line:
ayeneh-cli run pypi
ayeneh-cli run npmGenerate a JSON report for both package managers:
ayeneh-cli reportRun the hourly scheduler (keeps benchmarking forever):
ayeneh-cli schedulereports/2026-07-12_14-30.json:
{
"package_manager": "pypi",
"generated_at": "2026-07-12T14:30:00+00:00",
"results": [
{ "mirror": "https://pypi.org/simple/", "latency": 120, "success": 100.0 },
{ "mirror": "https://mirror.example1/simple/", "latency": 180, "success": 100.0 }
],
"best": "https://pypi.org/simple/"
}pypi.json and npm.json each define the sample package to download during
benchmarking and the list of mirrors to test it against. By default, the
program reads them from ./data:
{
"package": "requests",
"mirrors": [
"https://pypi.org/simple/",
"https://pypi.devneeds.ir/simple/",
"https://package-mirror.liara.ir/repository/pypi/"
]
}Set AYN_DATA_DIR when the registry files are stored elsewhere:
AYN_DATA_DIR=/opt/mirror/registries ayeneh-cli run pypiEdit these JSON files to add or remove mirrors, or to change the package used for benchmarking. Mirror lists are configured statically — no network scraping is performed to discover them.
A Python-based image is provided that ships the prebuilt ayeneh-cli binary
alongside the mirror registry config, so it can be used directly as a base for
installing packages or benchmarking. Build it from the repository root (a
release binary must already exist):
cargo build --release -p ayeneh-cli
docker build -f docker/Dockerfile.python -t ayeneh-cli .Run it, or extend it in your own Dockerfile to install packages from mirrors:
docker run --rm ayeneh-cli ayeneh-cli pip install requestsFROM ayeneh-cli
RUN ayeneh-cli pip install -r requirements.txtA Node.js-based image is provided for npm. Build it the same way (a release binary must already exist):
docker build -f docker/Dockerfile.npm -t ayeneh-cli-npm .Run it, or extend it in your own Dockerfile to install packages from npm mirrors:
docker run --rm ayeneh-cli-npm ayeneh-cli npm install lodashFROM ayeneh-cli-npm
RUN ayeneh-cli npm install lodash express
