# XiaoLi Pro-CLI
Intelligent Programming Assistant â Precise Code Editing, Code Search, Git Integration, Multi-AI Engine Support
---
## ⨠Features
- đ¤ **Multi AI Engines** â Ollama local models + OpenAI compatible format (DeepSeek, Grok, SiliconFlow, etc.)
- đ§ **Precise Code Editing** â Search & replace, batch edits, diff comparison, line-level operations
- đ **Code Search & Understanding** â Cross-file search, regex matching, symbol extraction, dependency analysis
- đ **Git Integration** â Full Git workflow support
- đ¨ **Dual UI Modes** â TUI graphical interface (default) + traditional CLI mode
- đ§Š **Triple Protocol Plugin System** â Plugin / Skill / MCP protocols
- đ **WebSocket Remote** â Remote connections and QQ bot integration
- đĄď¸ **Code Sandbox** â Secure code execution environment
## đŚ Quick Start
### Installation
```bash
git clone https://gitee.com/shuiyu1123/xiaoli-cli.git
cd xiaoli-cli
pip install -r requirements.txt
```
### Usage
```bash
# TUI mode (default, requires textual)
python -m xiaoli
# CLI mode
python -m xiaoli --cli
# Specify engine
python -m xiaoli --engine openai
# Show version
python -m xiaoli --version
```
### Dependencies
**Core:**
| Package | Purpose |
|---------|---------|
| `colorama` | Terminal colored output |
| `openai` | OpenAI compatible API |
| `requests` | HTTP requests |
| `Pillow` | Image processing |
| `numpy` | Numerical computation |
**Optional:**
| Package | Purpose |
|---------|---------|
| `textual` | TUI mode |
| `opencv-python` | Enhanced image processing |
| `pygame` | Audio playback |
| `websockets` | WebSocket remote |
## đď¸ Architecture
```
xiaoli-cli/
âââ xiaoli/ # Core package (v3.6+ modular architecture)
â âââ __main__.py # Entry point (python -m xiaoli)
â âââ app.py # Main application (orchestration layer)
â âââ config.py # Configuration management
â âââ engines.py # AI engine management
â âââ sandbox.py # Code execution sandbox
â âââ prompt.py # System prompts
â âââ tui.py # TUI interface
â âââ conversation/ # Conversation handling
â âââ display/ # Display output (CLI/TUI dual mode)
â
âââ plugins/ # Plugins (Plugin protocol)
â âââ code_editor.py # Precise code editor â
â âââ code_search.py # Code search & understanding â
â âââ git_tools.py # Git version control â
â âââ ... # 20+ plugins
â
âââ skills/ # Skills (Skill protocol)
âââ ai_engines/ # AI engine implementations
âââ image_engine/ # Image processing engines
âââ tests/ # Test suite
âââ requirements.txt # Dependencies
```
## đŽ Commands
| Command | Description |
|---------|-------------|
| `/help` | Show help |
| `/quit` | Exit |
| `/about` | Show version info |
| `/model ` | Switch AI engine |
| `/engine list` | List available engines |
| `/chat save ` | Save conversation |
| `/chat list` | List conversations |
| `/chat open ` | Load conversation |
| `/tui` | Toggle TUI mode |
## đ Plugin Development
XiaoLi supports three plugin protocols. See [Development Documentation](ĺźĺć楣/ĺźĺć楣.md) for details.
### Plugin Protocol
```python
class Plugin:
def get_tool_info(self):
return {"name": "my_tool", "description": "...", "keywords": [...]}
def handle(self, args: str) -> str:
return "result"
```
### Skill Protocol
```python
from skills.base import Skill, SkillResult
class MySkill(Skill):
name = "my_skill"
def run(self, **kwargs) -> SkillResult:
return SkillResult(success=True, message="Done")
```
### MCP Protocol
Supports Anthropic/OpenAI Model Context Protocol for seamless external tool integration.
## đ¤ Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feat/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
4. Push to the branch (`git push origin feat/amazing-feature`)
5. Create a Pull Request
## đ License
This project is licensed under the [MIT License](LICENSE).
## đ Links
- đŚ Gitee: https://gitee.com/shuiyu1123/xiaoli-cli
- đ [Development Docs](ĺźĺć楣/ĺźĺć楣.md)
- đ [Changelog](CHANGELOG.md)