JSPM

  • Created
  • Published
  • Downloads 26
  • Score
    100M100P100Q80688F
  • License MIT

CLI tools for managing multi-agent development environments with tmux

Package Exports

  • ca-agent-cli
  • ca-agent-cli/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ca-agent-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Agent CLI

CLI tools for managing multi-agent development environments with tmux. Streamline your multi-agent workflow by automating tmux session creation, agent initialization, and inter-agent communication.

npm version License: MIT Node.js Version

Features

  • 🚀 Automated Setup: Initialize complex multi-agent tmux sessions with a single command
  • 📤 Inter-Agent Messaging: Send messages between agents without switching panes
  • 🔍 Smart Configuration: Automatically discovers configuration files in parent directories
  • 📊 Flexible Layouts: Support for various pane layouts (2x4 grid by default)
  • 📝 Activity Logging: Keep track of all agent interactions and messages
  • 🎯 Project-Specific Config: Define different agent setups for different projects

Installation

# Global installation (recommended)
npm install -g ca-agent-cli

# Or install locally in your project
npm install --save-dev ca-agent-cli

Quick Start

  1. Install the CLI globally:

    npm install -g ca-agent-cli
  2. Create a .agentconfig.yml in your project:

    cat > .agentconfig.yml << 'EOF'
    session:
      name: myproject
      window: agents
      layout: 2x4
    
    agents:
      - name: frontend
        pane: 1
        role: "Frontend Developer"
        init_command: "echo 'Frontend agent ready'"
    
      - name: backend
        pane: 2
        role: "Backend Developer"
        init_command: "echo 'Backend agent ready'"
    EOF
  3. Initialize your agents:

    agent-init
  4. Send messages between agents:

    agent-send send backend "Please create the user API endpoint"

Configuration

Configuration File

Create a .agentconfig.yml file in your project root. The CLI will search for this file in the current directory and all parent directories.

# Session configuration
session:
  name: multiagent          # tmux session name
  window: agent            # tmux window name
  layout: 2x4              # Layout pattern (2 columns x 4 rows)

# Agent definitions
agents:
  - name: architect
    pane: 1                # Pane number (1-8 for 2x4 layout)
    role: "System Architect"
    init_command: |        # Command to run when initializing
      export ANTHROPIC_MODEL="claude-3-opus-20240229"
      claude
    init_message: |        # Initial message to send
      You are the system architect. Please review the requirements.

  - name: frontend
    pane: 2
    role: "Frontend Developer"
    init_command: "node"
    init_message: "Ready for frontend development tasks"

# Logging configuration (optional)
logging:
  enabled: true
  directory: logs
  format: "[{{timestamp}}] {{agent}}: {{action}} - \"{{message}}\""

Layout Options

Currently supports:

  • 2x4: 2 columns × 4 rows (8 panes total)
  • More layouts coming soon!

Usage

Initialize Session

# Basic initialization
agent-init

# With custom config file
agent-init -c /path/to/custom-config.yml

# Without auto-attaching to the session
agent-init --no-attach

Send Messages

# Send a message to an agent
agent-send send <agent-name> "<message>"

# Examples
agent-send send frontend "Please update the login component"
agent-send send backend "Database migration completed"

# List all available agents
agent-send list

# Use custom config file
agent-send send architect "Review the API design" -c ./configs/project.yml

Command Options

agent-init

  • -c, --config <path>: Path to configuration file
  • --no-attach: Don't attach to session after creation
  • -h, --help: Display help
  • -V, --version: Display version

agent-send

  • send <agent> <message>: Send message to agent
  • list: List all configured agents
  • -c, --config <path>: Path to configuration file
  • -h, --help: Display help

Advanced Usage

Multiple Projects

You can manage multiple projects by using different configuration files:

# Project A
agent-init -c ~/projects/projectA/.agentconfig.yml

# Project B
agent-init -c ~/projects/projectB/.agentconfig.yml

CI/CD Integration

# .github/workflows/agent-test.yml
- name: Setup agents
  run: |
    npm install -g ca-agent-cli
    agent-init --no-attach

- name: Run agent tasks
  run: |
    agent-send send tester "Run all tests"
    agent-send send builder "Build the project"

Scripting

#!/bin/bash
# deploy.sh

# Initialize agents
agent-init --no-attach

# Send deployment commands
agent-send send devops "Pull latest changes"
agent-send send backend "Run database migrations"
agent-send send frontend "Build production bundle"
agent-send send devops "Deploy to production"

Requirements

  • Node.js >= 14.0.0
  • tmux installed on your system
    • macOS: brew install tmux
    • Ubuntu/Debian: sudo apt-get install tmux
    • RHEL/CentOS: sudo yum install tmux

Troubleshooting

tmux not found

# Install tmux first
brew install tmux  # macOS
sudo apt-get install tmux  # Ubuntu/Debian

Session already exists

# Kill existing session
tmux kill-session -t <session-name>

# Or use a different session name in config

Configuration file not found

# Check file exists
ls -la .agentconfig.yml

# Specify path explicitly
agent-init -c ./path/to/.agentconfig.yml

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Roadmap

  • Support for more layout patterns
  • Agent health monitoring
  • Message history and replay
  • Web UI for agent management
  • Plugin system for custom agent types
  • Integration with popular AI platforms

Made with ❤️ by Nowly Lab