(args: string[])
| 141 | } |
| 142 | |
| 143 | async function runInitCommand(args: string[]) { |
| 144 | const nonFlags = args.filter((arg) => !arg.startsWith("--")); |
| 145 | const target = parseAgentTarget(nonFlags[0]); |
| 146 | const runner = parseRunner(args); |
| 147 | const outputPath = resolve(process.cwd(), AGENT_CONFIG_PATH[target]); |
| 148 | const content = target === "opencode" ? buildOpenCodeConfig(runner) : buildMcpConfig(runner); |
| 149 | await mkdir(dirname(outputPath), { recursive: true }); |
| 150 | await writeFile(outputPath, `${content}\n`, "utf8"); |
| 151 | console.error(`Context+ initialized for ${target} using ${runner}.`); |
| 152 | console.error(`Wrote MCP config: ${outputPath}`); |
| 153 | } |
| 154 | |
| 155 | const server = new McpServer({ |
| 156 | name: "contextplus", |
no test coverage detected