Skip to main content

envcheck

A small CLI that checks whether your machine is ready to work on a given project.

Python PyPI License GitHub

You drop an envcheck.toml in your project root listing what's required — a Python version, CLI tools, environment variables — and running envcheck tells you what's missing.

  Environment Check

✓ Python 3.13.7 meets the required version >=3.12.
✓ Required command 'git' is available.
✗ Required command 'docker' was not found.
✗ Required environment variable 'API_KEY' is missing.

Exit code 0 means everything passed. Exit code 1 means something's missing. Pipe-friendly.


✨ Features

  • Checks the running Python version against a minimum requirement
  • Verifies that CLI tools (git, node, docker, etc.) are on PATH
  • Checks that required environment variables are set
  • Color-coded output via rich
  • If no config file is found, prompts you to create one interactively
  • All config sections are optional — only checks what you list

🧠 How it works

flowchart LR
    A[envcheck.toml] --> B[config/loader.py]
    B --> C[core/runner.py]
    C --> D[checks/]
    D --> E[output/terminal.py]
    E --> F[Terminal]

The loader reads envcheck.toml, the runner dispatches to the three checkers (python, commands, environment), and the output layer prints the results. Each layer does one thing.

📁 Project structure

envcheck/
├── src/
│   └── envcheck/
│       ├── checks/
│       │   ├── commands.py       # shutil.which checks
│       │   ├── environment.py    # os.getenv checks
│       │   └── python.py         # sys.version_info check
│       ├── cli/
│       │   ├── commands.py       # main() entry point
│       │   └── prompts.py        # interactive config creation prompt
│       ├── config/
│       │   └── loader.py         # reads envcheck.toml via tomllib
│       ├── core/
│       │   ├── models.py         # CheckResult, ProjectConfig dataclasses
│       │   └── runner.py         # coordinates checks
│       ├── output/
│       │   ├── helper.py         # rich console wrappers
│       │   └── terminal.py       # renders CheckResult list
│       └── __main__.py
├── envcheck.toml                 # config for this repo itself
└── pyproject.toml

🚀 Installation

pip install envready

Or install from source:

git clone https://github.com/1cz1/envcheck.git
cd envcheck
pip install -e .

Dev extras (includes pytest):

pip install -e ".[dev]"

After installing, the envready command is available globally, or you can run it as a module:

python -m envcheck

⚙️ Configuration

Create an envcheck.toml in your project root:

[python]
version = ">=3.12"

[commands]
required = ["git", "node", "docker"]

[environment]
required = ["API_KEY", "DATABASE_URL"]

All three sections are optional. If a section is absent, those checks are skipped entirely.

Section Key Description
[python] version Minimum Python version, e.g. ">=3.12"
[commands] required List of CLI tools that must be on PATH
[environment] required List of environment variable names that must be set

If envcheck.toml doesn't exist when you run the command, you'll be prompted to create an empty one.

▶️ Usage

Run from the project root (where envcheck.toml lives):

envready

Or via the module:

python -m envcheck

Exit codes

Code Meaning
0 All checks passed
1 One or more checks failed
2 Config file missing and creation declined, or unreadable TOML

🧪 Tests

pytest

The pythonpath and testpaths are configured in pyproject.toml, so no extra flags needed.

🤝 Contributing

This is an early-stage project. If you find a bug or want to add a new check type, open an issue or a PR. Keep new checkers consistent with the pattern in checks/ — they should return a CheckResult, not print or raise.

📄 License

MIT


Author

Built by Hikaro — cybersecurity enthusiast and developer.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envready-0.1.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envready-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file envready-0.1.1.tar.gz.

File metadata

  • Download URL: envready-0.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for envready-0.1.1.tar.gz
Algorithm Hash digest
SHA256 262bb1f05e71cb77771bbcd5401e8670f9f9d8ff4c3eebd68b34dc9a634f490f
MD5 39f2ee2ea55ac1833ebe26410aa405e4
BLAKE2b-256 ce5c7c63344aa0a1e896d1072f8563332eb1c9892499fd8a27c6efcd5f5a9582

See more details on using hashes here.

File details

Details for the file envready-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: envready-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for envready-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81811d5e03ac91f27e8aeeb8dc4a1f6de32be5ca488bb84bf559ee9de3a69cee
MD5 ac2019ec80ff714edfd415cebb6d1542
BLAKE2b-256 e60ebd63c37235f9d2f47caaf03a7fc74d6fa626b111e93a7829e9c6a072525f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page