From f07fa6601935b2c8033154f2c1ee8fd3155f48c0 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Wed, 28 Jan 2026 14:11:14 -0500 Subject: [PATCH] feat(memory-claudemem): implement CLI commands Add clawdbot claude-mem CLI commands: - status: check if worker is responding - search : search memories with optional --limit Part of claude-mem integration (Phase 6/7). Co-Authored-By: Claude Opus 4.5 --- extensions/memory-claudemem/index.ts | 33 +++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/extensions/memory-claudemem/index.ts b/extensions/memory-claudemem/index.ts index d83488c1e..6c7489752 100644 --- a/extensions/memory-claudemem/index.ts +++ b/extensions/memory-claudemem/index.ts @@ -157,7 +157,38 @@ const claudeMemPlugin = { { name: "memory_observations" }, ); - // TODO: Phase 6 - CLI registration + // Phase 6: CLI registration + api.registerCli( + ({ program }) => { + const claudeMem = program + .command("claude-mem") + .description("Claude-mem memory plugin commands"); + + claudeMem + .command("status") + .description("Check if the claude-mem worker is responding") + .action(async () => { + const isHealthy = await client.ping(); + if (isHealthy) { + console.log(`✓ Worker running at ${cfg.workerUrl}`); + } else { + console.log(`✗ Worker not responding at ${cfg.workerUrl}`); + process.exitCode = 1; + } + }); + + claudeMem + .command("search") + .description("Search memories") + .argument("", "Search query") + .option("--limit ", "Max results", "10") + .action(async (query, opts) => { + const results = await client.search(query, parseInt(opts.limit)); + console.log(JSON.stringify(results, null, 2)); + }); + }, + { commands: ["claude-mem"] }, + ); }, };