A single-file Python agent for the terminal. Three-tier model routing, a thinking-framework proxy, multimodal + web search. All in stdlib. Just code. 单文件 Python 终端智能体。三档模型路由、思考框架代理、多模态 + Web Search。纯标准库实现。只管写代码。
A 3-agent collaborative pipeline that implements, verifies, and self-corrects — replacing the legacy flat goal-state machine with a CI/CD-like loop. 三代理协作流水线,集实施、验证与自我纠偏于一体——用类 CI/CD 循环取代了旧版扁平目标状态机。
Designs & writes code. Explicitly forbidden from running tests — "that's the Verifier's job."设计并编写代码,明确禁止自我测试——"那是 Verifier 的事"。
Inspects changed files, runs actual test commands, judges PASS/FAIL at the architecture level.检查改动文件,执行实际测试命令,在架构层面判定 PASS/FAIL。
On failure, analyzes the Verifier's report and produces a refined prompt (50–200 words) for the next iteration.失败时分析 Verifier 报告,生成 refined prompt(50–200 词)注入下一轮。
Session files under .mangocli/loops/ are discarded after the loop — no state leaks..mangocli/loops/ 下的会话文件在循环退出后自动清理,无状态泄露。
Start with /loop followed by your goal. The pipeline runs up to 5 iterations, short-circuiting on the first VERIFY: PASS.
输入 /loop 加目标描述即可启动。流水线最多运行 5 轮迭代,首次 VERIFY: PASS 即提前结束。
❯ /loop "refactor utils.py to use dataclasses" # Implementer → Verifier → (Updater → Implementer)* → PASS
Three tiers, auto-selected per turn. Cheap models handle reads; the heavyweight only shows up when the task is genuinely complex. No mid-loop switching. 三档模型,按回合自动选择。轻量模型负责读取;只有真正复杂的任务才调用重模型。中间不切换。
Read / search / list. The default for trivial tasks.读取 / 搜索 / 列表。轻量任务的默认档。
Edit / fix / multi-file. Most turns land here.编辑 / 修复 / 多文件。多数回合在此档。
Design / refactor / complex debug. Triggered by LLM scoring.设计 / 重构 / 复杂调试。由 LLM 打分触发。
.mangocli/providers.json在 .mangocli/providers.json 配置Each provider declares a tier (low / medium / high) and routing. Thresholds are tunable. Startup shows the model count; each turn prints the model that was picked. 每个 provider 声明档位(low / medium /high)和阈值。启动时显示模型数量,每回合打印所选模型。
"providers": [ {"name": "low", "model": "deepseek-v4-flash", "tier": "low"}, {"name": "medium", "model": "deepseek-v4", "tier": "medium"}, {"name": "high", "model": "deepseek-v4-reasoning", "tier": "high"} ]
An intelligent model enhancement layer — wraps itself as an OpenAI-compatible API exposing a "model endpoint," then enhances the upstream model through thinking guidance + information augmentation. 智能模型增强层——将自己包装成 OpenAI 兼容的 API 服务,对外暴露"模型接口",再通过思考引导 + 信息辅助增强底层模型。
Fast path (0ms, keyword match) or deep path (~300ms, Flash-ext's own LLM analyzes session state).快速路径(0ms,关键词匹配)或深思路径(~300ms,Flash-ext 自己的 LLM 分析会话状态)。
debug / design / explain / optimize / implement / investigate / verify / reevaluate. Auto-selected by phase + tool pattern.debug / design / explain / optimize / implement / investigate / verify / reevaluate。由阶段和工具模式自动选择。
Catches same-tool and alternating failure loops. Triggers the reevaluate framework before the agent burns through context.检测同工具连续失败与交替失败模式。在 agent 烧光上下文前触发 reevaluate 框架。
Never touches file I/O or bash. Only enhances the model's reasoning before the request reaches upstream.不触碰文件 I/O 或 shell。仅在请求到达上游前增强模型推理。
Point any OpenAI-compatible client at http://127.0.0.1:8080/v1/chat/completions. Optionally enable memory and web search.
将任意 OpenAI 兼容客户端指向 http://127.0.0.1:8080/v1/chat/completions。可选择性启用记忆和搜索。
$ python mangopi_cli.py --flash-ext --debug # Optional $ python mangopi_cli.py --flash-ext --memory --web-search
Pure Python stdlib — urllib, json, subprocess. No pip install. Single .py file.纯 Python 标准库 — urllib, json, subprocess。无需 pip 安装,单个 .py 文件。
Autonomous tool-calling loop: read → think → edit → verify. Multi-step reasoning, no manual intervention.自主工具调用循环:读取→思考→编辑→验证。多步推理无需人工干预。
Three-tier compact: micro (expire stale tool results), session-memory, fallback (strip + trim). Auto at 80%.三级压缩:micro(过期工具结果)、session-memory、fallback(剥离+裁剪)。80% 自动触发。
Drop a screenshot into the conversation. read auto-routes png/jpg/gif/webp to the model's vision.将截图拖入对话。read 自动将 png/jpg/gif/webp 路由至模型视觉。
web_search tool queries the live web via Bocha AI Search when the model needs fresh docs.web_search 工具通过 Bocha AI Search 查询实时网络。
JSON in .mangocli/session/. Auto-backup on corruption. Resume anywhere.会话保存在 .mangocli/session/。损坏自动备份。断点续聊。
rm -rf / sudo / chmod 777 detection. User confirmation before destructive commands. Path sandbox.检测 rm -rf / sudo / chmod 777。危险命令执行前需用户确认。路径沙盒。
Reusable workflow bundles via SKILL.md. Install in ~/.mangocli/skills/, invoke via use_skill.通过 SKILL.md 复用工作流。安装至 ~/.mangocli/skills/,通过 use_skill 调用。
Prefer the shell over GUI tools.比起 GUI 工具更爱 shell。
Dislike heavy AI frameworks and dependency trees.不喜欢臃肿的 AI 框架与依赖树。
Want to peek under the hood and customize everything.想掀开引擎盖、一切都自己改。
Want code & data to stay on their machine.希望代码与数据留在本机。
Build bespoke agents on a clean, auditable base.在干净基座上构建定制智能体。
Mix cheap + strong models per task to control API cost.按任务混用轻量与重型模型,控制 API 成本。
Auto-detected. Enables thinking/reasoning via extra_body.自动检测,通过 extra_body 启用 reasoning。
Full OpenAI-compatible. Any /v1/chat/completions endpoint.完整兼容 OpenAI,任意 /v1/chat/completions 端点。
Detected by model name. Exposes reasoning_split.通过模型名检测,暴露 reasoning_split。
Qwen, Moonshot, kimi, glm — anything that speaks OpenAI protocol.Qwen、Moonshot、kimi、glm — 任何兼容 OpenAI 协议的接口。
readFile or image (png/jpg/gif/webp auto-routes to vision)文件或图片(png/jpg/gif/webp 自动路由至视觉)
writeWrite or overwrite写入或覆写
editExact string replace + diff精确字符串替换 + diff
searchGlob patterns, sorted by mtimeGlob 模式,按修改时间排序
grepRecursive regex content search递归正则内容搜索
bashShell exec (60s timeout)Shell 执行(60s 超时)
view_imageLoad local image into vision context加载本地图片至视觉上下文
web_searchBocha AI Search live webBocha AI 实时搜索
use_skillLoad installed SKILL.md加载已安装技能
search_memoryMulti-keyword markdown search多关键词 markdown 搜索
append_memoryAppend long-term memory追加长期记忆
attempt_completionTask completion signal任务完成信号
/qQuit退出
/nNew session新会话
/cCompact手动压缩
/l <goal>Loop engineering (replaces /goal)循环工程(替代 /goal)
/hHelp帮助
Recommended. Requires Python 3.10+.推荐方式。需 Python 3.10+。
Clone and run. Zero setup.克隆即运行,零配置。