# VaahAI

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)
![Status](https://img.shields.io/badge/status-in%20development-yellow.svg)

**VaahAI** is a multi-agent AI CLI tool built with Microsoft's Autogen Framework, designed to enhance code quality and development workflows through AI-powered code review, auditing, generation, and scaffolding capabilities.

## 🌟 Features

- **Multi-Agent Architecture**: Specialized AI agents collaborate to perform complex tasks
- **Code Review**: Comprehensive code review focusing on quality, style, and best practices
- **Code Audit**: Security vulnerability detection, compliance checking, and architectural assessment
- **Code Generation**: AI-powered code generation from natural language descriptions
- **Multiple LLM Support**: OpenAI, Claude, Junie, and local models via Ollama
- **Flexible Configuration**: Layered configuration system with global defaults and project-specific settings
- **Git Integration**: Commit applied changes, generate meaningful commit messages, and prepare pull requests

## 🚀 Getting Started

### Prerequisites

- Python 3.9+
- [Poetry](https://python-poetry.org/docs/#installation) (Python package manager)
- Git
- Docker (optional, for code execution)

### Installation

```bash
# Clone the repository
git clone https://github.com/webreinvent/vaahai.git
cd vaahai

# Install dependencies with Poetry
poetry install

# Activate the Poetry virtual environment
poetry shell
```

### Development Setup

```bash
# Install development dependencies
poetry install --with dev

# Run tests
poetry run pytest

# Format code
poetry run black vaahai
poetry run isort vaahai

# Lint code
poetry run flake8 vaahai
poetry run mypy vaahai
```

### Configuration

```bash
# Run the configuration wizard
poetry run vaahai config init

# Or manually edit the configuration file
nano ~/.vaahai/config.toml
```

## 🛠️ Usage

### CLI Command Structure

VaahAI provides a modular CLI organized into logical command groups. The command structure follows this hierarchy:

```
vaahai [command_group] [command] [action] [options]
```

Where:
- `vaahai` is the main CLI application
- `command_group` is one of the logical groups (core, project, dev)
- `command` is a specific command within that group
- `action` is a subcommand or action for that command
- `options` are additional flags and parameters

#### Core Commands
- `vaahai config`: Configuration management
  - `vaahai config init`: Set up initial configuration
  - `vaahai config show`: Display current configuration
- `vaahai version`: Display version information

#### Project Commands
- `vaahai review`: Code review commands
  - `vaahai review run`: Run a code review on specified path
- `vaahai audit`: Security and compliance audit commands
  - `vaahai audit run`: Run a security/compliance audit on specified path

#### Development Commands
- `vaahai dev helloworld`: Test command to verify proper functioning
  - `vaahai dev helloworld run`: Execute the hello world test
- `vaahai dev showcase`: Demonstrate Rich formatting capabilities

All commands support the `--help` flag for detailed usage information. For backward compatibility, direct command access (e.g., `vaahai helloworld` instead of `vaahai dev helloworld`) is also supported.

### Global Options

The following options are available for all commands:

- `--verbose`: Enable verbose output (can also be set with `VAAHAI_VERBOSE=1`)
- `--quiet`: Suppress non-essential output (can also be set with `VAAHAI_QUIET=1`)
- `--config PATH`: Specify a custom configuration file path
- `--help`: Show help message and exit

### Basic Commands

```bash
# Show help information
vaahai --help

# Show help for a specific command group
vaahai dev --help

# Show help for a specific command
vaahai dev helloworld --help

# Test installation and configuration
vaahai dev helloworld run
# Or using backward compatibility
vaahai helloworld run

# Review code in a file or directory
vaahai review run --path ./my_project --depth standard
# This follows the structure: vaahai [command_group] [command] [action] [options]

# Audit a project for security and compliance
vaahai audit run --path ./my_project --security --compliance owasp

# Show version information
vaahai version

# View Rich formatting showcase
vaahai dev showcase
```

### Example Workflow

```bash
# Initialize configuration
vaahai config init

# Review a Python file
vaahai review run --path ./app.py --focus quality

# Apply suggested changes
vaahai apply --file review_suggestions.json

# Commit the changes
vaahai commit --message "Fix code quality issues in app.py"
```

### Terminal Output

VaahAI CLI uses Rich for consistent, styled terminal output. Output behavior can be controlled with:

- Verbose mode: Set `--verbose` flag or `VAAHAI_VERBOSE=1` environment variable
- Quiet mode: Set `--quiet` flag or `VAAHAI_QUIET=1` environment variable

For more details on the Rich integration, see the [Rich Integration Documentation](/docs/cli/rich_integration.md).

## 🏗️ Project Structure

```
vaahai/
├── ai_docs/         # AI-specific documentation
├── ai_prompts/      # Prompt templates for AI agents
├── docs/            # User and developer documentation
│   └── cli/         # CLI-specific documentation
├── specs/           # Project specifications and requirements
├── vaahai/          # Main package
│   ├── agents/      # Agent implementations
│   ├── cli/         # CLI commands and handlers
│   │   ├── commands/  # Command implementations
│   │   │   ├── core/      # Core command group
│   │   │   │   ├── config/    # Configuration commands
│   │   │   │   └── version/   # Version commands
│   │   │   ├── project/   # Project command group
│   │   │   │   ├── audit/     # Audit commands
│   │   │   │   └── review/    # Code review commands
│   │   │   ├── dev/       # Development command group
│   │   │   │   ├── helloworld/  # Hello world test command
│   │   │   │   └── showcase/   # Rich formatting showcase
│   │   │   └── helloworld/  # Legacy direct command (for backward compatibility)
│   │   ├── main.py     # CLI entry point
│   │   └── utils/      # CLI utilities
│   │       ├── console.py  # Rich formatting utilities
│   │       └── help.py     # Custom help formatting
│   ├── config/      # Configuration management
│   ├── llm/         # LLM provider integrations
│   └── utils/       # Utility functions and helpers
└── tests/           # Test suite
    └── cli/         # CLI tests
```

## 📝 Documentation

For more detailed documentation, please refer to:

- [Project Plan](/specs/PROJECT_PLAN.md)
- [Features Specification](/specs/FEATURES.md)
- [Technical Architecture](/specs/TECHNICAL_ARCHITECTURE.md)
- [User Guide](/docs/USER_GUIDE.md)
- [API Reference](/docs/API_REFERENCE.md)
- [CLI Documentation](/docs/cli/)
  - [Rich Integration Guide](/docs/cli/rich_integration.md)
  - [Command Groups Structure](/docs/cli/command_groups.md)

## 🤝 Contributing

We welcome contributions from the community! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details on how to get involved.

## 📄 License

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

## 🙏 Acknowledgements

- [Microsoft Autogen Framework](https://github.com/microsoft/autogen)
- [Typer](https://typer.tiangolo.com/)
- [InquirerPy](https://github.com/kazhala/InquirerPy)
- All our contributors and supporters
