Metadata-Version: 2.4
Name: r-cli-ai
Version: 0.2.0
Summary: R CLI - Your Local AI Operating System. 100% private, 100% offline, 100% yours.
Project-URL: Homepage, https://github.com/raym33/r
Project-URL: Repository, https://github.com/raym33/r
Project-URL: Documentation, https://github.com/raym33/r#readme
Project-URL: Issues, https://github.com/raym33/r/issues
Author-email: Ramón Guillamón <learntouseai@gmail.com>
License: MIT
License-File: LICENSE
Keywords: agent,ai,cli,code-generation,llm,lm-studio,local,offline,ollama,pdf,private,productivity,rag,sql,voice,whisper
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: click>=8.0.0
Requires-Dist: duckdb>=0.9.0
Requires-Dist: fpdf2>=2.7.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: jinja2>=3.0.0
Requires-Dist: openai>=1.0.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pypdf>=3.0.0
Requires-Dist: python-docx>=1.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=13.0.0
Provides-Extra: all
Requires-Dist: accelerate>=0.25.0; extra == 'all'
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'all'
Requires-Dist: chromadb>=0.4.0; extra == 'all'
Requires-Dist: deep-translator>=1.11.0; extra == 'all'
Requires-Dist: diffusers>=0.25.0; extra == 'all'
Requires-Dist: faster-whisper>=0.10.0; extra == 'all'
Requires-Dist: jmespath>=1.0.0; extra == 'all'
Requires-Dist: jsonschema>=4.0.0; extra == 'all'
Requires-Dist: langdetect>=1.0.9; extra == 'all'
Requires-Dist: lxml>=4.9.0; extra == 'all'
Requires-Dist: numpy>=1.24.0; extra == 'all'
Requires-Dist: piper-tts>=1.0.0; extra == 'all'
Requires-Dist: pytesseract>=0.3.10; extra == 'all'
Requires-Dist: sentence-transformers>=2.2.0; extra == 'all'
Requires-Dist: torch>=2.0.0; extra == 'all'
Provides-Extra: all-mac
Requires-Dist: accelerate>=0.25.0; extra == 'all-mac'
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'all-mac'
Requires-Dist: chromadb>=0.4.0; extra == 'all-mac'
Requires-Dist: deep-translator>=1.11.0; extra == 'all-mac'
Requires-Dist: diffusers>=0.25.0; extra == 'all-mac'
Requires-Dist: faster-whisper>=0.10.0; extra == 'all-mac'
Requires-Dist: huggingface-hub>=0.20.0; extra == 'all-mac'
Requires-Dist: jmespath>=1.0.0; extra == 'all-mac'
Requires-Dist: jsonschema>=4.0.0; extra == 'all-mac'
Requires-Dist: langdetect>=1.0.9; extra == 'all-mac'
Requires-Dist: lxml>=4.9.0; extra == 'all-mac'
Requires-Dist: mlx-lm>=0.10.0; extra == 'all-mac'
Requires-Dist: numpy>=1.24.0; extra == 'all-mac'
Requires-Dist: piper-tts>=1.0.0; extra == 'all-mac'
Requires-Dist: pytesseract>=0.3.10; extra == 'all-mac'
Requires-Dist: sentence-transformers>=2.2.0; extra == 'all-mac'
Requires-Dist: torch>=2.0.0; extra == 'all-mac'
Provides-Extra: audio
Requires-Dist: faster-whisper>=0.10.0; extra == 'audio'
Requires-Dist: piper-tts>=1.0.0; extra == 'audio'
Provides-Extra: design
Requires-Dist: accelerate>=0.25.0; extra == 'design'
Requires-Dist: diffusers>=0.25.0; extra == 'design'
Requires-Dist: torch>=2.0.0; extra == 'design'
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: twine>=4.0.0; extra == 'dev'
Provides-Extra: json-tools
Requires-Dist: jmespath>=1.0.0; extra == 'json-tools'
Requires-Dist: jsonschema>=4.0.0; extra == 'json-tools'
Provides-Extra: mlx
Requires-Dist: huggingface-hub>=0.20.0; extra == 'mlx'
Requires-Dist: mlx-lm>=0.10.0; extra == 'mlx'
Provides-Extra: ocr
Requires-Dist: pytesseract>=0.3.10; extra == 'ocr'
Provides-Extra: rag
Requires-Dist: chromadb>=0.4.0; extra == 'rag'
Requires-Dist: numpy>=1.24.0; extra == 'rag'
Requires-Dist: sentence-transformers>=2.2.0; extra == 'rag'
Provides-Extra: translate
Requires-Dist: deep-translator>=1.11.0; extra == 'translate'
Requires-Dist: langdetect>=1.0.9; extra == 'translate'
Provides-Extra: web
Requires-Dist: beautifulsoup4>=4.12.0; extra == 'web'
Requires-Dist: lxml>=4.9.0; extra == 'web'
Description-Content-Type: text/markdown

