Skip to content

AI-et-al/multi-ai-collab

Repository files navigation

Multi-AI Collaborative System - Interactive CLI

An interactive command-line interface for collaborating with multiple AI systems (Claude and GPT-5) simultaneously.

Features

  • 🎨 Color-coded output - Claude (Blue) and GPT-5 (Green)
  • 🔄 Real-time streaming - Live responses from both AIs
  • 📊 Side-by-side comparison - Compare AI responses
  • 📜 Conversation history - Track all interactions
  • 🤖 Idle swarm control - Manage background AI workers
  • 💾 Session management - Export/import sessions
  • 🎯 Targeted commands - Ask specific AIs
  • 🤝 Collaboration mode - Explicit multi-AI cooperation

Installation

cd multi-ai-collab
npm install
npm run build

Usage

Interactive Mode (Default)

npm start
# or
multi-ai

Direct Commands

# Send to both AIs
multi-ai instruct "Create a REST API for user authentication"

# Ask specific AI
multi-ai ask claude "What are SOLID principles?"
multi-ai ask gpt5 "Optimize this algorithm"

# Collaboration mode
multi-ai collaborate "Build a real-time chat application"

# Control swarm
multi-ai swarm start
multi-ai swarm stop

# View status
multi-ai status

# View history
multi-ai history --limit 10

# Compare responses
multi-ai compare

# Export session
multi-ai export --file session.json

Available Commands

Interactive Mode Commands

Command Description
instruct <message> Send instruction to both AIs
ask claude <message> Target Claude specifically
ask gpt5 <message> Target GPT-5 specifically
collaborate <task> Explicit collaboration mode
swarm start/stop Control idle swarm
status Show system status
history [limit] View conversation history
compare Compare AI responses side-by-side
clear Clear screen
export [filename] Export session data
help Show help message
exit Exit the CLI

Example Interactions

Basic Instruction

multi-ai> instruct Create a user authentication API

🔵 CLAUDE [14:30:25]
## Claude's Response
I understand you want: "Create a user authentication API"
...

🟢 GPT5 [14:30:26]
## GPT-5's Response
Regarding: "Create a user authentication API"
...

Collaboration Mode

multi-ai> collaborate Build a real-time chat application

╭──────────────────────────────────────────────────────╮
│                                                      │
│         🔄 COLLABORATION MODE                        │
│                                                      │
│         Task: Build a real-time chat application    │
│         Both AIs working in parallel...             │
│                                                      │
╰──────────────────────────────────────────────────────╯

Status Display

multi-ai> status

┌────────────────────┬────────────────────┐
│ Component          │ Status             │
├────────────────────┼────────────────────┤
│ Claude AI          │ Active             │
│ GPT-5 AI           │ Active             │
│ Idle Swarm         │ Stopped            │
│ Session ID         │ session-abc123     │
│ Messages           │ 15                 │
└────────────────────┴────────────────────┘

Claude Flow Integration

The CLI automatically integrates with Claude Flow hooks:

# Pre-task hook
npx claude-flow@alpha hooks pre-task --description "Starting CLI session"

# Post-edit hook (automatic)
npx claude-flow@alpha hooks post-edit --memory-key "multi-ai/cli/last-command"

# Session-end hook
npx claude-flow@alpha hooks session-end --export-metrics true

Project Structure

multi-ai-collab/
├── src/
│   ├── cli/
│   │   ├── multi-ai-cli.ts       # Main CLI interface
│   │   └── command-handlers.ts   # Command implementations
│   └── utils/
│       ├── display-formatter.ts  # Color-coded output
│       ├── diff-viewer.ts        # Code comparison
│       └── session-manager.ts    # Session management
├── tests/
├── package.json
├── tsconfig.json
└── README.md

Technologies Used

  • commander - CLI framework
  • inquirer - Interactive prompts
  • chalk - Terminal colors
  • ora - Loading spinners
  • marked - Markdown rendering
  • diff - Code comparison
  • cli-table3 - Table formatting
  • boxen - Styled boxes

Development

# Development mode with auto-reload
npm run dev

# Build TypeScript
npm run build

# Type checking
npm run typecheck

# Linting
npm run lint

# Run tests
npm test

Environment Variables

# Debug mode (shows hook calls)
DEBUG=true multi-ai

# Custom session ID
CLAUDE_FLOW_SESSION_ID=my-session multi-ai

Session Management

Sessions are automatically tracked and can be exported:

# Export current session
multi-ai export --file my-session.json

# Session data includes:
# - All messages (with timestamps)
# - AI responses
# - Commands executed
# - Session metadata

Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature-name
  3. Commit changes: git commit -am 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit pull request

License

MIT License - see LICENSE file for details

Support

For issues and questions:

  • GitHub Issues: [repository-url]/issues
  • Documentation: [repository-url]/docs

Note: This CLI is designed to work with the Claude Flow orchestration system. Ensure Claude Flow is installed and configured before use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published