Hook-only command guidance for AI coding agents

Hook Python commands into uv.

A small Go CLI that installs Codex and OpenCode hooks, detects Python-related shell commands, and routes them toward the matching uv workflow.

agent shell python app.py
uv path uv run app.py
tested Windows + Codex CLI
binary uv-python-hook
runtime Pure Go CLI

Install binary

Install the latest stable release.

The installer downloads the matching archive for your OS and CPU, verifies it against checksums.txt, and installs the binary into a user-level directory.

release installers GitHub assets
Windows PowerShell tested path
powershell -ExecutionPolicy ByPass -c "irm https://github.com/jinxiao/python-uv-hooks-4-ai/releases/latest/download/install.ps1 | iex"
macOS implemented, unverified
curl -LsSf https://github.com/jinxiao/python-uv-hooks-4-ai/releases/latest/download/install.sh | sh

Workflow

Command rewrites stay project-aware.

uv project boundaries are respected. Poetry and PDM projects are left unchanged, while Python tools use uv-native execution paths.

Original Codex target
python app.py -> uv --cache-dir <temp>\uv-python-agent-hooks\uv-cache run app.py
pytest -q -> uv --cache-dir <temp>\uv-python-agent-hooks\uv-cache run pytest -q
pip install requests -> uv --cache-dir <temp>\uv-python-agent-hooks\uv-cache pip install requests
python -m venv -> uv --cache-dir <temp>\uv-python-agent-hooks\uv-cache venv .venv
01

Detects uv projects

pyproject.toml and uv.lock mark uv-managed projects.

02

Leaves other managers alone

Poetry and PDM markers prevent rewriting commands in those projects.

03

Keeps agent cache isolated

Codex suggestions use a temporary uv cache by default.

Support status

Validated only where tested.

Treat the repository as tested only for Windows with Codex CLI until other targets are validated.

Status Target Notes
tested Windows + Codex CLI

Primary supported path for current release notes.

implemented, unverified OpenCode hook installation

Available through explicit target installation.

implemented, unverified macOS and Linux behavior

Release assets and installers exist; validation is pending.

CLI reference

Install, inspect, rewrite, remove.

command list uv-python-hook
uv-python-hook install
uv-python-hook uninstall
uv-python-hook install --project --targets codex
uv-python-hook uninstall --project --targets codex
uv-python-hook doctor
uv-python-hook detect-project
uv-python-hook rewrite-command "pip install -r requirements.txt"
uv-python-hook rewrite-command --target opencode "python app.py"