Plug the local NanoNets Graft code graph into OpenCode as a zero-config background plugin.
graft-opencode is a tiny installer plus a single OpenCode plugin. It ships a
repository map, semantic context, blast-radius warnings, and an
out-of-sync drift alert — all powered by the graft CLI running locally on
your machine. No external services, no API keys, no telemetry.
Install into a repository from anywhere inside it:
npx github:salvioner/graft-opencodeThe command locates the current Git repository root automatically
(git rev-parse --show-toplevel), then copies the .opencode/ folder tree into
it. Not inside a Git repository? It falls back to your current working directory.
OpenCode auto-discovers the plugin from .opencode/plugin/ on the next launch —
no config entry required.
- OpenCode installed.
- The NanoNets
graftCLI installed locally and available on your systemPATH. The plugin shells out tograft map,graft ask,graft callers,graft build, andgraft check.
graft-opencode is 100% local:
- Zero external API keys. The plugin never needs a key or token.
- No telemetry. Nothing is ever sent off your machine.
- Local index only. All context comes from your local Graft index and the
graftCLI binaries. Nothing leaves your computer.
graft-plugin.ts is an event-driven background plugin that hooks OpenCode's
lifecycle. It degrades silently — if graft isn't available it simply does
nothing and never blocks your session.
- Repo Mapping — On
session.created,graft mapbuilds a structural repository map and seeds it into the session as synthetic context. - Semantic Context — On each
chat.message,graft askqueries the local index for relevant code and appends the top hits as[graft context]parts. - Blast-Radius Checks — After an
editorwrite,graft callersfinds dependent functions and warns you about the blast radius of your change. - Auto-Sync & Drift Warning — On
session.idle,graft buildrebuilds the graph;graft checkthen raises a toast if files have fallen out of sync.
Prefer to copy the files yourself? Mirror the .opencode/ tree into your
repository:
cd graft-opencode # This repo
rsync -avu .opencode/ /path/to/destination/.opencode/Remove the installed plugin from the target repository:
rm -rf /path/to/destination/.opencode/plugin