# 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](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
Raw data
{
"_id": null,
"home_page": null,
"name": "mcli-framework",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Luis Fernandez de la Vara <luis@lefv.io>",
"keywords": "cli, command-line, framework, chat, assistant, rust, performance, visual, tui, terminal, ai, openai, anthropic, productivity",
"author": null,
"author_email": "Luis Fernandez de la Vara <luis@lefv.io>",
"download_url": "https://files.pythonhosted.org/packages/8d/00/34e2616fbc441861c34c067f17eb28c9589576fa7c4fdca806d35f60649e/mcli_framework-7.1.3.tar.gz",
"platform": null,
"description": "# MCLI\n\nA modern CLI framework with chat capabilities, command management, and extensible architecture.\n\n## Features\n\n- \ud83d\ude80 **Modern CLI Framework**: Built with Click and Rich for beautiful command-line interfaces\n- \ud83d\udcac **AI Chat Integration**: Built-in chat capabilities with OpenAI and Anthropic support\n- \ud83d\udd27 **Command Management**: Dynamic command discovery and registration\n- \ud83c\udfa8 **Rich UI**: Colorful, interactive command-line experience\n- \ud83d\udce6 **Easy Extension**: Simple framework for adding custom commands\n- \ud83d\udee0\ufe0f **Developer Tools**: IPython integration for interactive development\n- \u26a1 **Shell Completion**: Full tab completion for bash, zsh, and fish shells\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.9 or higher\n- [UV](https://docs.astral.sh/uv/) (recommended) or pip\n\n### Installation from PyPI (Recommended)\n\nThe easiest way to install mcli is from PyPI:\n\n```bash\n# Install latest version (includes all features)\npip install mcli-framework\n\n# Or with UV (recommended)\nuv pip install mcli-framework\n\n# Optional: GPU support (CUDA required)\npip install \"mcli-framework[gpu]\"\n```\n\n**Note:** As of v7.0.0, all features are included by default. GPU support is optional as it requires CUDA.\n\n**Self-Update Feature:** Once installed from PyPI, you can update mcli to the latest version with:\n\n```bash\n# Check for updates\nmcli self update --check\n\n# Install updates automatically\nmcli self update\n\n# Install with confirmation\nmcli self update --yes\n```\n\n### Installation from Source\n\nFor development or if you want to customize mcli:\n\n#### With UV\n\n```bash\n# Clone the repository\ngit clone https://github.com/gwicho38/mcli.git\ncd mcli\n\n# Install with UV (recommended)\nuv venv\nuv pip install -e .\n\n# Or install development dependencies\nuv pip install -e \".[dev]\"\n```\n\n#### With pip\n\n```bash\n# Clone the repository\ngit clone https://github.com/gwicho38/mcli.git\ncd mcli\n\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate # On Windows: .venv\\Scripts\\activate\n\n# Install the package\npip install -e .\n```\n\n### Usage\n\n```bash\n# Show available commands\nmcli --help\n\n# Start a chat session\nmcli chat\n\n# Get version information\nmcli version\n\n# Manage the application\nmcli self --help\n\n# List available commands\nmcli commands\n```\n\n### Shell Completion (Optional)\n\nEnable tab completion for faster command discovery:\n\n```bash\n# Install completion for your shell (auto-detects bash/zsh/fish)\nmcli completion install\n\n# Check completion status\nmcli completion status\n```\n\nAfter installation, you'll have full tab completion:\n- `mcli <TAB>` \u2192 shows all available commands\n- `mcli workflow <TAB>` \u2192 shows workflow subcommands \n- `mcli workflow politician-trading <TAB>` \u2192 shows politician-trading options\n\nSee [SHELL_COMPLETION.md](SHELL_COMPLETION.md) for detailed setup and troubleshooting.\n\n## Development Workflow\n\nThis project uses [UV](https://docs.astral.sh/uv/) for fast, reliable Python package management.\n\n### Setup Development Environment\n\n```bash\n# 1. Set up the development environment\nmake setup\n\n# Or manually with UV\nuv venv\nuv pip install -e \".[dev]\"\n\n# 2. Configure environment variables\ncp .env.example .env\n# Edit .env with your API keys and configuration\n```\n\n### Available Make Commands\n\n```bash\n# Setup and Installation\nmake setup # Setup UV environment with caching\nmake install # Install the package with caching\n\n# Building\nmake wheel # Build Python wheel package\nmake portable # Build portable executable\nmake validate-build # Validate application for distribution\n\n# Testing\nmake test # Test basic installation and functionality\nmake test-all # Run complete test suite (if available)\nmake validate-build # Comprehensive build validation\n\n# CI/CD\nmake ci-trigger-build # Trigger GitHub Actions build workflow\nmake ci-trigger-test # Trigger GitHub Actions test workflow\nmake ci-watch # Watch GitHub Actions runs in real-time\nmake ci-status # Show GitHub Actions run status\n\n# Maintenance\nmake clean # Clean all build artifacts\nmake debug # Show debug information\n```\n\n### Project Structure\n\n```\nmcli/\n\u251c\u2500\u2500 src/mcli/ # Main package source\n\u2502 \u251c\u2500\u2500 app/ # Application modules\n\u2502 \u2502 \u251c\u2500\u2500 main.py # Main CLI entry point\n\u2502 \u2502 \u251c\u2500\u2500 chat_cmd.py # Chat command implementation\n\u2502 \u2502 \u2514\u2500\u2500 commands_cmd.py # Command management\n\u2502 \u251c\u2500\u2500 chat/ # Chat system\n\u2502 \u251c\u2500\u2500 lib/ # Shared libraries\n\u2502 \u2502 \u251c\u2500\u2500 api/ # API functionality\n\u2502 \u2502 \u251c\u2500\u2500 ui/ # UI components\n\u2502 \u2502 \u2514\u2500\u2500 logger/ # Logging utilities\n\u2502 \u2514\u2500\u2500 self/ # Self-management commands\n\u251c\u2500\u2500 tests/ # Test suite\n\u251c\u2500\u2500 .github/workflows/ # CI/CD workflows\n\u251c\u2500\u2500 pyproject.toml # Project configuration\n\u251c\u2500\u2500 Makefile # Build and development commands\n\u2514\u2500\u2500 README.md # This file\n```\n\n## Dependencies\n\n### Core Dependencies\n- **click**: Command-line interface creation\n- **rich**: Rich text and beautiful formatting\n- **requests**: HTTP library\n- **tomli**: TOML parser\n\n### AI & Chat\n- **openai**: OpenAI API integration\n- **anthropic**: Anthropic API integration\n\n### Development Tools\n- **ipython**: Interactive Python shell\n- **inquirerpy**: Interactive command-line prompts\n\n### Optional Dependencies\n\nMCLI has been optimized with minimal core dependencies. Install only what you need:\n\n```bash\n# Chat and AI features\nuv pip install -e \".[chat]\"\n\n# Video processing\nuv pip install -e \".[video]\"\n\n# Document processing (PDF, Excel, etc.)\nuv pip install -e \".[documents]\"\n\n# ML/Trading features\nuv pip install -e \".[ml]\"\n\n# Database support\nuv pip install -e \".[database]\"\n\n# Web dashboards\nuv pip install -e \".[dashboard]\"\n\n# Development tools\nuv pip install -e \".[dev]\"\n\n# Everything\nuv pip install -e \".[all]\"\n```\n\nAvailable extras:\n- `chat` - OpenAI, Anthropic, Ollama support\n- `async-extras` - FastAPI, Redis, advanced async features\n- `video` - OpenCV, image processing\n- `documents` - PDF, Excel processing\n- `viz` - Matplotlib, Plotly visualization\n- `database` - Supabase, SQLAlchemy, PostgreSQL\n- `ml` - PyTorch, MLflow, DVC, trading features\n- `gpu` - CUDA support\n- `monitoring` - Prometheus, Datadog\n- `streaming` - Kafka support\n- `dashboard` - Streamlit dashboards\n- `web` - Flask, FastAPI web frameworks\n- `dev` - Testing, linting, type checking\n- `all` - All optional features\n\n## Configuration\n\nMCLI can be configured through environment variables and configuration files.\n\n### Environment Setup\n\n1. **Copy the environment template:**\n ```bash\n cp .env.example .env\n ```\n\n2. **Edit the `.env` file with your configuration:**\n ```bash\n # Required for AI chat functionality\n OPENAI_API_KEY=your-openai-api-key-here\n ANTHROPIC_API_KEY=your-anthropic-api-key-here\n\n # Required for politician trading features\n SUPABASE_URL=https://your-project.supabase.co\n SUPABASE_ANON_KEY=your-supabase-anon-key-here\n SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key-here\n ```\n\n3. **Optional development settings:**\n ```bash\n # Enable debug logging\n MCLI_TRACE_LEVEL=1\n MCLI_DEBUG=true\n\n # Performance optimization\n MCLI_AUTO_OPTIMIZE=true\n ```\n\nSee `.env.example` for a complete list of configuration options.\n\n## Creating Custom Commands\n\nMCLI supports dynamic command discovery. Add your commands to the appropriate modules:\n\n```python\nimport click\nfrom mcli.lib.ui.styling import success\n\n@click.command()\ndef my_command():\n \"\"\"My custom command.\"\"\"\n success(\"Hello from my custom command!\")\n```\n\n## CI/CD\n\nThe project includes comprehensive CI/CD with GitHub Actions:\n\n- **Build Workflow**: Multi-platform builds (Ubuntu, macOS)\n- **Test Workflow**: Multi-Python version testing (3.9-3.12)\n- **Automatic Triggers**: Runs on push/PR to main branch\n- **Manual Triggers**: Use `make ci-trigger-*` commands\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Make your changes\n4. Run tests: `make test`\n5. Validate build: `make validate-build`\n6. Commit your changes: `git commit -am 'Add feature'`\n7. Push to your fork: `git push origin feature-name`\n8. Create a Pull Request\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Acknowledgments\n\n- Built with [Click](https://click.palletsprojects.com/) for CLI interfaces\n- Styled with [Rich](https://github.com/Textualize/rich) for beautiful output\n- Managed with [UV](https://docs.astral.sh/uv/) for fast Python packaging\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\ud83d\ude80 High-performance CLI framework with Rust extensions, AI chat, and stunning visuals",
"version": "7.1.3",
"project_urls": {
"Changelog": "https://github.com/lefv/mcli/releases",
"Documentation": "https://github.com/lefv/mcli#readme",
"Homepage": "https://github.com/lefv/mcli",
"Issues": "https://github.com/lefv/mcli/issues",
"Repository": "https://github.com/lefv/mcli",
"Source": "https://github.com/lefv/mcli"
},
"split_keywords": [
"cli",
" command-line",
" framework",
" chat",
" assistant",
" rust",
" performance",
" visual",
" tui",
" terminal",
" ai",
" openai",
" anthropic",
" productivity"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b749281ab813191e65a502b194b12c45b65fd840d987bea4006580e139421efe",
"md5": "5dabcf831ef066b9679f3d18f9496cf6",
"sha256": "0ed095777032956c449481d551a5088200b631f382d024dc0ba163af12f3d4ac"
},
"downloads": -1,
"filename": "mcli_framework-7.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5dabcf831ef066b9679f3d18f9496cf6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 658777,
"upload_time": "2025-10-06T05:20:48",
"upload_time_iso_8601": "2025-10-06T05:20:48.643631Z",
"url": "https://files.pythonhosted.org/packages/b7/49/281ab813191e65a502b194b12c45b65fd840d987bea4006580e139421efe/mcli_framework-7.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8d0034e2616fbc441861c34c067f17eb28c9589576fa7c4fdca806d35f60649e",
"md5": "144ef59e5d3a5994f8d0b759d4a69ef3",
"sha256": "1906c670db98068e737ff620ea75a038aa7a72e0fa7f79fabca666556a870c41"
},
"downloads": -1,
"filename": "mcli_framework-7.1.3.tar.gz",
"has_sig": false,
"md5_digest": "144ef59e5d3a5994f8d0b759d4a69ef3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 705018,
"upload_time": "2025-10-06T05:20:50",
"upload_time_iso_8601": "2025-10-06T05:20:50.553053Z",
"url": "https://files.pythonhosted.org/packages/8d/00/34e2616fbc441861c34c067f17eb28c9589576fa7c4fdca806d35f60649e/mcli_framework-7.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-06 05:20:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lefv",
"github_project": "mcli",
"github_not_found": true,
"lcname": "mcli-framework"
}