Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

package-manager-hook

OpenCode plugin that automatically rewrites npm/pip commands to pnpm/uv.

What it does

  • npm installpnpm install
  • pip installuv pip
  • python -m pip installuv pip
  • python script.pyuv run python script.py
  • npx xxxpnpm dlx xxx
  • python -m venvuv venv (optional)
  • virtualenvuv venv (optional)

Commands starting with uv, pnpm, or rtk are not modified.

Configuration

Add to your package.json:

{
  "package-manager-hook": {
    "enableVenv": true
  }
}
  • enableVenv: Enable rewriting venv/virtualenv commands to uv venv (default: true)

Installation

npm install package-manager-hook

Add to your opencode.json:

{
  "plugin": ["package-manager-hook"]
}

Or copy src/index.ts to ~/.config/opencode/plugins/package-manager-hook.ts.

Requirements

  • pnpm must be installed
  • uv must be installed

The plugin checks for these at startup and only activates if both are found.

About

OpenCode plugin that rewrites npm/pip commands to pnpm/uv

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages