From 652a81039398ffee20585c3bdaea58cd0a2cc2fb Mon Sep 17 00:00:00 2001 From: rUv Date: Wed, 7 Jan 2026 20:35:47 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-07T20:35:47Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- v3/@claude-flow/cli/src/index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/v3/@claude-flow/cli/src/index.ts b/v3/@claude-flow/cli/src/index.ts index daa70ee10c..fc2802f2d4 100644 --- a/v3/@claude-flow/cli/src/index.ts +++ b/v3/@claude-flow/cli/src/index.ts @@ -118,13 +118,18 @@ export class CLI { // Find and execute command const commandName = commandPath[0]; // First check the parser's registry (for dynamically registered commands) - // Then fall back to the static registry - const command = this.parser.getCommand(commandName) || getCommand(commandName); + // Then fall back to the static registry, then try lazy loading + let command = this.parser.getCommand(commandName) || getCommand(commandName); + + // If not found in sync registry, try lazy loading + if (!command && hasCommand(commandName)) { + command = await getCommandAsync(commandName); + } if (!command) { this.output.printError(`Unknown command: ${commandName}`); - // Smart suggestions - const availableCommands = Array.from(new Set(commands.map(c => c.name))); + // Smart suggestions - include lazy-loadable commands in suggestions + const availableCommands = Array.from(new Set([...commands.map(c => c.name), ...getCommandNames()])); const { message } = suggestCommand(commandName, availableCommands); this.output.writeln(this.output.dim(` ${message}`)); process.exit(1);