Skip to content

Conversation

@elithrar
Copy link
Contributor

@elithrar elithrar commented Dec 28, 2025

Enables local plugins and custom tools to use external npm dependencies by running bun install after adding @opencode-ai/plugin.

  • local plugins in .opencode/plugin/ previously could not use external npm packages. If a plugin imported a package like shescape, it would SILENTLY fail because dependencies were not installed and the tool would throw.
  • we now also run bun install to install any additional dependencies defined in the config directory's package.json.

usage:

Add a package.json to your .opencode/ directory:

{
  "dependencies": {
    "shescape": "^2.1.0"
  }
}

@elithrar elithrar force-pushed the feat/local-plugin-dependencies branch from 82c8083 to 75d2a2c Compare December 28, 2025 16:22
@elithrar elithrar force-pushed the feat/local-plugin-dependencies branch from 75d2a2c to 3d1cff5 Compare December 28, 2025 16:22
@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

Suggestion: The new "Dependencies" section in plugins.mdx contradicts existing text at line 50 which states:

Local plugins are loaded directly from the plugin directory. Dependencies are not installed automatically. If your local plugin requires external packages, publish it to npm instead and add it to your config.

Since this PR enables local plugin dependencies, this old text should be updated to reflect the new behavior. Consider updating line 50 to remove the statement about dependencies not being installed automatically.

@elithrar
Copy link
Contributor Author

Fixed — I rebased incorrectly on mobile after #6301.

@rekram1-node rekram1-node merged commit 56b5cdf into sst:dev Dec 29, 2025
2 checks passed
@elithrar elithrar deleted the feat/local-plugin-dependencies branch December 29, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants