Metadata-Version: 2.4
Name: envready
Version: 0.1.2
Summary: Check whether a development environment matches project requirements
Author-email: Hikaro <1cz1@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/1cz1/envready
Project-URL: Repository, https://github.com/1cz1/envready
Project-URL: Issues, https://github.com/1cz1/envready/issues
Keywords: cli,environment,devtools,tooling,developer-tools
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: questionary<3,>=2.1
Requires-Dist: rich<15,>=13.0
Provides-Extra: dev
Requires-Dist: pytest<9,>=8.0; extra == "dev"
Dynamic: license-file

# envready

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

[![Python](https://img.shields.io/badge/python-%3E%3D3.11-blue?logo=python&logoColor=white)](https://www.python.org/)
[![PyPI](https://img.shields.io/pypi/v/envready)](https://pypi.org/project/envready/)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![GitHub](https://img.shields.io/badge/github-1cz1%2Fenvready-181717?logo=github)](https://github.com/1cz1/envready)

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](https://github.com/Textualize/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

```mermaid
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

```text
envcheck/
├── src/
│   └── envready/
│       ├── 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

```bash
pip install envready
```

Or install from source:

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

Dev extras (includes pytest):

```bash
pip install -e ".[dev]"
```

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

```bash
python -m envready
```

## ⚙️ Configuration

Create an `envcheck.toml` in your project root:

```toml
[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):

```bash
envready
```

Or via the module:

```bash
python -m envready
```

### 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

```bash
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.

- 🐙 GitHub: [@1cz1](https://github.com/1cz1)
- 📸 Instagram: [@Hikaro.yy](https://instagram.com/Hikaro.yy)
