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: File edit:

rUv870b53313ad1
diff --git a/v3/@claude-flow/cli/README.md b/v3/@claude-flow/cli/README.md
new file mode 100644
index 0000000000..3d1a24a0e5
--- /dev/null
+++ b/v3/@claude-flow/cli/README.md
@@ -0,0 +1,181 @@
+# @claude-flow/cli
+
+[![npm version](https://img.shields.io/npm/v/@claude-flow/cli.svg)](https://www.npmjs.com/package/@claude-flow/cli)
+[![npm downloads](https://img.shields.io/npm/dm/@claude-flow/cli.svg)](https://www.npmjs.com/package/@claude-flow/cli)
+[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
+[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
+[![Node.js](https://img.shields.io/badge/Node.js-20+-green.svg)](https://nodejs.org/)
+
+> Modern CLI module for Claude Flow V3 - command parsing, interactive prompts, and beautiful output formatting.
+
+## Features
+
+- **Advanced Argument Parsing** - Full support for flags, options, subcommands, and positional arguments
+- **Interactive Prompts** - Rich interactive mode with confirmations, selections, and input validation
+- **Beautiful Output** - Colored output, tables, progress bars, and multiple format options (text, JSON, table)
+- **Type-Safe** - Full TypeScript support with comprehensive type definitions
+- **Global Options** - Built-in support for `--help`, `--version`, `--verbose`, `--quiet`, and more
+- **Auto-Completion** - Shell completion support for commands and options
+- **Migration Tools** - Built-in V2 to V3 migration commands
+
+## Installation
+
+```bash
+npm install @claude-flow/cli
+```
+
+## Quick Start
+
+```typescript
+import { CommandParser, Output, prompt } from '@claude-flow/cli';
+
+// Create a parser instance
+const parser = new CommandParser();
+
+// Register a command
+parser.registerCommand({
+ name: 'swarm',
+ description: 'Manage swarm operations',
+ options: [
+ {
+ name: 'topology',
+ short: 't',
+ description: 'Swarm topology type',
+ type: 'string',
+ choices: ['mesh', 'hierarchical', 'ring'],
+ default: 'mesh'
+ }
+ ],
+ subcommands: [
+ { name: 'init', description: 'Initialize a new swarm' },
+ { name: 'status', description: 'Show swarm status' }
+ ]
+});
+
+// Parse arguments
+const result = parser.parse(process.argv.slice(2));
+
+// Output formatting
+const output = new Output();
+output.success('Swarm initialized successfully!');
+output.table([
+ { agent: 'queen', status: 'running' },
+ { agent: 'worker-1', status: 'idle' }
+]);
+```
+
+## API Reference
+
+### CommandParser
+
+```typescript
+const parser = new CommandParser(options?: ParserOptions);
+
+// Register commands
+parser.registerCommand(command: Command);
+
+// Parse arguments
+const result = parser.parse(args: string[]): ParseResult;
+
+// Validate flags
+const errors = parser.validateFlags(flags: ParsedFlags, command?: Command): string[];
+
+// Get all registered commands
+const commands = parser.getAllCommands(): Command[];
+```
+
+### Output Formatting
+
+```typescript
+import { Output } from '@claude-flow/cli';
+
+const output = new Output({ color: true, format: 'text' });
+
+// Message types
+output.success('Operation completed');
+output.error('Something went wrong');
+output.warning('Proceed with caution');
+output.info('FYI: This is informational');
+output.debug('Debug details');
+
+// Structured output
+output.table(data, columns);
+output.json(object);
+output.list(items);
+
+// Progress indication
+output.spinner('Loading...');
+output.progress(current, total);
+```
+
+### Interactive Prompts
+
+```typescript
+import { prompt } from '@claude-flow/cli';
+
+// Text input
+const name = await prompt.text('Enter your name:');
+
+// Selection
+const choice = await prompt.select('Choose option:', ['A', 'B', 'C']);
+
+// Confirmation
+const confirmed = await prompt.confirm('Continue?');
+
+// Password (hidden input)
+const password = await prompt.password('Enter password:');
+
+// Multi-select
+const selections = await prompt.multiSelect('Select features:', features);
+```
+
+## Global Options
+
+All commands support these global options:
+
+| Option | Short | Description |
+|--------|-------|-------------|
+| `--help` | `-h` | Show help information |
+| `--version` | `-V` | Show version number |
+| `--verbose` | `-v` | Enable verbose output |
+| `--quiet` | `-q` | Suppress non-essential output |
+| `--config` | `-c` | Path to configuration file |
+| `--format` | `-f` | Output format (text, json, table) |
+| `--no-color` | - | Disable colored output |
+| `--interactive` | `-i` | Enable interactive mode |
+
+## Built-in Commands
+
+```bash
+# Migration from V2 to V3
+claude-flow migrate --from v2 --dry-run
+
+# Help and version
+claude-flow --help
+claude-flow --version
+
+# Verbose output
+claude-flow swarm status --verbose
+```
+
+## TypeScript Types
+
+```typescript
+import type {
+ Command,
+ CommandOption,
+ ParseResult,
+ ParsedFlags,
+ CommandContext,
+ V3Config
+} from '@claude-flow/cli';
+```
+
+## Related Packages
+
+- [@claude-flow/shared](../shared) - Shared types and utilities
+- [@claude-flow/swarm](../swarm) - Swarm coordination module
+
+## License
+
+MIT
diff --git a/v3/vitest.config.ts b/v3/vitest.config.ts
index eb03789b8c..2269157593 100644
--- a/v3/vitest.config.ts
+++ b/v3/vitest.config.ts
@@ -23,6 +23,8 @@ export default defineConfig({
'__tests__/**/*.spec.ts',
'@claude-flow/**/__tests__/**/*.test.ts',
'@claude-flow/**/__tests__/**/*.spec.ts',
+ 'mcp/__tests__/**/*.test.ts',
+ 'mcp/__tests__/**/*.spec.ts',
],
// Exclude patterns