Skip to content

webreinvent/vaahai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VaahAI

License Python Status

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
  • Intelligent Model Selection: Filter and recommend models based on capabilities (text, code, vision, etc.)
  • 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 (Python package manager)
  • Git
  • Docker (optional, for code execution)

Installation

# Install from PyPI
pip install vaahai

# Or 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

Quick Start

# Initialize configuration
vaahai config init

# Show current configuration
vaahai config show

# List available models
vaahai model list

# Run a simple test to verify installation
vaahai helloworld run

Development Setup

# Install development dependencies
poetry install --with dev

# Install pre-commit hooks
pre-commit install

# Run tests
poetry run pytest

# Run tests with coverage
poetry run pytest --cov=vaahai

# Format code
poetry run black vaahai
poetry run isort vaahai

# Lint code
poetry run flake8 vaahai
poetry run mypy vaahai

# Run all pre-commit hooks manually
pre-commit run --all-files

For more details on development tools, see Development Tools Documentation.

Configuration

# 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

Enhanced Help System

VaahAI features a Rich-formatted custom help system that provides visually appealing and well-organized help information:

  • Styled headers and descriptions with visual separation
  • Organized tables for commands, options, and environment variables
  • Consistent formatting across all commands and subcommands
  • Detailed descriptions and usage examples
  • Color-coded elements for improved readability

To access the enhanced help for any command:

# Main CLI help
vaahai --help

# Command group help
vaahai [command_group] --help

# Specific command help
vaahai [command_group] [command] --help

# Command action help
vaahai [command_group] [command] [action] --help

Global Options

  • --version, -v: Display the current version of VaahAI and exit
  • --verbose, -V: Enable verbose output with detailed logs and information
  • --quiet, -q: Suppress non-essential output
  • --config: Specify an alternative configuration file path
  • --help, -h: Show help message and exit

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
  • vaahai dev prompts: Demonstrate InquirerPy prompt 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.

Interactive Prompts

VaahAI CLI uses InquirerPy to provide interactive command-line prompts with rich styling. The prompt utilities include:

  • Text input with validation
  • Password input with masking
  • Confirmation prompts (yes/no)
  • Selection from a list of options
  • Multi-selection from a list of options
  • Fuzzy search selection
  • Number input with range validation
  • Path selection with auto-completion

All prompts support non-interactive mode with default values or appropriate error handling.

Basic Commands

# 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

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

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

Example Workflow

# 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.

πŸ§ͺ Testing

VaahAI includes a comprehensive test suite organized into unit tests and integration tests:

vaahai/test/
β”œβ”€β”€ unit/                 # Tests for individual components
β”‚   β”œβ”€β”€ test_cli_utils.py # Tests for console output utilities
β”‚   β”œβ”€β”€ test_help_utils.py # Tests for help formatting utilities
β”‚   └── test_version.py   # Tests for version command
└── integration/          # Tests for component interactions
    └── test_config_integration.py # Tests for config command

Run the test suite:

# Run all tests
poetry run pytest

# Run tests with coverage report
poetry run pytest --cov=vaahai

# Run specific test file
poetry run pytest vaahai/test/unit/test_cli_utils.py

# Run tests matching a pattern
poetry run pytest -k "config"

For more details on testing, see Testing Guide and Test Implementation.

πŸ—οΈ 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:

🀝 Contributing

We welcome contributions from the community! Please see our Contributing Guidelines for more details on how to get involved.

πŸ“„ License

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

πŸ™ Acknowledgements

About

Agentic Coding, Review, Audit and Generation

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages