From cc4b9daecbe5b6eafa8efc51d05716b232c349a4 Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 17 Feb 2026 13:34:56 -0800 Subject: [PATCH] Fix ruflo CLI branding: show 'ruflo' instead of 'claude-flow' (#1163) ruflo.js now imports CLI class directly and passes ruflo branding (name, description) instead of re-importing cli.js with defaults. Also fixed two hardcoded 'claude-flow' strings in index.ts help text to use this.name for proper branding in both packages. Fixes #1162 --- ruflo/bin/ruflo.js | 31 ++++++++++++++++++++++++------- v3/@claude-flow/cli/src/index.ts | 4 ++-- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/ruflo/bin/ruflo.js b/ruflo/bin/ruflo.js index 5d79114f1f..e6748f6fe2 100755 --- a/ruflo/bin/ruflo.js +++ b/ruflo/bin/ruflo.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -// Ruflo CLI - thin wrapper around @claude-flow/cli +// Ruflo CLI - thin wrapper around @claude-flow/cli with ruflo branding import { fileURLToPath } from 'node:url'; import { dirname, resolve, join } from 'node:path'; import { existsSync } from 'node:fs'; @@ -11,7 +11,7 @@ function findCliPath() { let dir = resolve(__dirname, '..'); for (let i = 0; i < 10; i++) { const candidate = join(dir, 'node_modules', '@claude-flow', 'cli', 'bin', 'cli.js'); - if (existsSync(candidate)) return candidate; + if (existsSync(candidate)) return dir; const parent = dirname(dir); if (parent === dir) break; dir = parent; @@ -19,10 +19,27 @@ function findCliPath() { return null; } -const cliPath = findCliPath(); -if (cliPath) { - await import(cliPath); +const pkgDir = findCliPath(); +const cliBase = pkgDir + ? join(pkgDir, 'node_modules', '@claude-flow', 'cli') + : resolve(__dirname, '../../v3/@claude-flow/cli'); + +// MCP mode: delegate to cli.js directly (branding irrelevant for JSON-RPC) +const cliArgs = process.argv.slice(2); +const isExplicitMCP = cliArgs.length >= 1 && cliArgs[0] === 'mcp' && (cliArgs.length === 1 || cliArgs[1] === 'start'); +const isMCPMode = !process.stdin.isTTY && (process.argv.length === 2 || isExplicitMCP); + +if (isMCPMode) { + await import(join(cliBase, 'bin', 'cli.js')); } else { - // Fallback: dev/linked installs - await import(resolve(__dirname, '../../v3/@claude-flow/cli/bin/cli.js')); + // CLI mode: use ruflo branding + const { CLI } = await import(join(cliBase, 'dist', 'src', 'index.js')); + const cli = new CLI({ + name: 'ruflo', + description: 'Ruflo - AI Agent Orchestration Platform', + }); + cli.run().catch((error) => { + console.error('Fatal error:', error.message); + process.exit(1); + }); } diff --git a/v3/@claude-flow/cli/src/index.ts b/v3/@claude-flow/cli/src/index.ts index b773ea9ba9..c29c07b544 100644 --- a/v3/@claude-flow/cli/src/index.ts +++ b/v3/@claude-flow/cli/src/index.ts @@ -338,7 +338,7 @@ export class CLI { this.output.writeln(` ${this.name} mcp start # Start MCP server`); this.output.writeln(); - this.output.writeln(this.output.dim('Run "claude-flow --help" for command help')); + this.output.writeln(this.output.dim(`Run "${this.name} --help" for command help`)); this.output.writeln(); this.output.writeln(this.output.dim('Created with ❤️ by ruv.io')); this.output.writeln(); @@ -429,7 +429,7 @@ export class CLI { this.output.dim(`Updates available: ${nonAutoUpdates.map(u => `${u.package}@${u.latestVersion}`).join(', ')}`) ); this.output.writeln( - this.output.dim(`Run 'claude-flow update check' for details`) + this.output.dim(`Run '${this.name} update check' for details`) ); } }