Detects uv projects
pyproject.toml and uv.lock mark uv-managed projects.
A small Go CLI that installs Codex and OpenCode hooks, detects
Python-related shell commands, and routes them toward the matching
uv workflow.
python app.py
uv run app.py
Install binary
The installer downloads the matching archive for your OS and CPU,
verifies it against checksums.txt, installs the
binary, and runs uv-python-hook install for detected
Codex/OpenCode hooks.
curl -LsSf https://uv-python-hook.jinxiao2010.uk/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://uv-python-hook.jinxiao2010.uk/install.ps1 | iex"
Workflow
uv project boundaries are respected. Poetry and PDM projects are left unchanged, while Python tools use uv-native execution paths.
python app.py
->
uv --cache-dir /tmp/uv-python-agent-hooks/uv-cache run app.py
pytest -q
->
uv --cache-dir /tmp/uv-python-agent-hooks/uv-cache run pytest -q
pip install requests
->
uv --cache-dir /tmp/uv-python-agent-hooks/uv-cache pip install requests
python -m venv
->
uv --cache-dir /tmp/uv-python-agent-hooks/uv-cache venv .venv
pyproject.toml and uv.lock mark uv-managed projects.
Poetry and PDM markers prevent rewriting commands in those projects.
Codex suggestions use a temporary uv cache by default.
Support status
Codex CLI, Claude Code, and OpenCode are the validated tool targets. VS Code Copilot is planned for a future adapter.
Installs hooks and suggests uv commands before shell tool execution.
Installs a Bash PreToolUse hook and suggests uv commands before execution.
Installs the OpenCode plugin and rewrites Python-related commands directly.
Future editor integration target.
CLI reference
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 install --project --targets claude
uv-python-hook uninstall --project --targets claude
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"