How to manually test an unpublished checkout of this monorepo alongside a
local consumer plugin (using cursor-opencode-provider as the example) on
MiMo Code.
Key principle: OCP attaches as an external compatibility layer. You never edit MiMo source or fork consumer plugins. All local-dev wiring happens in the install-tree cache.
| Tool | Version |
|---|---|
| Bun | ≥ 1.2 |
| MiMo Code | any recent build |
npm (used by ocp setup to reify overrides) |
any recent version |
From this repo root:
./scripts/mimo-dev.sh local # local OCP facades + local provider clone
./scripts/mimo-dev.sh npm # restore npm plugin + published OCP facades
./scripts/kilo-dev.sh local
./scripts/kilo-dev.sh npmDefaults: provider checkout at ../cursor-opencode-provider or ~/Projects/cursor-opencode-provider (override with OCP_DEV_PROVIDER_PATH). Host config is backed up once under ~/.config/<host>/.ocp-dev/host-config.backup.json before the first local run.
local always rebuilds the provider dist/ and deletes any existing dist/index.ocp-original.js before ocp setup. That matters because ocp setup reuses a present backup and would otherwise re-wrap a stale stock entry after a provider rebuild. MiMo and Kilo local mode share that checkout — hostHint is last setup wins (runtime still detects host from argv/env).
Point the MiMo plugin install tree at the local facade packages
(facade-plugin, facade-sdk) instead of the published npm versions.
~/[opencode-plugin-compat]/ # this monorepo checkout
packages/
facade-plugin/ # @opencode-compat/facade-plugin
facade-sdk/ # @opencode-compat/facade-sdk
adapter/ # @opencode-compat/adapter
cli/ # @opencode-compat/cli
ocp/ # @opencode-compat/ocp (umbrella)
bin/ocp.ts # CLI entry point
mimo plugin -g cursor-opencode-providerPlugin lands at:
~/.cache/mimocode/packages/cursor-opencode-provider@latest/
From the repo root:
bun packages/ocp/bin/ocp.ts setup --host mimo --mode fileThis does Layer A — writes package.json overrides in the MiMo plugin
install tree that map:
@opencode-ai/plugin→file:~/[opencode-plugin-compat]/packages/facade-plugin@opencode-ai/sdk→file:~/[opencode-plugin-compat]/packages/facade-sdk
Then runs npm install (reify) so the file: links resolve. Then Option B
— renames the plugin's entry dist/index.js to dist/index.ocp-original.js and
writes an OCP provider shim + runtime.
Dry-run first to preview:
bun packages/ocp/bin/ocp.ts setup --host mimo --mode file --dry-runRe-run after every plugin install/upgrade — mimo plugin restores stock
files from the tarball.
# MiMo should list cursor/* models (classic Hooks via Layer A)
mimo models
# Confirm shim files exist
ls -la ~/.cache/mimocode/packages/cursor-opencode-provider@latest/ \
node_modules/cursor-opencode-provider/dist/
# index.js → OCP shim
# index.ocp-original.js → stock entry backup
# ocp-lm-runtime.js
# ocp-shim-meta.json
# Doctor
bun packages/ocp/bin/ocp.ts doctor --host mimobun packages/ocp/bin/ocp.ts setup --host mimo --mode npmThis replaces the file: overrides with npm: specifiers.
| Flag | Purpose |
|---|---|
--dry-run |
Preview changes without writing |
--mode file |
Use local file: facade paths (from this checkout) |
--mode npm |
Use published npm facades |
--host mimo |
Override host detection |
--no-provider-shim |
Skip Option B entry rewriting |
--version X.Y.Z |
Pin facade train version (default: current OCP version) |
Point MiMo at an unpublished local copy of the plugin instead of the npm package. Useful for iterating on provider changes before publishing.
~/[cursor-opencode-provider]/ # plugin source checkout
package.json
dist/index.js # built plugin entry
Option A — install from path:
mimo plugin -g ~/[cursor-opencode-provider]MiMo records the local path in its config and copies/symlinks the package into the cache:
~/.cache/mimocode/packages/cursor-opencode-provider@latest/
node_modules/cursor-opencode-provider/
Option B — symlink directly (when mimo plugin -g <path> isn't available or
you want faster iteration):
# Remove any existing npm-installed version
mimo plugin --remove cursor-opencode-provider
# Replace with a symlink
mkdir -p ~/.cache/mimocode/packages/cursor-opencode-provider@latest/node_modules
ln -sfn ~/[cursor-opencode-provider] \
~/.cache/mimocode/packages/cursor-opencode-provider@latest/node_modules/cursor-opencode-providerOverrides + provider shim apply identically:
bun packages/ocp/bin/ocp.ts setup --host mimo --mode fileAfter editing the local plugin source and rebuilding (bun run build in the
plugin dir), the shim runtime loads the updated dist/index.js at MiMo startup.
No setup re-run needed unless the provider entry path changed.
If the local plugin's package.json dependencies changed (e.g., new or updated
@opencode-ai/plugin version), re-run setup to refresh the override:
bun packages/ocp/bin/ocp.ts setup --host mimo --mode fileRemove the local path / symlink and reinstall from npm:
# Remove local
rm -rf ~/.cache/mimocode/packages/cursor-opencode-provider@latest
# Reinstall from npm
mimo plugin -g cursor-opencode-provider -f
# Re-apply OCP facades
bun packages/ocp/bin/ocp.ts setup --host mimo --mode file # or --mode npmBoth local at once — full end-to-end dev loop:
# 1. Install local plugin into MiMo cache
mimo plugin -g ~/[cursor-opencode-provider]
# 2. Run ocp setup from local checkout
bun packages/ocp/bin/ocp.ts setup --host mimo --mode file
# 3. Verify
mimo models
bun packages/ocp/bin/ocp.ts doctor --host mimo
# 4. Edit plugin source → rebuild → restart MiMo → repeat from step 3The --mode file flag at step 2 points @opencode-ai/* facades at the local
checkout (for OCP changes), while the symlinked/in-path plugin at step 1 uses
the local plugin build (for provider changes). The two are independent — you
can mix local OCP + npm plugin or npm OCP + local plugin.
| Check | Command | Expected |
|---|---|---|
| Overrides exist | cat ~/.cache/mimocode/packages/package.json |
overrides with @opencode-ai/plugin |
| Deep patch | cat ~/.cache/mimocode/packages/cursor-opencode-provider@latest/package.json |
overrides present |
| Provider shim | ls ~/.cache/mimocode/packages/cursor-opencode-provider@latest/node_modules/cursor-opencode-provider/dist/ |
index.js, index.ocp-original.js, ocp-lm-runtime.js |
| Models load | mimo models |
Lists cursor/* (or plugin's model IDs) |
| Doctor | bun packages/ocp/bin/ocp.ts doctor --host mimo |
ok: true |
| Symptom | Likely cause | Fix |
|---|---|---|
mimo models shows no plugin models |
Overrides not applied or reify didn't run | Re-run ocp setup |
| Doctor reports missing shim | --no-provider-shim was set, or npm install restored stock files |
Re-run ocp setup (omit --no-provider-shim) |
| Plugin loads but tools fail (no tool parts) | Option B didn't apply — entry still stock, or setup rewrapped a stale index.ocp-original.js after a provider rebuild |
Confirm dist/index.js has generated by ocp setup and index.ocp-original.js matches current stock (not an old backup). Re-run ./scripts/mimo-dev.sh local (or kilo-dev.sh local) which rebuilds stock and drops the stale backup before setup. |
Plugin loads but read/write/edit calls error with arg validation |
Schema adapter didn't map key names | Confirm ocp-lm-runtime.js exists and shim is active |
--mode file says "could not locate sibling facade" |
Running setup from outside the monorepo | Use bun packages/ocp/bin/ocp.ts from repo root, or use --mode npm |
~/.config/mimocode/
mimocode.json # host config (plugin list, etc.)
~/.cache/mimocode/
packages/
package.json # root overrides (written by ocp setup)
cursor-opencode-provider@latest/
package.json # child overrides (deep-patched)
node_modules/
cursor-opencode-provider/
package.json
dist/
index.js # OCP shim (after setup)
index.ocp-original.js
ocp-lm-runtime.js
ocp-shim-meta.json
# Remove OCP overrides from the install tree
rm ~/.cache/mimocode/packages/package.json
# Remove a specific plugin cache entry
rm -rf ~/.cache/mimocode/packages/cursor-opencode-provider@latest
# Reinstall plugin from npm
mimo plugin -g cursor-opencode-provider -f
# Option A: set up with published OCP (if you have @opencode-compat/ocp installed globally)
ocp setup --host mimo --mode npm
# Option B: set up with local OCP checkout
bun packages/ocp/bin/ocp.ts setup --host mimo --mode file # from repo root