Hatch
$ hatch Foundation Med RiskHatch (hatch) is PyPA's modern Python project manager built around standard pyproject.toml metadata and the Hatchling PEP 517 backend. It manages isolated environments, multi-version test matrices, formatting/linting, and exposes structured environment metadata via hatch env show --json.
brew install hatch hatch orchestrates local Python build backends, virtualenvs, and hatch test matrices directly in the workspace.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Provides hatch env show --json, --no-color / NO_COLOR=1, non-interactive hatch run / hatch test, and clear exit codes.
hatch env show --jsonexposes environment configs in JSONhatch --no-colordisables ANSI sequences globally
Isolates environments outside the repository by default and reads publish secrets via keyring or HATCH_INDEX_AUTH env vars.
- Managed virtualenvs avoid polluting project trees
- Supports
HATCH_INDEX_AUTHscoped env authentication forhatch publish
Available via Homebrew, PyPI, pipx, uvx, and standalone installers on macOS, Linux, and Windows.
- Standalone installers and Homebrew formula available cross-platform
Combines PEP 517 builds, uv-backed fast environment creation, test matrices, and ruff-powered hatch fmt.
- Optional
installer = "uv"speeds up managed environment creation
Official PyPA project (pypa/hatch) under MIT license.
- PyPA-governed
pypa/hatchrepository
Well-documented CLI reference and configuration schema at hatch.pypa.io.
- Official CLI reference at hatch.pypa.io/latest/cli/reference
Security, Auth & Guardrails
Stores PyPI publishing credentials in OS keyring or config.toml, and supports HATCH_INDEX_USER / HATCH_INDEX_AUTH env vars.
MIT open-source CLI maintained by PyPA; free to use.
# Hatch Agent Rules - Run `hatch env show --json` to inspect environment names and scripts before calling `hatch run`. - Set `NO_COLOR=1` and never run `hatch publish` without explicit user approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
hatch env show --json
Exports all defined Hatch environments, matrices, scripts, and dependencies in JSON.
hatch version
Reads the resolved project version from pyproject.toml or dynamic VCS/file source.
Controlled Writes & Previews
hatch build --clean
Rebuilds source and wheel distributions under dist/ without publishing.
Strengths for Agents
- +
hatch env show --jsonreveals exact scripts, dependencies, and matrix variants. - + Follows standard
pyproject.toml(PEP 621 / 517) without proprietary lock-in. - + Built-in
hatch testandhatch fmtstreamline Python CI loops.
Caveats & Pitfalls
- ! Does not provide a universal
--dry-runflag onhatch buildorhatch env create. - ! Managed virtualenvs live in user data dirs unless customized, which can surprise tools expecting
.venv.