Skip to main content

๐Ÿš€ High-performance CLI framework with Rust extensions, AI chat, and stunning visuals

Project description

MCLI

A modern CLI framework with chat capabilities, command management, and extensible architecture.

Features

  • ๐Ÿš€ Modern CLI Framework: Built with Click and Rich for beautiful command-line interfaces
  • ๐Ÿ’ฌ AI Chat Integration: Built-in chat capabilities with OpenAI and Anthropic support
  • ๐Ÿ”ง Command Management: Dynamic command discovery and registration
  • ๐ŸŽจ Rich UI: Colorful, interactive command-line experience
  • ๐Ÿ“ฆ Easy Extension: Simple framework for adding custom commands
  • ๐Ÿ› ๏ธ Developer Tools: IPython integration for interactive development
  • โšก Shell Completion: Full tab completion for bash, zsh, and fish shells

Quick Start

Prerequisites

  • Python 3.9 or higher
  • UV (recommended) or pip

Installation from PyPI (Recommended)

The easiest way to install mcli is from PyPI:

# Install latest version (includes all features)
pip install mcli-framework

# Or with UV (recommended)
uv pip install mcli-framework

# Optional: GPU support (CUDA required)
pip install "mcli-framework[gpu]"

Note: As of v7.0.0, all features are included by default. GPU support is optional as it requires CUDA.

Self-Update Feature: Once installed from PyPI, you can update mcli to the latest version with:

# Check for updates
mcli self update --check

# Install updates automatically
mcli self update

# Install with confirmation
mcli self update --yes

Installation from Source

For development or if you want to customize mcli:

With UV

# Clone the repository
git clone https://github.com/gwicho38/mcli.git
cd mcli

# Install with UV (recommended)
uv venv
uv pip install -e .

# Or install development dependencies
uv pip install -e ".[dev]"

With pip

# Clone the repository
git clone https://github.com/gwicho38/mcli.git
cd mcli

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the package
pip install -e .

Usage

# Show available commands
mcli --help

# Start a chat session
mcli chat

# Get version information
mcli version

# Manage the application
mcli self --help

# List available commands
mcli commands

Shell Completion (Optional)

Enable tab completion for faster command discovery:

# Install completion for your shell (auto-detects bash/zsh/fish)
mcli completion install

# Check completion status
mcli completion status

After installation, you'll have full tab completion:

  • mcli <TAB> โ†’ shows all available commands
  • mcli workflow <TAB> โ†’ shows workflow subcommands
  • mcli workflow politician-trading <TAB> โ†’ shows politician-trading options

See SHELL_COMPLETION.md for detailed setup and troubleshooting.

Development Workflow

This project uses UV for fast, reliable Python package management.

Setup Development Environment

# 1. Set up the development environment
make setup

# Or manually with UV
uv venv
uv pip install -e ".[dev]"

# 2. Configure environment variables
cp .env.example .env
# Edit .env with your API keys and configuration

Available Make Commands

# Setup and Installation
make setup                  # Setup UV environment with caching
make install               # Install the package with caching

# Building
make wheel                 # Build Python wheel package
make portable              # Build portable executable
make validate-build        # Validate application for distribution

# Testing
make test                  # Test basic installation and functionality
make test-all              # Run complete test suite (if available)
make validate-build        # Comprehensive build validation

# CI/CD
make ci-trigger-build      # Trigger GitHub Actions build workflow
make ci-trigger-test       # Trigger GitHub Actions test workflow
make ci-watch              # Watch GitHub Actions runs in real-time
make ci-status             # Show GitHub Actions run status

# Maintenance
make clean                 # Clean all build artifacts
make debug                 # Show debug information

Project Structure

mcli/
โ”œโ”€โ”€ src/mcli/              # Main package source
โ”‚   โ”œโ”€โ”€ app/               # Application modules
โ”‚   โ”‚   โ”œโ”€โ”€ main.py        # Main CLI entry point
โ”‚   โ”‚   โ”œโ”€โ”€ chat_cmd.py    # Chat command implementation
โ”‚   โ”‚   โ””โ”€โ”€ commands_cmd.py # Command management
โ”‚   โ”œโ”€โ”€ chat/              # Chat system
โ”‚   โ”œโ”€โ”€ lib/               # Shared libraries
โ”‚   โ”‚   โ”œโ”€โ”€ api/           # API functionality
โ”‚   โ”‚   โ”œโ”€โ”€ ui/            # UI components
โ”‚   โ”‚   โ””โ”€โ”€ logger/        # Logging utilities
โ”‚   โ””โ”€โ”€ self/              # Self-management commands
โ”œโ”€โ”€ tests/                 # Test suite
โ”œโ”€โ”€ .github/workflows/     # CI/CD workflows
โ”œโ”€โ”€ pyproject.toml         # Project configuration
โ”œโ”€โ”€ Makefile              # Build and development commands
โ””โ”€โ”€ README.md             # This file

