This repository dogfoods local built kibi-mcp and kibi-opencode artifacts instead of consuming the published npm packages in its own OpenCode workflow.
The repo-root setup relies on these files:
opencode.jsonstarts the local MCP server through agit rev-parse --show-toplevelwrapper so it still resolves the repo root when OpenCode is launched from a subdirectory likepackages/opencode.opencode.jsonkeeps"plugin": [], so OpenCode does not auto-install the publishedkibi-opencodepackage..opencode/plugins/kibi.tsre-exports../../packages/opencode/dist/index.js.packages/mcp/dist/andpackages/opencode/dist/must exist locally because OpenCode uses those built outputs.
bun install
bun run buildBecause this repo uses local build artifacts, rerun the full build whenever you:
- change a version in
package.jsonfor any Kibi package - change local package wiring between
packages/core,packages/cli,packages/mcp, andpackages/opencode - change code in
packages/mcp/src/ - need refreshed build output before testing the repo's OpenCode dogfood flow
Use:
bun run buildIf you are only iterating on packages/opencode/src/, you can keep the plugin build hot with:
bun run dev:opencodeThat watch mode updates packages/opencode/dist/, but version bumps and cross-package changes still require bun run build.
- You edit code in
packages/mcp/src/orpackages/opencode/src/. - The build writes compiled output into
packages/mcp/dist/andpackages/opencode/dist/. - OpenCode resolves the repo root with
git rev-parse --show-topleveland then startspackages/mcp/bin/kibi-mcpfrom that absolute path. - OpenCode auto-loads
.opencode/plugins/kibi.ts, which re-exports the localpackages/opencode/dist/index.jsbuild. - Restarting OpenCode picks up the refreshed local artifacts.
Check the dogfood wiring after rebuilds:
cat opencode.json
cat .opencode/plugins/kibi.ts
ls packages/mcp/dist
ls packages/opencode/distPublished plugin got loaded instead of the local one:
- Ensure
opencode.jsonkeeps"plugin": [] - Ensure
.opencode/plugins/kibi.tsstill points at../../packages/opencode/dist/index.js
Changes are not reflected in OpenCode:
- Run
bun run build - If you are iterating only on the plugin, confirm
bun run dev:opencodeis still running - Restart OpenCode after the rebuild
Run the relevant plugin tests:
bun test packages/opencode/testsWhen preparing a release for kibi-opencode:
- Update version metadata as needed
- Run
bun run build - Test the local dogfood setup against the rebuilt artifacts
- Create a changeset with
bun run changeset - Follow the release workflow in the main README