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

Function cbm_openclaw_config_path

src/cli/cli.c:2503–2519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2501}
2502
2503static bool cbm_openclaw_config_path(const char *home_dir, char *out, size_t out_sz) {
2504 char internal_home[CLI_BUF_1K];
2505 if (!cbm_openclaw_internal_home(home_dir, internal_home, sizeof(internal_home))) {
2506 return false;
2507 }
2508 char env_buf[CLI_BUF_1K];
2509 const char *custom = cbm_safe_getenv("OPENCLAW_CONFIG_PATH", env_buf, sizeof(env_buf), NULL);
2510 if (custom && custom[0]) {
2511 return cbm_expand_user_path(internal_home, custom, out, out_sz);
2512 }
2513 char state_dir[CLI_BUF_1K];
2514 if (!cbm_openclaw_state_dir(home_dir, state_dir, sizeof(state_dir))) {
2515 return false;
2516 }
2517 int written = snprintf(out, out_sz, "%s/openclaw.json", state_dir);
2518 return written > 0 && (size_t)written < out_sz;
2519}
2520
2521static bool cbm_openclaw_workspace_path(const char *home_dir, const char *config_path, char *out,
2522 size_t out_sz) {

Callers 3

cbm_detect_agentsFunction · 0.85
uninstall_editor_agentsFunction · 0.85

Calls 4

cbm_safe_getenvFunction · 0.85
cbm_expand_user_pathFunction · 0.85
cbm_openclaw_state_dirFunction · 0.85

Tested by

no test coverage detected