MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / install

Method install

src/installer/targets/opencode.ts:176–192  ·  view source on GitHub ↗
(loc: Location, _opts: InstallOptions)

Source from the content-addressed store, hash-verified

174 }
175
176 install(loc: Location, _opts: InstallOptions): WriteResult {
177 const files: WriteResult['files'] = [];
178 files.push(writeMcpEntry(loc));
179
180 // AGENTS.md gets the short marker-fenced CodeGraph block (#704):
181 // subagents and non-MCP harnesses read AGENTS.md but never the MCP
182 // initialize instructions. Upsert self-heals a stale pre-#529 block, and
183 // the plain block an earlier install wrote. OpenCode's block names the
184 // tool as OpenCode lists it, `codegraph_codegraph_explore` (#1267).
185 files.push(upsertInstructionsEntry(instructionsPath(loc), OPENCODE_INSTRUCTIONS_BLOCK));
186
187 // Self-heal a pre-#535 install that wrote to %APPDATA%/opencode —
188 // opencode never reads it, so anything of ours there is stale.
189 if (loc === 'global') files.push(...cleanupLegacyWindowsState());
190
191 return { files };
192 }
193
194 uninstall(loc: Location): WriteResult {
195 const files: WriteResult['files'] = [];

Callers

nothing calls this directly

Calls 5

upsertInstructionsEntryFunction · 0.90
pushMethod · 0.80
writeMcpEntryFunction · 0.70
instructionsPathFunction · 0.70

Tested by

no test coverage detected