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

Function cbm_codex_config_dir

src/cli/cli.c:2179–2191  ·  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

2177/* Resolve Codex's user configuration directory.
2178 * Honors $CODEX_HOME; falls back to "$home_dir/.codex". */
2179static void cbm_codex_config_dir(const char *home_dir, char *out, size_t out_sz) {
2180 if (out_sz == 0) {
2181 return;
2182 }
2183 out[0] = '\0';
2184 char env_buf[CLI_BUF_1K];
2185 const char *env = cbm_safe_getenv("CODEX_HOME", env_buf, sizeof(env_buf), NULL);
2186 if (env && env[0]) {
2187 snprintf(out, out_sz, "%s", env);
2188 } else if (home_dir && home_dir[0]) {
2189 snprintf(out, out_sz, "%s/.codex", home_dir);
2190 }
2191}
2192
2193/* Resolve Zed's user configuration directory using its documented platform
2194 * 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