See the main CONTRIBUTING.md to learn how to contribute to Langfuse and its integrations.
Install dependencies:
pnpm installBuild the plugin:
pnpm run buildTo test the plugin globally, add its combined built entrypoint to ~/.config/opencode/opencode.jsonc. Replace /path/to/langfuse-opencode with the absolute path to this repository. The same entrypoint supports OpenCode 1.18.29 and newer and OpenCode 2.
For OpenCode 2:
For OpenCode 1:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["/path/to/langfuse-opencode/dist/index.js"],
}Rebuild the package after making changes and restart OpenCode before testing:
pnpm run build
opencode service restartFormat files:
pnpm run formatCheck formatting:
pnpm run format:checktsdown bundles the combined plugin and its runtime dependencies into dist/index.js. OpenCode 1 calls its server() implementation and OpenCode 2 calls its setup() implementation. Version-specific entrypoints remain available at dist/v1/index.js and dist/v2/index.js. Do not edit generated files in dist/ by hand.
-
From a clean, up-to-date
mainbranch, bump the version and push the resulting commit and tag:pnpm version 1.2.3 --message "Release v%s" git push origin main --follow-tagspnpm versionupdatespackage.json, creates a commit titledRelease v1.2.3, and tags it asv1.2.3. The release workflow verifies the version, builds and tests the package, stages it on npm with provenance, and creates a draft GitHub release. -
Review the staged package on npmjs.com or with the npm CLI:
npm stage list @langfuse/opencode-observability-plugin npm stage view <stage-id> npm stage download <stage-id>
-
Approve the staged package using an npm account with publish access and 2FA enabled:
npm stage approve <stage-id>
-
Review and publish the draft GitHub release created by the workflow.
Do not approve the npm package or publish the GitHub draft until both staged artifacts have been reviewed. If the workflow fails before staging, fix the problem and move the tag to the corrected release commit. If staging succeeded, do not rerun the workflow with the same version; staged and published versions cannot be staged again.
{ "$schema": "https://opencode.ai/config.json", "plugins": ["/path/to/langfuse-opencode/dist/index.js"], }