| 116 | } |
| 117 | |
| 118 | function buildOpenCodeConfig(runner: "npx" | "bunx") { |
| 119 | const command = runner === "npx" ? ["npx", "-y", "contextplus"] : ["bunx", "contextplus"]; |
| 120 | return JSON.stringify( |
| 121 | { |
| 122 | $schema: "https://opencode.ai/config.json", |
| 123 | mcp: { |
| 124 | contextplus: { |
| 125 | type: "local", |
| 126 | command, |
| 127 | enabled: true, |
| 128 | environment: { |
| 129 | OLLAMA_EMBED_MODEL: "nomic-embed-text", |
| 130 | OLLAMA_CHAT_MODEL: "gemma2:27b", |
| 131 | OLLAMA_API_KEY: "YOUR_OLLAMA_API_KEY", |
| 132 | CONTEXTPLUS_EMBED_BATCH_SIZE: "8", |
| 133 | CONTEXTPLUS_EMBED_TRACKER: "lazy", |
| 134 | }, |
| 135 | }, |
| 136 | }, |
| 137 | }, |
| 138 | null, |
| 139 | 2, |
| 140 | ); |
| 141 | } |
| 142 | |
| 143 | async function runInitCommand(args: string[]) { |
| 144 | const nonFlags = args.filter((arg) => !arg.startsWith("--")); |