docs: 全面更新 README 适配 v5.1.1
- 更新插件列表 (15个/141操作) - 新增安全层说明 (三模式) - 新增子 Agent 系统说明 - 新增浏览器自动化说明 - 更新项目结构 (safety.py/sub_agent.py/browser_auto.py) - 移除过时内容 (code_search/git_workflow/project_analyzer/scheduler) - 更新测试信息 (113 用例)
This commit is contained in:
1 parent
5147662b88
commit
4e3abeea98
2 files changed
+228
-341
No files matched your search
+64
-132
@@ -1,161 +1,93 @@
|
||||
# XiaoLi Pro-CLI
|
||||
|
||||
<p align="center">
|
||||
<strong>Intelligent Programming Assistant — Precise Code Editing, Code Search, Git Integration, Multi-AI Engine Support</strong>
|
||||
<strong>AI Programming Assistant — Code Editing · Git · Browser Automation · Multi-Agent</strong>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/version-5.1.1-blue" alt="version">
|
||||
<img src="https://img.shields.io/badge/python-3.8+-green" alt="python">
|
||||
<img src="https://img.shields.io/badge/python-3.10+-green" alt="python">
|
||||
<img src="https://img.shields.io/badge/license-MIT-orange" alt="license">
|
||||
<img src="https://img.shields.io/badge/tests-113%20passed-brightgreen" alt="tests">
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## ✨ 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
|
||||
- 🤖 **Dual AI Engines** — Ollama local + OpenAI compatible (DeepSeek, Grok, SiliconFlow, etc.)
|
||||
- 🔧 **Code Editing & Search** — Precise replace, batch edit, symbol extraction, regex search
|
||||
- 🔄 **Git Integration** — Full Git operations + workflow automation
|
||||
- 🌐 **Browser Automation** — Playwright-driven, navigate/interact/screenshot/JS execution
|
||||
- 🤖 **Sub-Agent System** — Multi-agent parallel collaboration with task delegation
|
||||
- 🛡️ **Unified Safety** — AI risk analysis + 3-mode switching (Normal/Manual/Unrestricted)
|
||||
- 🧩 **15 Plugins, 141 Operations** — Code, Git, browser, engineering, file management, etc.
|
||||
- 🧪 **113 Automated Tests** — pytest coverage for all plugins and core modules
|
||||
|
||||
## 📦 Quick Start
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/shuiyu1123/xiaoli-cli.git
|
||||
cd xiaoli-cli
|
||||
pip install -r requirements.txt
|
||||
python ai_cli.py
|
||||
```
|
||||
|
||||
### Usage
|
||||
## 🤖 AI Engines
|
||||
|
||||
| Engine | Type | Description |
|
||||
|--------|------|-------------|
|
||||
| `ollama` | Local | Ollama local models, no API key needed |
|
||||
| `openai` | Cloud/Local | OpenAI compatible: DeepSeek, Grok, SiliconFlow, local vLLM |
|
||||
|
||||
## 🔌 Plugins (15)
|
||||
|
||||
### Core Productivity
|
||||
|
||||
| Plugin | Ops | Description |
|
||||
|--------|-----|-------------|
|
||||
| `code_editor` | 23 | Code editing + search. replace/batch/find/regex/symbols/imports/callers/todo |
|
||||
| `git_tools` | 20 | Git. status/diff/log/commit/branch + smart-commit/changelog/contributors |
|
||||
| `cmd_executor` | 1 | Shell commands. Cross-platform, timeout, danger blocking |
|
||||
| `file_manager` | 11 | File system. list/read/write/copy/move/delete/search/info/mkdir |
|
||||
| `auto_engineer` | 16 | Engineering. lint/format/test/build/deps + complexity/security/metrics |
|
||||
| `task_manager` | 7 | Task tracking. add/list/complete/delete/clear with JSON persistence |
|
||||
|
||||
### Advanced
|
||||
|
||||
| Plugin | Ops | Description |
|
||||
|--------|-----|-------------|
|
||||
| `sub_agent` | 8 | Sub-Agent system. spawn/list/status/result/send/kill, parallel collaboration |
|
||||
| `browser_auto` | 31 | Browser automation. navigate/click/fill/screenshot/JS/PDF/cookies |
|
||||
| `tool_search` | — | Tool discovery. Search available plugins by keyword |
|
||||
|
||||
### Utilities
|
||||
|
||||
| Plugin | Description |
|
||||
|--------|-------------|
|
||||
| `network_tools` | ping/get/status/headers/ip |
|
||||
| `ai_search` | AI search via jina.ai + web content extraction |
|
||||
| `frontend_tester` | HTML/CSS/JS syntax check, responsive validation |
|
||||
| `speech_recognition` | Voice recording + speech-to-text |
|
||||
| `audio_player` | Audio playback |
|
||||
| `send_image` | Send images to phone (Clawli mode) |
|
||||
|
||||
## 🛡️ Safety
|
||||
|
||||
Three modes (`/safe` to switch):
|
||||
|
||||
| Mode | Icon | Behavior |
|
||||
|------|------|----------|
|
||||
| **Normal** (default) | 🟢 | AI analyzes risk, confirms only when risk detected |
|
||||
| **Manual** | 🟡 | All commands require user confirmation |
|
||||
| **Unrestricted** | 🔴 | Execute directly, no checking |
|
||||
|
||||
## 🧪 Testing
|
||||
|
||||
```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
|
||||
python -m pytest tests/ -v # 113 tests
|
||||
```
|
||||
|
||||
### 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 <engine>` | Switch AI engine |
|
||||
| `/engine list` | List available engines |
|
||||
| `/chat save <name>` | Save conversation |
|
||||
| `/chat list` | List conversations |
|
||||
| `/chat open <name>` | 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)
|
||||
[MIT License](LICENSE)
|
||||
Reference in new issue
Block a user