Skip to content

armgit / ruflo

Public Imported from GitHub
0

๐ŸŒŠ The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

๐Ÿ”– Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/swarm.js

rUv784ed0a572c6
diff --git a/.claude/checkpoints/1754223063.json b/.claude/checkpoints/1754223063.json
new file mode 100644
index 0000000000..2849db008a
--- /dev/null
+++ b/.claude/checkpoints/1754223063.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250803-121103", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/swarm.js", "timestamp": "2025-08-03T12:11:03Z", "type": "pre-edit", "original_branch": "alpha-84b"}
diff --git a/.claude/checkpoints/1754223065.json b/.claude/checkpoints/1754223065.json
new file mode 100644
index 0000000000..dbb0a80c87
--- /dev/null
+++ b/.claude/checkpoints/1754223065.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250803-121105", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/swarm.js", "timestamp": "2025-08-03T12:11:05Z", "type": "post-edit", "branch": "alpha-84b", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 36 ++++++++++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 8 +++---- .claude/checkpoints/task-1754222974.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/swarm.js | 2 ++ 6 files changed, 44 insertions(+), 5 deletions(-) "}
diff --git a/src/cli/simple-commands/swarm.js b/src/cli/simple-commands/swarm.js
index 3f73210960..58d71aedf7 100644
--- a/src/cli/simple-commands/swarm.js
+++ b/src/cli/simple-commands/swarm.js
@@ -359,13 +359,50 @@ export async function swarmCommand(args, flags) {
execSync('which claude', { stdio: 'ignore' });
claudeAvailable = true;
} catch {
+ // If --claude flag is used, try to open Claude Code desktop app instead
+ if (flags && flags.claude) {
+ console.log('๐Ÿ–ฅ๏ธ Claude CLI not found, attempting to open Claude Code desktop app...');
+
+ // Try to open Claude Code desktop app based on platform
+ try {
+ if (process.platform === 'darwin') {
+ // macOS
+ execSync('open -a "Claude" 2>/dev/null || open -a "Claude Code" 2>/dev/null', { stdio: 'ignore' });
+ } else if (process.platform === 'win32') {
+ // Windows
+ execSync('start "" "Claude.exe" 2>nul || start "" "Claude Code.exe" 2>nul', { stdio: 'ignore', shell: true });
+ } else {
+ // Linux
+ execSync('claude-code 2>/dev/null || xdg-open claude-code 2>/dev/null', { stdio: 'ignore' });
+ }
+
+ console.log('โœ“ Attempting to open Claude Code desktop app');
+ console.log('\n๐Ÿ“‹ Copy this prompt into Claude Code:\n');
+ console.log('โ•'.repeat(80));
+ console.log(swarmPrompt);
+ console.log('โ•'.repeat(80));
+
+ // Save prompt to file for easy access
+ const promptFile = path.join(process.cwd(), '.claude-flow', `swarm-prompt-${Date.now()}.txt`);
+ await mkdirAsync(path.dirname(promptFile));
+ await writeTextFile(promptFile, swarmPrompt);
+ console.log(`\n๐Ÿ’พ Prompt saved to: ${promptFile}`);
+ return;
+ } catch (desktopError) {
+ console.log('โš ๏ธ Could not open Claude Code desktop app automatically');
+ console.log('Please open Claude Code manually and paste the prompt above');
+ return;
+ }
+ }
+
console.log('โš ๏ธ Claude Code CLI not found in PATH');
console.log('Install it with: npm install -g @anthropic-ai/claude-code');
+ console.log('Or use --claude flag to open Claude Code desktop app');
console.log('\nWould spawn Claude Code with swarm objective:');
console.log(`๐Ÿ“‹ Objective: ${objective}`);
- console.log(
- '\nTo use the built-in executor instead: claude-flow swarm "objective" --executor',
- );
+ console.log('\nOptions:');
+ console.log(' โ€ข Use --executor flag for built-in executor: claude-flow swarm "objective" --executor');
+ console.log(' โ€ข Use --claude flag to open desktop app: claude-flow swarm "objective" --claude');
return;
}