mirago
Catch the fake package names AI coding tools make up — before you try to install them.
Status: 0.1.0 — beta. It works and it's useful; it's also early, so expect rough edges and tell us what's missing.
What it does (in plain words)
When you ask an AI tool (Copilot, Cursor, Claude, and others) to write Python code, it sometimes
imports a package that doesn't actually exist — it made the name up. If you try to install it,
you waste time chasing a package that was never real.
mirago reads your code, looks at every package it imports, and checks each one against PyPI (the official Python package index). It tells you about two kinds of problem:
- Doesn't exist — the AI invented the name. (An error.)
- Exists but looks risky — the name is real, but it was created very recently and is barely downloaded and isn't already used in your project. (A warning — could be a copycat package.)
mirago check your_file.py
If something's fake, you'll see:
🚨 1 hallucination in your_file.py
Line 1: import fastjson_validator
→ Package 'fastjson_validator' does not exist on PyPI
If everything looks fine, mirago stays quiet (just a short summary).
Install
mirago is a command-line tool. The easiest way is pipx, which installs CLI tools in their own isolated environment:
pipx install mirago
Or with plain pip:
pip install mirago
Requirements: Python 3.10 or newer. mirago works the same on Windows, macOS, and Linux (it's pure Python).
Platform notes
- macOS / Linux: install pipx with
pip install --user pipx(orbrew install pipxon macOS), thenpipx install mirago. - Windows: in PowerShell,
py -m pip install --user pipxthenpy -m pipx install mirago. Make sure Python is on your PATH (the official python.org installer has a checkbox for this).
Usage
mirago check your_file.py # check one file
mirago check . # check this folder and everything under it
mirago check src/ # check a folder
When you point it at a folder, mirago checks every .py file inside it, skipping noise like
.venv, .git, caches, and build folders.
Handy options:
| Option | What it does |
|---|---|
--fix |
Offer to fix a misspelled package name (requets → requests). |
--fail-on warning |
Make the run fail (exit 1) on warnings too, not just errors. |
--json |
Print results as JSON, for use by other tools or CI. |
--no-cache |
Skip the saved results and re-check against PyPI. |
The exit code is 1 when problems are found and 0 when clean, so mirago drops straight into
automated checks (CI).
What it catches — and what it doesn't (yet)
Catches today:
- Package names that don't exist on PyPI (names an AI made up).
- Real-but-risky packages (brand-new + barely downloaded + not already in your project).
- Common typos of popular packages, with a suggested fix.
Doesn't catch yet (planned):
- Fake function or method names inside real packages (e.g. a method that doesn't exist).
- Editor / IDE integrations — there are none yet; mirago is a command-line tool for now.
- Catching mistakes live, as an AI assistant writes them.
A safety note: if PyPI can't be reached, mirago assumes your packages are fine rather than raising a false alarm. It would rather miss occasionally than cry wolf.
Contributing
Issues and pull requests are welcome. To work on mirago locally:
git clone https://github.com/ddsyasas/mirago
cd mirago
# Install with the developer tools
pip install -e ".[dev]"
# Run the tests (tests needing live PyPI are skipped by default)
pytest
# Try it on the bundled examples
mirago check tests/fixtures/good.py
mirago check tests/fixtures/bad.py
See docs/DEVLOG.md for a plain-language history of what changed and why, and CHANGELOG.md for the release notes.
License
MIT. See LICENSE.
Metadata
Release files for mirago 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mirago-0.1.0.tar.gz | 23.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mirago-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.9 kB
Release files / mirago-0.1.0.tar.gz
| Download URL | mirago-0.1.0.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ad3c827bac9a6ad748b0031361f20f0111c1d994e9dba45754e5502754a8f70
|
|
BLAKE2b-256 checksum How to use checksums |
78eb1024ff5bad090c38a5b75a9fd5bfcae63da4d236159cbd66475482acfcf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / mirago-0.1.0-py3-none-any.whl
| Download URL | mirago-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c29cf21ae3e20b921174ba62d770ac3849dc7859139b9d26dc65a594140b290
|
|
BLAKE2b-256 checksum How to use checksums |
41f0a388f91c12150289cfdeb619fde9d27545b96a4b454faa69acc32fb3258e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Security for mirago 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.