shuiyu67 b577b0ff21 feat: FC 工具去重 + 按场景动态裁剪,降低 AI 每轮负担
方案 A(去重):
- mcp_to_openai_tools 末尾按 function.name 去重,消除 cache+builtin 叠加
  造成的同名重复(memory/scheduler/lsp__* 等),FC 工具 42→36,去掉
  约 14% 的垃圾 schema token
- get_liugin_usage_prompts 的 plugins 段由逐条 name:desc 改为工具名清单,
  消除与 FC tools 字段的双重曝光,保留无 FC 模型的回退清单

方案 B(分层裁剪):
- 新增 prune_tools(fc_tools, user_input): 常驻 ALWAYS(tool_search/memory/
  scheduler) + 外部桥接(mcp__)默认保留 + 按关键词信号追加对应工具
  (代码/文件->code_editor+file_manager+lsp__*; git/shell/浏览器/搜索/子agent/
  工程化各按信号)
- cli_core 两处 FC 构建点(TUI/CLI)接入 prune_tools(current_input)

实测(AICLI): 纯聊天 FC token ~4310->285(降93%),写代码 ~973(降77%)

测试: 新增 tests/test_prune_tools.py (7 passed),全量 324 passed 无回归
2026-08-06 20:06:51 +08:00
2026-08-02 18:39:28 +08:00
2026-06-19 00:30:15 +08:00

XiaoLi Pro-CLI

AI Programming Assistant — Code Editing · Git · Browser Automation · Multi-Agent

version python license tests


Features

  • 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

git clone https://gitee.com/shuiyu1123/xiaoli-cli.git
cd xiaoli-cli
pip install -r requirements.txt
python ai_cli.py

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

python -m pytest tests/ -v   # 113 tests

License

MIT License

S
Description
No description provided
Readme
10 MiB
0 Stars 1 Watchers 0 Forks