OpenCode plugin that automatically rewrites npm/pip commands to pnpm/uv.
npm install→pnpm installpip install→uv pippython -m pip install→uv pippython script.py→uv run python script.pynpx xxx→pnpm dlx xxxpython -m venv→uv venv(optional)virtualenv→uv venv(optional)
Commands starting with uv, pnpm, or rtk are not modified.
Add to your package.json:
{
"package-manager-hook": {
"enableVenv": true
}
}enableVenv: Enable rewriting venv/virtualenv commands to uv venv (default: true)
npm install package-manager-hookAdd to your opencode.json:
{
"plugin": ["package-manager-hook"]
}Or copy src/index.ts to ~/.config/opencode/plugins/package-manager-hook.ts.
The plugin checks for these at startup and only activates if both are found.