MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_codex_config_dir

Function cbm_codex_config_dir

src/cli/cli.c:2360–2372  ·  view source on GitHub ↗

Resolve Codex's user configuration directory. * Honors $CODEX_HOME; falls back to "$home_dir/.codex". */

Source from the content-addressed store, hash-verified

2358/* Resolve Codex's user configuration directory.
2359 * Honors $CODEX_HOME; falls back to "$home_dir/.codex". */
2360static void cbm_codex_config_dir(const char *home_dir, char *out, size_t out_sz) {
2361 if (out_sz == 0) {
2362 return;
2363 }
2364 out[0] = '\0';
2365 char env_buf[CLI_BUF_1K];
2366 const char *env = cbm_safe_getenv("CODEX_HOME", env_buf, sizeof(env_buf), NULL);
2367 if (env && env[0]) {
2368 snprintf(out, out_sz, "%s", env);
2369 } else if (home_dir && home_dir[0]) {
2370 snprintf(out, out_sz, "%s/.codex", home_dir);
2371 }
2372}
2373
2374/* Resolve Zed's user configuration directory using its documented platform
2375 * locations. Linux honors XDG_CONFIG_HOME before ~/.config. */

Callers 3

cbm_detect_agentsFunction · 0.85
uninstall_cli_agentsFunction · 0.85

Calls 1

cbm_safe_getenvFunction · 0.85

Tested by

no test coverage detected