# R CLI 🚀

**Your Local AI Operating System** - 100% private, 100% offline, 100% yours.

R CLI is a terminal-based AI agent powered by local open source LLMs (LM Studio, Ollama). Inspired by Paul Klein's viral CEO CLI, but designed to run **completely offline**.

```
╔═══════════════════════════════════════════════════════════════╗
║     ██████╗        ██████╗██╗     ██╗                        ║
║     ██╔══██╗      ██╔════╝██║     ██║                        ║
║     ██████╔╝█████╗██║     ██║     ██║                        ║
║     ██╔══██╗╚════╝██║     ██║     ██║                        ║
║     ██║  ██║      ╚██████╗███████╗██║                        ║
║     ╚═╝  ╚═╝       ╚═════╝╚══════╝╚═╝                        ║
╚═══════════════════════════════════════════════════════════════╝
```

## ✨ Features

- 🔒 **100% Local** - Your data never leaves your machine
- 🚀 **Modular Skills** - PDF, SQL, code generation, summaries and more
- 🎮 **Epic UI** - PS2/Matrix-style terminal animations
- 🧠 **Built-in RAG** - Persistent knowledge base
- 🔌 **Extensible** - Create your own skills easily
- 💰 **Free** - No paid APIs or subscriptions

## 🛠️ Requirements

