๐ 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 commandsmcli workflow <TAB>โ shows workflow subcommandsmcli 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 supportasync-extras- FastAPI, Redis, advanced async featuresvideo- OpenCV, image processingdocuments- PDF, Excel processingviz- Matplotlib, Plotly visualizationdatabase- Supabase, SQLAlchemy, PostgreSQLml- PyTorch, MLflow, DVC, trading featuresgpu- CUDA supportmonitoring- Prometheus, Datadogstreaming- Kafka supportdashboard- Streamlit dashboardsweb- Flask, FastAPI web frameworksdev- Testing, linting, type checkingall- All optional features
Configuration
MCLI can be configured through environment variables and configuration files.
Environment Setup
-
Copy the environment template:
cp .env.example .env
-
Edit the
.envfile 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
-
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
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests:
make test - Validate build:
make validate-build - Commit your changes:
git commit -am 'Add feature' - Push to your fork:
git push origin feature-name - Create a Pull Request
License
MIT License - see LICENSE for details.
Acknowledgments
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcli_framework-7.4.0.tar.gz.
File metadata
- Download URL: mcli_framework-7.4.0.tar.gz
- Upload date:
- Size: 837.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a783848bc381467166967c28547fa4884f906e520c0daafb7d396743f98450c
|
|
| MD5 |
c98cfee05bc2560037d00d83dc4ed511
|
|
| BLAKE2b-256 |
1e4b4342f08591b72ac8d651f9808cd91c840a607eefda71674f664f187f328a
|
File details
Details for the file mcli_framework-7.4.0-py3-none-any.whl.
File metadata
- Download URL: mcli_framework-7.4.0-py3-none-any.whl
- Upload date:
- Size: 780.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da94393513704d7ccad6befede72f1d3a68725d767fed6dfd4219bd3d74c39dd
|
|
| MD5 |
0a2bde627d8fff3669da087a25a68ebe
|
|
| BLAKE2b-256 |
1aef28e3abe09fcbebe44b761bccfa7355d130ed2339d045b31cf015e9b2dc10
|