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

Function cbm_codex_config_dir

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

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