coder-config 0.41.4 → 0.41.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/apply.js CHANGED
@@ -281,8 +281,82 @@ function applyForGemini(registryPath, projectDir = null) {
281
281
  return true;
282
282
  }
283
283
 
284
+ /**
285
+ * Generate MCP config for Codex CLI
286
+ */
287
+ function applyForCodex(registryPath, projectDir = null) {
288
+ const dir = projectDir || findProjectRoot() || process.cwd();
289
+ const paths = TOOL_PATHS.codex;
290
+ const homeDir = process.env.HOME || '';
291
+
292
+ const registry = loadJson(registryPath);
293
+ if (!registry) {
294
+ console.error('Error: Could not load MCP registry');
295
+ return false;
296
+ }
297
+
298
+ const configLocations = findAllConfigsForTool('codex', dir);
299
+
300
+ if (configLocations.length === 0) {
301
+ console.log(` ℹ No .codex/mcps.json found - skipping Codex CLI`);
302
+ console.log(` Create one with: mkdir -p .codex && echo '{"include":["filesystem"]}' > .codex/mcps.json`);
303
+ return true;
304
+ }
305
+
306
+ const loadedConfigs = configLocations.map(loc => ({
307
+ ...loc,
308
+ config: loadJson(loc.configPath)
309
+ }));
310
+ const mergedConfig = mergeConfigs(loadedConfigs);
311
+
312
+ let env = {};
313
+ const globalEnvPath = path.join(homeDir, '.codex', '.env');
314
+ env = { ...env, ...loadEnvFile(globalEnvPath) };
315
+
316
+ for (const { dir: d } of configLocations) {
317
+ if (d !== homeDir) {
318
+ const envPath = path.join(d, '.codex', '.env');
319
+ env = { ...env, ...loadEnvFile(envPath) };
320
+ }
321
+ }
322
+
323
+ const output = { mcpServers: {} };
324
+
325
+ if (mergedConfig.include && Array.isArray(mergedConfig.include)) {
326
+ for (const name of mergedConfig.include) {
327
+ if (registry.mcpServers && registry.mcpServers[name]) {
328
+ output.mcpServers[name] = interpolate(registry.mcpServers[name], env);
329
+ }
330
+ }
331
+ }
332
+
333
+ if (mergedConfig.mcpServers) {
334
+ for (const [name, config] of Object.entries(mergedConfig.mcpServers)) {
335
+ if (name.startsWith('_')) continue;
336
+ output.mcpServers[name] = interpolate(config, env);
337
+ }
338
+ }
339
+
340
+ // Generate per-project config (.codex/mcp.json)
341
+ const projectOutputDir = path.join(dir, '.codex');
342
+ const projectOutputPath = path.join(projectOutputDir, 'mcp.json');
343
+
344
+ if (!fs.existsSync(projectOutputDir)) {
345
+ fs.mkdirSync(projectOutputDir, { recursive: true });
346
+ }
347
+
348
+ saveJson(projectOutputPath, output);
349
+
350
+ const count = Object.keys(output.mcpServers).length;
351
+ console.log(`✓ Generated ${projectOutputPath} (Codex CLI)`);
352
+ console.log(` └─ ${count} MCP(s): ${Object.keys(output.mcpServers).join(', ')}`);
353
+
354
+ return true;
355
+ }
356
+
284
357
  /**
285
358
  * Detect which AI coding tools are installed
359
+ * Note: Uses execSync with hardcoded command names (safe from injection)
286
360
  */
287
361
  function detectInstalledTools() {
288
362
  const homeDir = process.env.HOME || '';
@@ -313,6 +387,16 @@ function detectInstalledTools() {
313
387
  method: 'directory'
314
388
  };
315
389
 
390
+ try {
391
+ execSync('which codex', { stdio: 'ignore' });
392
+ results.codex = { installed: true, method: 'command' };
393
+ } catch {
394
+ results.codex = {
395
+ installed: fs.existsSync(path.join(homeDir, '.codex')),
396
+ method: 'directory'
397
+ };
398
+ }
399
+
316
400
  return results;
317
401
  }
318
402
 
@@ -329,6 +413,8 @@ function applyForTools(registryPath, projectDir = null, tools = ['claude']) {
329
413
  results.gemini = applyForGemini(registryPath, projectDir);
330
414
  } else if (tool === 'antigravity') {
331
415
  results.antigravity = applyForAntigravity(registryPath, projectDir);
416
+ } else if (tool === 'codex') {
417
+ results.codex = applyForCodex(registryPath, projectDir);
332
418
  }
333
419
  }
334
420
 
@@ -339,6 +425,7 @@ module.exports = {
339
425
  apply,
340
426
  applyForAntigravity,
341
427
  applyForGemini,
428
+ applyForCodex,
342
429
  detectInstalledTools,
343
430
  applyForTools,
344
431
  };
package/lib/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.41.4';
5
+ const VERSION = '0.41.6';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
@@ -50,6 +50,19 @@ const TOOL_PATHS = {
50
50
  outputFile: '~/.gemini/antigravity/mcp_config.json',
51
51
  supportsEnvInterpolation: false,
52
52
  },
53
+ codex: {
54
+ name: 'Codex CLI',
55
+ icon: 'terminal',
56
+ color: 'green',
57
+ globalConfig: '~/.codex/config.json',
58
+ globalMcpConfig: '~/.codex/mcps.json',
59
+ projectFolder: '.codex',
60
+ projectConfig: '.codex/mcps.json',
61
+ projectRules: '.codex/rules',
62
+ projectInstructions: 'CODEX.md',
63
+ outputFile: '.codex/mcp.json',
64
+ supportsEnvInterpolation: true,
65
+ },
53
66
  };
54
67
 
55
68
  module.exports = { VERSION, TOOL_PATHS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.41.4",
3
+ "version": "0.41.6",
4
4
  "description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
5
5
  "author": "regression.io",
6
6
  "main": "config-loader.js",