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

Function uninstall_cli_agents

src/cli/cli.c:10288–10388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10286}
10287
10288static void uninstall_cli_agents(const cbm_detected_agents_t *agents, const char *home,
10289 bool dry_run) {
10290 if (agents->codex) {
10291 char config_dir[CLI_BUF_1K];
10292 char cp[CLI_BUF_1K];
10293 char ip[CLI_BUF_1K];
10294 char skills_dir[CLI_BUF_1K];
10295 char ap[CLI_BUF_1K];
10296 char installed_binary[CLI_BUF_1K];
10297 cbm_codex_config_dir(home, config_dir, sizeof(config_dir));
10298 snprintf(cp, sizeof(cp), "%s/config.toml", config_dir);
10299 snprintf(ip, sizeof(ip), "%s/AGENTS.md", config_dir);
10300 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
10301 snprintf(ap, sizeof(ap), "%s/agents/codebase-memory.toml", config_dir);
10302 cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary));
10303 uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Codex CLI", cp, ip}, dry_run,
10304 cbm_remove_codex_mcp_owned);
10305 uninstall_agent_skill("Codex CLI", skills_dir, dry_run);
10306 uninstall_tiered_agent_profiles(
10307 (cbm_tiered_profile_set_t){
10308 .label = "Codex CLI",
10309 .verify_path = ap,
10310 .binary_path = installed_binary,
10311 .legacy_verify_content = legacy_codex_verify_agent_content,
10312 .dialect = CBM_GRAPH_DIALECT_CODEX,
10313 },
10314 dry_run);
10315 if (!dry_run) {
10316 if (cbm_remove_codex_hooks(cp) != CLI_OK) {
10317 record_agent_config_error(true, "Codex CLI", "hook_uninstall", cp);
10318 }
10319 char hooks_json[CLI_BUF_1K];
10320 char hook_command[CLI_BUF_8K];
10321 snprintf(hooks_json, sizeof(hooks_json), "%s/hooks.json", config_dir);
10322 if (cbm_file_exists(hooks_json) &&
10323 (cbm_build_augment_command(installed_binary, hook_command, sizeof(hook_command)) !=
10324 CLI_OK ||
10325 cbm_remove_paired_lifecycle_hooks_json(hooks_json, hook_command) != CLI_OK)) {
10326 record_agent_config_error(true, "Codex CLI", "json_hook_uninstall", hooks_json);
10327 }
10328 }
10329 }
10330 if (agents->gemini) {
10331 uninstall_gemini_config(home, dry_run);
10332 }
10333 if (agents->opencode) {
10334 char cp[CLI_BUF_1K];
10335 char ip[CLI_BUF_1K];
10336 char skills_dir[CLI_BUF_1K];
10337 char ap[CLI_BUF_1K];
10338 cbm_opencode_config_path(home, cp, sizeof(cp));
10339 snprintf(ip, sizeof(ip), "%s/.config/opencode/AGENTS.md", home);
10340 snprintf(skills_dir, sizeof(skills_dir), "%s/.config/opencode/skills", home);
10341 snprintf(ap, sizeof(ap), "%s/.config/opencode/agents/codebase-memory.md", home);
10342 uninstall_agent_mcp_instr((mcp_uninstall_args_t){"OpenCode", cp, ip}, dry_run,
10343 cbm_remove_opencode_mcp_owned);
10344 uninstall_agent_skill("OpenCode", skills_dir, dry_run);
10345 uninstall_tiered_agent_profiles(

Callers 1

cli_uninstall_activateFunction · 0.85

Calls 15

cbm_codex_config_dirFunction · 0.85
uninstall_agent_skillFunction · 0.85
cbm_remove_codex_hooksFunction · 0.85
cbm_file_existsFunction · 0.85
uninstall_gemini_configFunction · 0.85
cbm_opencode_config_pathFunction · 0.85

Tested by

no test coverage detected