- Python 3.10+
- [LM Studio](https://lmstudio.ai/) or [Ollama](https://ollama.ai/)
- 16GB+ RAM (24GB VRAM recommended for large models)

### Recommended Models

| Model | VRAM | Use Case |
|-------|------|----------|
| Qwen2.5-7B | 8GB | Fast, simple tasks |
| Qwen2.5-32B | 20GB | Balanced |
| Qwen2.5-72B (Q4) | 24GB | Maximum quality |
| DeepSeek-Coder | 16GB | Code specialized |

## 📦 Installation

### From PyPI (Recommended)

```bash
# Basic installation
pip install r-cli-ai

# With semantic search (RAG)
pip install r-cli-ai[rag]

# With voice mode (Whisper + TTS)
pip install r-cli-ai[audio]

# With image generation (Stable Diffusion)
pip install r-cli-ai[design]

# Everything
pip install r-cli-ai[all]
```

### From Source

```bash
# Clone the repository
git clone https://github.com/raym33/r.git
cd r

# Install with pip
pip install -e .

# Or with uv (faster)
uv pip install -e .
```

## 🚀 Quick Start

### 1. Start your LLM server

**LM Studio:**
1. Open LM Studio
2. Load a model (e.g., Qwen2.5-32B-Instruct)
3. Start the local server (port 1234)

**Ollama:**
```bash
ollama run qwen2.5:32b
```

### 2. Launch R CLI

```bash
# Interactive mode
python -m r_cli.main

# Direct chat
python -m r_cli.main chat "Explain what machine learning is"

# Direct skills
python -m r_cli.main pdf "My AI report" --title "Q4 Report"
python -m r_cli.main sql sales.csv "SELECT * FROM data WHERE year = 2024"
python -m r_cli.main resume document.pdf --style detailed
python -m r_cli.main code "sorting function" --run
```

## 📚 Available Skills

| Skill | Description | Example |
|-------|-------------|---------|
| `pdf` | Generate PDF documents | `r pdf "content" --template business` |
| `latex` | Compile LaTeX to professional PDF | `r latex document.tex` |
| `ocr` | Extract text from images/scanned PDFs | `r ocr image.png --lang eng` |
| `voice` | Transcribe audio (Whisper) + TTS (Piper) | `r voice --audio file.mp3` |
| `design` | Generate images with Stable Diffusion | `r design "cyberpunk city" --style anime` |
| `calendar` | Local calendar & tasks (SQLite) | `r calendar --action today` |
| `multiagent` | Multi-agent orchestration | `r multiagent --task "complex task"` |
| `plugin` | Manage community plugins | `r plugin create my_plugin` |
| `rag` | Semantic search with local embeddings | `r rag --query "machine learning"` |
| `resume` | Summarize long documents | `r resume file.pdf` |
| `sql` | SQL queries on CSVs/DBs | `r sql data.csv "SELECT *"` |
| `code` | Generate and execute code | `r code "hello world" --run` |
| `fs` | File operations | `r ls --pattern "*.py"` |

## ⚙️ Configuration

Create `~/.r-cli/config.yaml`:

```yaml
llm:
  provider: lm-studio  # or 'ollama'
  base_url: http://localhost:1234/v1
  model: local-model
  temperature: 0.7

ui:
  theme: ps2  # ps2, matrix, minimal, retro, cyberpunk

rag:
  enabled: true
  persist_directory: ~/.r-cli/vectordb
```

## 🎨 Themes

```bash
python -m r_cli.main --theme matrix   # Green Matrix style
python -m r_cli.main --theme ps2      # Blue PlayStation 2
python -m r_cli.main --theme minimal  # Clean and simple
python -m r_cli.main --theme retro    # CRT vintage
```

## 🔧 Create Your Own Skill

```python
# ~/.r-cli/skills/my_skill.py

from r_cli.core.agent import Skill
from r_cli.core.llm import Tool

class MySkill(Skill):
    name = "my_skill"
    description = "My custom skill"

    def get_tools(self) -> list[Tool]:
        return [
            Tool(
                name="my_function",
                description="Does something useful",
                parameters={...},
                handler=self.my_function,
            )
        ]

    def my_function(self, arg1: str) -> str:
        return f"Result: {arg1}"
```

## 🔌 Plugin System

Create and share your own skills with the community!

```bash
# Create a new plugin
r plugin create my_awesome_plugin --description "Does cool stuff" --author "Your Name"

# Install from GitHub
r plugin install https://github.com/user/r-cli-plugin

# List installed plugins
r plugin list

# Enable/disable plugins
r plugin enable my_plugin
r plugin disable my_plugin
```

Plugin structure:
```
~/.r-cli/plugins/my_plugin/
├── plugin.yaml       # Metadata
├── __init__.py       # Entry point
├── skill.py          # Skill implementation
└── requirements.txt  # Dependencies
```

## 🗺️ Roadmap

- [x] Agentic core with LM Studio/Ollama
- [x] Skills: PDF, SQL, Code, Resume, Filesystem
- [x] UI with PS2/Matrix animations
- [x] Persistent RAG
- [x] LaTeX compilation to professional PDFs
- [x] OCR text extraction (Tesseract)
- [x] Voice mode (Whisper + Piper TTS)
- [x] Stable Diffusion integration for design
- [x] Calendar & tasks with SQLite
- [x] Multi-agent orchestration
- [x] Plugin system for community skills
- [x] Local embeddings with sentence-transformers

## 🤝 Contributing

Contributions are welcome!

1. Fork the repository
2. Create a branch (`git checkout -b feature/new-feature`)
3. Commit your changes (`git commit -m 'Add new feature'`)
4. Push to the branch (`git push origin feature/new-feature`)
5. Open a Pull Request

## 📄 License

MIT License - Use R CLI however you want.

## 👤 Author

Created by Ramón Guillamón

- Twitter/X: [@learntouseai](https://x.com/learntouseai)
- Email: [learntouseai@gmail.com](mailto:learntouseai@gmail.com)

---

**R CLI** - Because your AI should be yours. 🔒
