Metadata-Version: 2.4
Name: mcli-framework
Version: 7.8.1
Summary: 🚀 High-performance CLI framework with Rust extensions, AI chat, and stunning visuals
Author-email: Luis Fernandez de la Vara <luis@lefv.io>
Maintainer-email: Luis Fernandez de la Vara <luis@lefv.io>
License: MIT
Project-URL: Homepage, https://github.com/gwicho38/mcli
Project-URL: Repository, https://github.com/gwicho38/mcli
Project-URL: Documentation, https://github.com/gwicho38/mcli#readme
Project-URL: Issues, https://github.com/gwicho38/mcli/issues
Project-URL: Changelog, https://github.com/gwicho38/mcli/releases
Project-URL: Source, https://github.com/gwicho38/mcli
Keywords: cli,command-line,framework,chat,assistant,rust,performance,visual,tui,terminal,ai,openai,anthropic,productivity
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Shells
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click<9.0.0,>=8.1.7
Requires-Dist: rich>=14.0.0
Requires-Dist: requests<3.0.0,>=2.31.0
Requires-Dist: tomli>=2.2.1
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: watchdog<4.0.0,>=3.0.0
Requires-Dist: tqdm<5.0.0,>=4.66.1
Requires-Dist: humanize<5.0.0,>=4.9.0
Requires-Dist: psutil<6.0.0,>=5.9.0
Requires-Dist: inquirerpy<0.4.0,>=0.3.4
Requires-Dist: gitpython<4.0.0,>=3.1.40
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: websockets>=12.0
Requires-Dist: beautifulsoup4>=4.13.5
Requires-Dist: fuzzywuzzy>=0.18.0
Requires-Dist: openai<2.0.0,>=1.3.0
Requires-Dist: anthropic>=0.60.0
Requires-Dist: ollama>=0.5.3
Requires-Dist: ipython<9.0.0,>=8.12.0
Requires-Dist: fastapi>=0.110.0
Requires-Dist: uvicorn>=0.27.0
Requires-Dist: uvloop>=0.19.0
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: redis>=5.0.0
Requires-Dist: aiohttp-sse-client>=0.2.1
Requires-Dist: aiomqtt>=2.0.0
Requires-Dist: opencv-python>=4.11.0.86
Requires-Dist: pillow>=11.2.1
Requires-Dist: numpy<2.0.0,>=1.24.0
Requires-Dist: scikit-image>=0.24.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: pypdf2>=3.0.1
Requires-Dist: pymupdf>=1.26.3
Requires-Dist: pandas>=2.3.1
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: matplotlib>=3.9.4
Requires-Dist: pydot>=4.0.1
Requires-Dist: graphviz>=0.21
Requires-Dist: seaborn>=0.13.0
Requires-Dist: plotly>=5.17.0
Requires-Dist: supabase>=2.18.1
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: alembic>=1.12.0
Requires-Dist: psycopg2-binary>=2.9.7
Requires-Dist: asyncpg>=0.29.0
Requires-Dist: torch>=2.0.0
Requires-Dist: torchvision>=0.15.0
Requires-Dist: pytorch-lightning>=2.0.0
Requires-Dist: scikit-learn<2.0.0,>=1.3.0
Requires-Dist: mlflow>=2.8.0
Requires-Dist: dvc>=3.0.0
Requires-Dist: polars>=0.19.0
Requires-Dist: pyarrow>=14.0.0
Requires-Dist: yfinance>=0.2.18
Requires-Dist: alpha-vantage>=2.3.1
Requires-Dist: alpaca-py==0.42.2
Requires-Dist: cvxpy>=1.4.0
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: passlib[bcrypt]>=1.7.4
Requires-Dist: pydantic-settings>=2.1.0
Requires-Dist: dynaconf>=3.2.0
Requires-Dist: pandera>=0.17.0
Requires-Dist: pendulum>=2.1.2
Requires-Dist: optuna>=3.4.0
Requires-Dist: PyPortfolioOpt>=1.5.5
Requires-Dist: jupyter>=1.0.0
Requires-Dist: jupyterlab>=4.0.0
Requires-Dist: ipykernel>=6.27.0
Requires-Dist: prometheus-client>=0.19.0
Requires-Dist: structlog>=23.2.0
Requires-Dist: gunicorn>=21.2.0
Requires-Dist: newrelic>=9.2.0
Requires-Dist: datadog>=0.49.0
Requires-Dist: orjson>=3.9.0
Requires-Dist: kafka-python>=2.0.2
Requires-Dist: streamlit>=1.50.0
Requires-Dist: altair<5.0.0,>=4.2.1
Requires-Dist: streamlit-autorefresh>=1.0.1
Requires-Dist: typer>=0.9.0
Requires-Dist: flask<3.0.0,>=2.3.0
Provides-Extra: gpu
Requires-Dist: cupy-cuda12x>=12.3.0; extra == "gpu"
Requires-Dist: nvidia-ml-py>=12.535.0; extra == "gpu"
Provides-Extra: chat
Provides-Extra: async-extras
Provides-Extra: video
Provides-Extra: documents
Provides-Extra: viz
Provides-Extra: database
Provides-Extra: ml
Provides-Extra: monitoring
Provides-Extra: streaming
Provides-Extra: dashboard
Provides-Extra: web
Provides-Extra: dev
Requires-Dist: pytest>=8.4.1; extra == "dev"
Requires-Dist: pytest-cov<5.0.0,>=4.1.0; extra == "dev"
Requires-Dist: pytest-mock>=3.14.1; extra == "dev"
Requires-Dist: pytest-asyncio>=1.1.0; extra == "dev"
Requires-Dist: pytest-benchmark>=4.0.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.2.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
Requires-Dist: hypothesis>=6.92.0; extra == "dev"
Requires-Dist: faker>=22.0.0; extra == "dev"
Requires-Dist: responses>=0.24.0; extra == "dev"
Requires-Dist: freezegun>=1.4.0; extra == "dev"
Requires-Dist: pytest-html>=4.1.0; extra == "dev"
Requires-Dist: pytest-json-report>=1.5.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort<6.0.0,>=5.12.0; extra == "dev"
Requires-Dist: mypy<2.0.0,>=1.7.1; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: pre-commit>=3.6.0; extra == "dev"
Requires-Dist: build>=1.2.2.post1; extra == "dev"
Requires-Dist: maturin>=1.9.3; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Provides-Extra: all
Dynamic: license-file

# 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](https://docs.astral.sh/uv/) (recommended) or pip

### Installation from PyPI (Recommended)

The easiest way to install mcli is from PyPI:

```bash
# 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:

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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:

```bash
# 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](docs/features/SHELL_COMPLETION.md) for detailed setup and troubleshooting.

## Development Workflow

This project uses [UV](https://docs.astral.sh/uv/) for fast, reliable Python package management.

### Setup Development Environment

```bash
# 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

```bash
# 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:

```bash
# 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:**
   ```bash
   cp .env.example .env
   ```

2. **Edit the `.env` file with your configuration:**
   ```bash
   # 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:**
   ```bash
   # 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:

```python
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](LICENSE) for details.

## Acknowledgments

- Built with [Click](https://click.palletsprojects.com/) for CLI interfaces
- Styled with [Rich](https://github.com/Textualize/rich) for beautiful output
- Managed with [UV](https://docs.astral.sh/uv/) for fast Python packaging