Dependencies

Core Dependencies

  • click: Command-line interface creation
  • rich: Rich text and beautiful formatting
  • requests: HTTP library
  • tomli: TOML parser

AI & Chat

  • openai: OpenAI API integration
  • anthropic: Anthropic API integration

Development Tools

  • ipython: Interactive Python shell
  • inquirerpy: Interactive command-line prompts

Optional Dependencies

MCLI has been optimized with minimal core dependencies. Install only what you need:

# Chat and AI features
uv pip install -e ".[chat]"

# Video processing
uv pip install -e ".[video]"

# Document processing (PDF, Excel, etc.)
uv pip install -e ".[documents]"

# ML/Trading features
uv pip install -e ".[ml]"

# Database support
uv pip install -e ".[database]"

# Web dashboards
uv pip install -e ".[dashboard]"

# Development tools
uv pip install -e ".[dev]"

# Everything
uv pip install -e ".[all]"

Available extras:

  • chat - OpenAI, Anthropic, Ollama support
  • async-extras - FastAPI, Redis, advanced async features
  • video - OpenCV, image processing
  • documents - PDF, Excel processing
  • viz - Matplotlib, Plotly visualization
  • database - Supabase, SQLAlchemy, PostgreSQL
  • ml - PyTorch, MLflow, DVC, trading features
  • gpu - CUDA support
  • monitoring - Prometheus, Datadog
  • streaming - Kafka support
  • dashboard - Streamlit dashboards
  • web - Flask, FastAPI web frameworks
  • dev - Testing, linting, type checking
  • all - All optional features

Configuration

MCLI can be configured through environment variables and configuration files.

Environment Setup

  1. Copy the environment template:

    cp .env.example .env
    
  2. Edit the .env file with your configuration:

    # Required for AI chat functionality
    OPENAI_API_KEY=your-openai-api-key-here
    ANTHROPIC_API_KEY=your-anthropic-api-key-here
    
    # Required for politician trading features
    SUPABASE_URL=https://your-project.supabase.co
    SUPABASE_ANON_KEY=your-supabase-anon-key-here
    SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key-here
    
  3. Optional development settings:

    # Enable debug logging
    MCLI_TRACE_LEVEL=1
    MCLI_DEBUG=true
    
    # Performance optimization
    MCLI_AUTO_OPTIMIZE=true
    

See .env.example for a complete list of configuration options.

Creating Custom Commands

MCLI supports dynamic command discovery. Add your commands to the appropriate modules:

import click
from mcli.lib.ui.styling import success

@click.command()
def my_command():
    """My custom command."""
    success("Hello from my custom command!")

CI/CD

The project includes comprehensive CI/CD with GitHub Actions:

  • Build Workflow: Multi-platform builds (Ubuntu, macOS)
  • Test Workflow: Multi-Python version testing (3.9-3.12)
  • Automatic Triggers: Runs on push/PR to main branch
  • Manual Triggers: Use make ci-trigger-* commands

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Run tests: make test
  5. Validate build: make validate-build
  6. Commit your changes: git commit -am 'Add feature'
  7. Push to your fork: git push origin feature-name
  8. Create a Pull Request

License

MIT License - see LICENSE for details.

Acknowledgments

  • Built with Click for CLI interfaces
  • Styled with Rich for beautiful output
  • Managed with UV for fast Python packaging

Project details


Release history Release notifications | RSS feed

This version

7.2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcli_framework-7.2.0.tar.gz (751.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcli_framework-7.2.0-py3-none-any.whl (686.8 kB view details)

Uploaded Python 3

File details

Details for the file mcli_framework-7.2.0.tar.gz.

File metadata

  • Download URL: mcli_framework-7.2.0.tar.gz
  • Upload date:
  • Size: 751.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcli_framework-7.2.0.tar.gz
Algorithm Hash digest
SHA256 96ab26dbe7dfdcc5a121ddf4fa992cf59c4aa097d8245ebdf86f12474a6c40f8
MD5 18f38f10173c4c05b58f39c299d973d2
BLAKE2b-256 42b061a59810f5f45c9a4efa4839223af8a54e1ca97b3e9659119f0316564081

See more details on using hashes here.

File details

Details for the file mcli_framework-7.2.0-py3-none-any.whl.

File metadata

  • Download URL: mcli_framework-7.2.0-py3-none-any.whl
  • Upload date:
  • Size: 686.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcli_framework-7.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec6f8d08975e000388e129a887f7256299928f16d8ed51ea3437821156a555a4
MD5 0f739a09b92ad005671dab56c98bddf8
BLAKE2b-256 323c89e86f454e13b372c3b49ef6dccc295772f98e751ee8baba0d89715bc14c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page