Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Hatch

$ hatch Foundation Med Risk
PyPA · Code & DevOps · MIT · macos / linux / windows

Hatch (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.

FCRS-1.0 Score
85 /100
Good
Medium Confidence
Zero-Friction Install
brew install hatch
CLI vs MCP Decision CLI Preferred vs MCP

hatch orchestrates local Python build backends, virtualenvs, and hatch test matrices directly in the workspace.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Provides hatch env show --json, --no-color / NO_COLOR=1, non-interactive hatch run / hatch test, and clear exit codes.

  • hatch env show --json exposes environment configs in JSON
  • hatch --no-color disables ANSI sequences globally
Trust & Safety 21 / 25

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_AUTH scoped env authentication for hatch publish
Setup & Portability 13 / 15

Available via Homebrew, PyPI, pipx, uvx, and standalone installers on macOS, Linux, and Windows.

  • Standalone installers and Homebrew formula available cross-platform
Utility & Efficiency 13 / 15

Combines PEP 517 builds, uv-backed fast environment creation, test matrices, and ruff-powered hatch fmt.

  • Optional installer = "uv" speeds up managed environment creation
Maintenance & Lineage 9 / 10

Official PyPA project (pypa/hatch) under MIT license.

  • PyPA-governed pypa/hatch repository
Docs & Verifiability 8 / 10

Well-documented CLI reference and configuration schema at hatch.pypa.io.

  • Official CLI reference at hatch.pypa.io/latest/cli/reference

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key OS Keychain Config File
Credential Storage

Stores PyPI publishing credentials in OS keyring or config.toml, and supports HATCH_INDEX_USER / HATCH_INDEX_AUTH env vars.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

MIT open-source CLI maintained by PyPA; free to use.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Inspect configured project environments as JSON
hatch env show --json

Exports all defined Hatch environments, matrices, scripts, and dependencies in JSON.

Show current project version
hatch version

Reads the resolved project version from pyproject.toml or dynamic VCS/file source.

Controlled Writes & Previews

Build sdist and wheel cleanly
hatch build --clean

Rebuilds source and wheel distributions under dist/ without publishing.

Strengths for Agents

  • + hatch env show --json reveals exact scripts, dependencies, and matrix variants.
  • + Follows standard pyproject.toml (PEP 621 / 517) without proprietary lock-in.
  • + Built-in hatch test and hatch fmt streamline Python CI loops.

Caveats & Pitfalls

  • ! Does not provide a universal --dry-run flag on hatch build or hatch env create.
  • ! Managed virtualenvs live in user data dirs unless customized, which can surprise tools expecting .venv.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI