bugx-cli 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -29
- package/core/README.md +5 -3
- package/core/agent/agent_orchestrator.py +3 -0
- package/core/agent/agent_workspace.py +14 -2
- package/core/assets/bugx-wechat-group.png +0 -0
- package/core/assets/twitter_promo_art.jpg +0 -0
- package/core/assets/twitter_promo_card.svg +166 -0
- package/core/assets/twitter_promo_clean.jpg +0 -0
- package/core/assets/twitter_terminal_real.png +0 -0
- package/core/bugx.md +3 -3
- package/core/bugx_paths.py +10 -2
- package/core/bundled_docs/OVERVIEW.md +310 -0
- package/core/bundled_docs/README.md +10 -0
- package/core/bundled_docs/README_EN.md +278 -0
- package/core/bundled_docs/ai/01_AI_REFERENCE.md +833 -0
- package/core/bundled_docs/ai/02_AI_USAGE.md +161 -0
- package/core/bundled_docs/ai/03_AI_COMMANDS.md +322 -0
- package/core/bundled_docs/guides/01_USER_GUIDE.md +887 -0
- package/core/bundled_docs/guides/02_COMMANDS.md +935 -0
- package/core/bundled_docs/guides/03_TROUBLESHOOTING.md +763 -0
- package/core/bundled_docs/guides/04_CLOUD_AUTH_AND_SYNC_COOKBOOK.md +48 -0
- package/core/bundled_docs/guides/05_HOST_MATRIX_AND_DISPATCH.md +23 -0
- package/core/bundled_docs/guides/06_PROBES_AND_POC_COOKBOOK.md +49 -0
- package/core/bundled_docs/guides/07_LIFECYCLE_AND_RECOVERY_STATES.md +46 -0
- package/core/bundled_docs/guides/08_LESSONS_AND_PRIVACY_BOUNDARY.md +35 -0
- package/core/bundled_docs/hosts/bugx-claude_SKILL.md +326 -0
- package/core/bundled_docs/hosts/bugx-dsh_SKILL.md +229 -0
- package/core/bundled_docs/hosts/bugx-opencode_SKILL.md +129 -0
- package/core/bundled_docs/hosts/bugx-zcode_SKILL.md +459 -0
- package/core/bundled_docs/hosts/bugx_SKILL.md +118 -0
- package/core/bundled_docs/hosts/cline_bugx_SKILL.md +69 -0
- package/core/bundled_docs/hosts/platform_bugx_SKILL.md +50 -0
- package/core/bundled_docs/manifest.json +140 -0
- package/core/bundled_docs/reference/01_ENVIRONMENT_VARIABLES.md +421 -0
- package/core/bundled_docs/reference/04_REPOSITORY_TOPOLOGY.md +180 -0
- package/core/cli-help.txt +7 -3
- package/core/cloud_sync/cloud_client.py +81 -2
- package/core/cloud_sync/endpoint_router.py +22 -9
- package/core/cloud_sync/issue_uploader.py +297 -0
- package/core/cloud_sync/sensitive_filter.py +77 -7
- package/core/contracts/AGENT_GUIDE.md +3 -9
- package/core/contracts/README.md +1 -1
- package/core/contracts/bugx-opencode.md +1 -1
- package/core/contracts/bugx-runtime-contract.md +10 -20
- package/core/contracts/bugx-worker.md +1 -1
- package/core/engine-integrity.json +267 -111
- package/core/host_acp/antigravity.py +153 -0
- package/core/host_acp/kimi.py +175 -0
- package/core/host_acp/minimax.py +28 -0
- package/core/host_runtime/adapters.py +5 -1
- package/core/host_runtime/antigravity.py +162 -0
- package/core/host_runtime/host_bootstrap.py +18 -7
- package/core/host_runtime/host_evaluators.py +4 -4
- package/core/host_runtime/host_registry.py +25 -4
- package/core/host_runtime/mcp_process_tracker.py +30 -3
- package/core/host_runtime/mcp_registry_gate.py +34 -11
- package/core/hosts/antigravity.py +115 -0
- package/core/hosts/codex.py +3 -0
- package/core/hosts/dsh.py +43 -24
- package/core/hosts/kimi.py +293 -0
- package/core/hosts/minimax.py +249 -0
- package/core/hosts/zcode.py +5 -0
- package/core/i18n.py +94 -5
- package/core/infra/README.md +1 -1
- package/core/infra/build_info.py +30 -5
- package/core/launch_phases/README.md +2 -2
- package/core/launch_phases/startup_version_gate.py +2 -2
- package/core/launch_phases/supervisor_bridge.py +16 -23
- package/core/launch_phases/supervisor_degraded.py +7 -5
- package/core/ledger/README.md +1 -1
- package/core/locales/en-US.json +3 -3
- package/core/locales/zh-CN.json +3 -3
- package/core/mcp_runtime_support/environment.py +6 -1
- package/core/metadata.txt +2 -2
- package/core/planning/README.md +1 -1
- package/core/planning/prompt_harness.py +2 -2
- package/core/probes/codebase_memory_probe.py +43 -24
- package/core/probes/probe_registry.py +10 -7
- package/core/prompts/command_routing_en.md +6 -5
- package/core/prompts/command_routing_zh.md +6 -5
- package/core/repair/rsi_rounds.py +3 -0
- package/core/repair/self_heal.py +160 -6
- package/core/retrieval/README.md +1 -1
- package/core/runtime/README.md +1 -1
- package/core/runtime/scenario_eval.py +5 -1
- package/core/runtime/setup_ui_env.py +4 -7
- package/core/runtime/tool_install_targets.py +12 -2
- package/core/skills/README.md +4 -2
- package/core/skills/bugx_docs_cloud_sync.py +658 -0
- package/core/skills/bugx_docs_mcp_server.py +966 -140
- package/core/supervisor/README.md +1 -1
- package/core/supervisor/cli.py +2 -2
- package/core/supervisor/worker_execution.py +16 -3
- package/core/webui/docs_session_service.py +40 -2
- package/core/webui/mcp_inspector.py +12 -6
- package/core/webui/static/index.html +51 -3
- package/core/webui/static/manifest.webmanifest +1 -1
- package/core/webui/static/project-settings.js +18 -3
- package/core/webui/static/robots.txt +36 -0
- package/core/webui/static/sitemap.xml +15 -0
- package/docs/07_distribution/01_README_NPM.md +26 -29
- package/ecosystem/integrations/cline/skills/bugx/SKILL.md +46 -46
- package/ecosystem/integrations/dsh/agents/bugx.md +2 -1
- package/ecosystem/integrations/dsh/dsh-patch.yml +2 -2
- package/ecosystem/integrations/dsh/mcp/package.json +1 -1
- package/ecosystem/integrations/dsh/skills/bugx/SKILL.md +6 -6
- package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/integrations/dsh/ui/package.json +1 -1
- package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +2 -2
- package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
- package/ecosystem/integrations/pi/skills/bugx/SKILL.md +6 -6
- package/ecosystem/integrations/qoder/CONNECTORS.md +11 -23
- package/ecosystem/integrations/qoder/connector-meta.json +9 -9
- package/ecosystem/integrations/workbuddy/connector-meta.json +9 -9
- package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +8 -7
- package/ecosystem/plugins/bugx/.claude-plugin/marketplace.json +2 -2
- package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +2 -2
- package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +4 -4
- package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +2 -2
- package/ecosystem/plugins/bugx/agents/bugx-worker.md +14 -18
- package/ecosystem/plugins/bugx/agents/bugx.md +45 -49
- package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +8 -8
- package/ecosystem/plugins/bugx/skills/bugx-claude/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +1 -1
- package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +3 -3
- package/interfaces/bin/bugx.js +2 -0
- package/interfaces/cli/bugx_cli/__init__.py +2 -2
- package/interfaces/cli/bugx_cli/cli.py +153 -8
- package/interfaces/cli/bugx_cli/commands/agent.py +568 -136
- package/interfaces/cli/bugx_cli/commands/cloud.py +42 -1
- package/interfaces/cli/bugx_cli/commands/doctor.py +668 -223
- package/interfaces/cli/bugx_cli/commands/guide.py +143 -0
- package/interfaces/cli/bugx_cli/commands/issue.py +262 -0
- package/interfaces/cli/bugx_cli/commands/lifecycle.py +99 -62
- package/interfaces/cli/bugx_cli/commands/plugin.py +301 -60
- package/interfaces/cli/bugx_cli/commands/plugin_antigravity.py +350 -0
- package/interfaces/cli/bugx_cli/commands/plugin_claude.py +27 -13
- package/interfaces/cli/bugx_cli/commands/plugin_kimi.py +440 -0
- package/interfaces/cli/bugx_cli/commands/plugin_minimax.py +522 -0
- package/interfaces/cli/bugx_cli/commands/plugin_qoder.py +3 -4
- package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +4 -5
- package/interfaces/cli/bugx_cli/commands/system.py +75 -5
- package/interfaces/cli/bugx_cli/common.py +135 -15
- package/interfaces/cli/bugx_cli/host_adapters.py +190 -7
- package/interfaces/cli/bugx_cli/hosts/registry.py +6 -3
- package/interfaces/cli/bugx_cli/hosts/template_engine.py +31 -11
- package/interfaces/cli/bugx_cli/infra/__init__.py +4 -0
- package/interfaces/cli/bugx_cli/infra/ai_advisor.py +14 -12
- package/interfaces/cli/bugx_cli/infra/engine_installer.py +76 -10
- package/interfaces/cli/bugx_cli/infra/host_sync.py +66 -1
- package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +242 -52
- package/package.json +38 -13
- package/pyproject.toml +57 -13
- package/scripts/sync-version.mjs +1 -1
- package/skills/README.md +24 -0
- package/skills/platform/bugx/SKILL.md +50 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="core/assets/bugx-hero-zh.svg" alt="BugX — 让你轻松审计 AI 写的代码" width="800">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
中文 · <a href="README_EN.md">English</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# BugX — 自主代码审查与智能测试智能体(Autonomous Code Review & Automated Testing Agent)
|
|
10
|
+
|
|
11
|
+
BugX 是一款装在 AI 编程助手与智能体开发环境里的**自主代码审查与自主测试智能体(Agent)**,严把代码交付关:**它帮助开发人员在写完代码后自动排查隐藏的深层 Bug,减少反复排错与返工;帮助测试人员自动化运行黑盒测试、功能验证与性能测试,自动覆盖手工盲测难以覆盖的极端场景;确保代码功能完全符合要求、在各种复杂环境下都能稳定运行、不崩溃不卡死,上线放心不翻车。**
|
|
12
|
+
|
|
13
|
+
目前已原生适配全球主流 AI 编程助手与智能体开发平台:**Google Antigravity(反重力)、Gemini Code Assist / Gemini CLI、Claude Code、OpenAI Codex、Cursor、Trae、Windsurf、Cline、OpenCode、Kimi Code、ZCode、MiniMax Code、DSH、WorkBuddy、Qoder**;全面支持以 **Google 最新 Gemini 4 体系(Gemini 4 Carbon / Neon / Hydrogen)、Claude 5.5(Sonnet 5.5 / Opus 5.5)、G4 旗舰大模型**为底座的深层代码推理与漏洞发现。静态分析、行为差分、内存检查与 UI 测试全部自动化执行;通过标准化 MCP 协议接入宿主,测试审查过程断点可续、透明可查。
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://pypi.org/project/bugx-cli/"><img src="https://img.shields.io/pypi/v/bugx-cli.svg?style=flat&color=0284c7&label=PyPI" alt="PyPI"></a>
|
|
17
|
+
<a href="https://www.npmjs.com/package/bugx-cli"><img src="https://img.shields.io/npm/v/bugx-cli.svg?style=flat&color=0284c7&label=npm" alt="npm"></a>
|
|
18
|
+
<img src="https://img.shields.io/badge/python-%E2%89%A53.11-334155.svg?style=flat" alt="Python">
|
|
19
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-334155.svg?style=flat" alt="Platform">
|
|
20
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-BSL--1.1-334155.svg?style=flat" alt="License"></a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
🌐 官网:**https://bugx.dev**
|
|
24
|
+
|
|
25
|
+
## 目录
|
|
26
|
+
|
|
27
|
+
- [它解决什么问题?](#它解决什么问题?)
|
|
28
|
+
- [快速开始](#快速开始)
|
|
29
|
+
- [一次完整审计长什么样](#一次完整审计长什么样)
|
|
30
|
+
- [支持的 AI 编程宿主](#支持的-ai-编程宿主)
|
|
31
|
+
- [数据与安全边界](#数据与安全边界)
|
|
32
|
+
- [文档](#文档)
|
|
33
|
+
- [交流群](#交流群)
|
|
34
|
+
- [开发与贡献](#开发与贡献)
|
|
35
|
+
- [许可](#许可)
|
|
36
|
+
|
|
37
|
+
## 它解决什么问题?
|
|
38
|
+
|
|
39
|
+
AI 写代码的速度,早就超过人眼审代码的速度。更麻烦的是,模型还藏着一个问题:爱偷懒。这不是它坏,是训练方式决定的,三条机制叠在一起:
|
|
40
|
+
|
|
41
|
+
1. **打分偏好:** 模型训练的最后一步,是让人类评分员给回答打分。一个版本说"我仔细查过了,没发现问题",另一个说"这个文件我还没看完"——评分员多半给前者高分,因为听着踏实、有用。模型由此学会:报喜不报忧才拿分。
|
|
42
|
+
2. **成本不对等:** 检查代码是体力活,几百个文件得一个个读;回一句"没发现问题"只要几个字。两条路摆在那,省事的那条永远更划算。
|
|
43
|
+
3. **不知道"没查完":** 模型既不知道哪块没查,也没被教过怎么说。所以它给不出"部分完成",只会给你"完成"。
|
|
44
|
+
|
|
45
|
+
Bugx的审计能依靠账本和四条规矩实现:
|
|
46
|
+
|
|
47
|
+
1. **代码覆盖清单** 项目拆成一个个审计单元,每个都有明确状态:查完了、卡住了、还没查。达到全面覆盖。
|
|
48
|
+
2. **独立盲审与真实复现** 发现的疑点由隔离的独立验证员盲审,同一段攻击输入实跑两次触发漏洞、正常输入一次零触发,三份真实记录在案才算数;证伪案例入误报账本不再骚扰。
|
|
49
|
+
3. **排查可以续杯** 退出AI工具后再次打开可以接着干之前的活儿。
|
|
50
|
+
4. **记录全部可查** 谁、什么时候、凭什么下的结论,一笔一笔记进账本,每页盖骑缝章(哈希链),谁也改不了,逐条可查。
|
|
51
|
+
|
|
52
|
+
## 快速开始
|
|
53
|
+
|
|
54
|
+
Python `>=3.11`;用 npm 封装时需要 Node.js `>=18`。
|
|
55
|
+
Pip安装
|
|
56
|
+
```bash
|
|
57
|
+
# 任选其一
|
|
58
|
+
python -m pip install bugx-cli
|
|
59
|
+
```
|
|
60
|
+
npm 安装
|
|
61
|
+
```bash
|
|
62
|
+
npm install -g bugx-cli
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
检查与更新使用当前安装来源对应的服务端制品:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bugx update --check # 只检查;0=无需更新,1=有更新,2=检查失败
|
|
69
|
+
bugx update # pip 或 npm wrapper 的实际全局更新
|
|
70
|
+
bugx update --channel alpha # 明确选择预发布通道
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
更新会联网下载并校验服务端返回的 `release_id`、SHA-256 和制品类型,随后刷新全局 BugX 引擎、已登记宿主并执行安装诊断。源码 checkout 或 editable 安装不会被自动覆盖;更新失败时请先查看 `~/.bugx/update/receipts/` 和 `bugx doctor --installation-only`,不要用 `--force` 掩盖未知状态。启动阶段的版本提示可用 `BUGX_DISABLE_VERSION_CHECK=1` 临时关闭,但不影响显式 `bugx update --check`。
|
|
74
|
+
|
|
75
|
+
装好后先完成用户级或项目级安装:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# 1. 在用户主目录 (~) 运行:执行用户全局安装(全局引擎、必需核心依赖 codebase-memory + tree-sitter、宿主用户级入口)
|
|
79
|
+
bugx install
|
|
80
|
+
|
|
81
|
+
# 2. 进入待审计项目目录运行(或显式传 --root <项目目录>):绑定当前项目工作区
|
|
82
|
+
bugx install --root .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
> ⚠️ **重要提示(配置生效必须重启)**:配置或更新宿主 MCP 后,**必须完全退出并重启宿主 IDE / AI 编程助手**(如 Cursor、Trae、VSCode、Kimi Code、MiniMax Code、ZCode、DSH 等),宿主进程重新加载 MCP 服务配置后方可识别并调用 BugX 工具。
|
|
86
|
+
|
|
87
|
+
- **必装核心能力 direct-ready**:`bugx install` 与 `bugx doctor --repair` 会直接安装与校验通用必需依赖(`codebase-memory-mcp==0.12.1` 语义图谱与 `tree-sitter-language-pack==1.14.3` AST 解析、已选宿主核心 MCP 通道),绝不沉默降级放行;其余与项目技术栈相关的可选能力(`playwright`、`postmcp`、`dbhub`、`redis`、`mobile`、`semgrep`、`bandit`、效率工具等)延迟到进入实际项目审计时由 AI 与用户按需决定启用。
|
|
88
|
+
- 命令行里的布尔选项都是开关:启用时直接写 `--force`、`--json` 等选项,关闭时删除该选项;不要写 `--force=True`、`--json=False` 或 `force=True`。
|
|
89
|
+
- 它会列出本机检测到的 AI 宿主,按提示选择即可;想跳过选择一次全装,用 `bugx install --agent all`。
|
|
90
|
+
- 用户主目录安装不会污染 `~` 或删除 `~/.bugx/core`,其中 DSH 全局配置文件会写入动态无 `--root` 参数;需要把安装直接绑定到某个仓库时传入 `--root <项目目录>`(如 `bugx install --agent dsh --root <项目目录>`)。
|
|
91
|
+
|
|
92
|
+
在 Qoder Desktop 的项目根目录运行 `bugx install --agent qoder`,将 BugX 连接器和项目绝对路径写入 `.mcp.json`。Windows 使用安装时的 Python 绝对路径启动连接器。安装后重新打开工作区并启动新会话,在 Qoder 提示时批准该项目的 BugX 连接器。
|
|
93
|
+
|
|
94
|
+
Kimi Code 会自动注册到当前 Kimi Code 数据根:默认是 `~/.kimi-code`,也可以用
|
|
95
|
+
`KIMI_CODE_HOME` 指定。插件文件位于 `plugins/managed/bugx`,启用状态位于
|
|
96
|
+
`plugins/installed.json`;Windows、macOS、Linux 使用同一契约,不需要手动复制旧的
|
|
97
|
+
`daimon-share` 目录。
|
|
98
|
+
|
|
99
|
+
运行 `bugx install --agent minimax` 后,可在 MiniMax Code 的 **Agents** 页找到带官方头像的 `BugX`,
|
|
100
|
+
在 **插件** 页找到配套的 `BugX` 插件。插件提供 Worker、Skill 和 MCP。安装契约已在
|
|
101
|
+
Windows MiniMax Code 3.1.17 上验证。可用 `MINIMAX_DATA_DIR` 指定隔离安装目录。
|
|
102
|
+
|
|
103
|
+
运行 `bugx install --agent antigravity` 后,可在 **Google Antigravity(反重力)**智能体开发平台的 Agent 选择器中直接选用 `BugX`。用户级插件提供专属主 Agent、Worker Agent、审查 Skill 与官方头像;同时为当前项目工作区自动配置 `bugx-supervisor`、`bugx-supervisor-worker` 与 `bugx-docs` 三条核心 MCP 服务通道,完美适配 Google 最新 Gemini 4(Gemini 4 Carbon / Neon)与 Claude 5.5 级大模型进行全生命周期的代码审查与真实漏洞验证。
|
|
104
|
+
|
|
105
|
+
DSH 有一条额外的安全边界:安装器始终先把 BugX UI 包暂存到
|
|
106
|
+
`~/.dsh/plugins/bugx-ui`。只有能确认是 DSH Desktop 自带的 launcher 时,才会调用
|
|
107
|
+
`dsh plugin --profile web add` 注册 Web UI;普通 npm/Python `dsh` CLI 不支持该插件管理
|
|
108
|
+
操作,安装器会保持 `staged` 而不会启动它,避免 Windows 宿主进程崩溃。DSH 的 Agent、
|
|
109
|
+
Skill、MCP 和 preset 不依赖这个可选 UI 包,仍可正常使用。
|
|
110
|
+
Windows Desktop 的 `app.asar` 运行时包名会在有界安装候选中递归读取 ASAR 文件树,
|
|
111
|
+
兼容当前 `files/dsh/files/node_modules` 的嵌套布局;不做全盘扫描。
|
|
112
|
+
|
|
113
|
+
用 `bugx help install` 或 `bugx supervisor install --help` 查看用法。发现安装资源缺失时,CLI 会报告错误,需要修复时单独运行 `bugx update --repair-assets`。Windows 用户级 wheel 与旧系统级 Python 资源并存时,CLI 优先使用当前发行版自带的资源,避免旧引擎被误判为当前版本。
|
|
114
|
+
|
|
115
|
+
### 首次使用,先接通云端
|
|
116
|
+
|
|
117
|
+
进入目标仓库,确认要登录的 BugX 云账号、同步范围和敏感数据策略,然后登录并核验账号:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bugx auth login --root .
|
|
121
|
+
bugx auth status --root . --verify --json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
确认 `auth_verified=true`。如果账号全局知识和当前项目知识均已授权,新项目执行 `bugx init --root . --cloud-sync sync`,随后用 `bugx cloud sync --root . --scope all` 验证首次推拉。`bugx init` 会把标准通用 Skill 安装到项目的 `.agents/skills/bugx/SKILL.md`,可在支持该目录的宿主里调用 `/bugx` 或按需运行 `bugx guide "<关键词>"` 查询操作步骤。已有项目在授权全量范围后直接用 `bugx cloud sync --root . --scope all`,并用 `bugx cloud status --root . --scope all --json` 核对绑定和状态。全量范围包含项目登记与画像、项目知识和账号全局知识。只授权部分数据时停止同步。
|
|
125
|
+
|
|
126
|
+
### 方式一:在 AI 编程助手里用(推荐)
|
|
127
|
+
|
|
128
|
+
装完之后不用进终端、不用记命令。在任意项目里打开你的 AI 助手(Claude Code、Codex、Cline、OpenCode、ZCode),直接告诉它要查什么:
|
|
129
|
+
|
|
130
|
+
**ZCode**
|
|
131
|
+

|
|
132
|
+
|
|
133
|
+
**Codex**
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
**DSH**
|
|
137
|
+

|
|
138
|
+
|
|
139
|
+
> "审计一下这个项目"
|
|
140
|
+
> "查一下登录模块有没有漏洞"
|
|
141
|
+
> "把这次的改动审一遍,看看有没有安全问题"
|
|
142
|
+
|
|
143
|
+
宿主里的 AI 会自动调用 BugX:建覆盖清单、派发并发 Worker、跑探针、验证漏洞、出报告。审计过程想实时看,终端跑一句 `bugx report serve`,浏览器打开 **http://127.0.0.1:8080** 就是完整的 Web 报告界面。
|
|
144
|
+
|
|
145
|
+
### 方式二:在命令行里直接跑
|
|
146
|
+
|
|
147
|
+
命令行方式的 AI 同样来自你已装好的宿主——模型和凭据用宿主里自己配好的,BugX 直接复用,不接管你的 Key(`--model` / `--provider` 缺省自动读取宿主配置)。
|
|
148
|
+
|
|
149
|
+
先用 `bugx doctor --root . --strict` 核对当前项目的宿主和连接。走分阶段 CLI 时,按[完整生命周期](guides/01_USER_GUIDE.md#8-从-pre-到-post-的完整生命周期)从准备、执行和核查一直到收尾。用 `bugx engine --root . status --json` 查看当前进度和下一步。
|
|
150
|
+
|
|
151
|
+
也可以让 BugX 自己跑完全程,不用守在终端:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
bugx autonomous --host opencode # 模型/凭据自动复用 OpenCode 里已配好的
|
|
155
|
+
# 或带目标:
|
|
156
|
+
bugx goal --host opencode "审计这个项目的登录与支付链路"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
修复与产出也在命令行完成:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
bugx test-generate ... # 为指定单元生成 AAA 测试或自包含 PoC
|
|
163
|
+
bugx test-verify ... # 变异验证测试用例的抓 Bug 能力
|
|
164
|
+
bugx patch-forge --from-issue <id> --diff fix.diff --repro repro.md --test test_ok.py --dry-run
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
`patch-forge` 生成补丁包并静态校验,默认只出包不提交;审过没问题再去掉 `--dry-run`。
|
|
168
|
+
|
|
169
|
+
打开 Web UI 看报告(审计中、审计后都能看):
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
bugx report serve # 浏览器打开 http://127.0.0.1:8080,实时看覆盖、证据与漏洞
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
需要离线归档时导出静态报告:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
bugx report both --format html --out report.html
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`--agent` 的取值见下方宿主表;`bugx hosts` 会列出本机检测到的所有环境和各自能力。
|
|
182
|
+
|
|
183
|
+
## 一次完整审计长什么样
|
|
184
|
+
|
|
185
|
+
1. **pre(含作战方案)**:枚举源码与配置资产,生成最小审计单元清单(内部单元 + 跨模块业务链路)。开跑前先给你一份作战方案,五个选择一次定:**云同步**(登录后同步错题和经验,离线运行需明确选择)、**审查方式**、**轮询策略**、**修复方式**、**提交方式**。按启动门禁确认本轮的同步范围和执行策略。
|
|
186
|
+
2. **派发 Worker**:宿主把审计单元派给并发 Worker;每个 Worker 领租约、发心跳、跑探针、提交 checkpoint。
|
|
187
|
+
3. **证据落盘**:Worker 的每条结论都带命令、退出码、artifact 哈希;覆盖状态只能是 `covered / blocked`,没有"大概查了"。
|
|
188
|
+
4. **Finding 裁决**:候选漏洞先由引擎验证通道实跑双正例 + 负对照,再进入确认/驳回;驳回需要理由。
|
|
189
|
+
5. **post**:核对 coverage 与 findings 是否自洽,结账。审计完成与否以状态机终态为准——模型的一句"完成了"不算数。
|
|
190
|
+
6. **出报告**:`bugx report both --format html --out report.html` 生成正式 + 可视化报告;`bugx report serve` 起本地实时预览。
|
|
191
|
+
|
|
192
|
+
## 看一眼界面
|
|
193
|
+
|
|
194
|
+
BugX Studio 是自带的 Web 工作台——跑 `bugx report serve`,浏览器打开 http://127.0.0.1:8080:
|
|
195
|
+
|
|
196
|
+
<p align="center">
|
|
197
|
+
<img src="core/assets/webui-studio.jpg" alt="BugX Studio 工作台" width="860">
|
|
198
|
+
</p>
|
|
199
|
+
|
|
200
|
+
工作区覆盖所有已接入的宿主,每个工作区独立记录自己的审计会话(截图左侧可见 ChatGPT、ZCode、Claude、Codex、DSH、OpenCode、Pi 等):
|
|
201
|
+
|
|
202
|
+
<p align="center">
|
|
203
|
+
<img src="core/assets/webui-chatgpt.jpg" alt="ChatGPT 工作区" width="420">
|
|
204
|
+
<img src="core/assets/webui-zcode.jpg" alt="ZCode 工作区" width="420">
|
|
205
|
+
</p>
|
|
206
|
+
|
|
207
|
+
技能市场内置 `/audit`(一键全息攻防审计与双轨报告)、`/review`(分支改动结构化 Findings)、`/mining`(攻击面勘测与加固)、`/fix`(防御性补丁 + 沙箱回归)、`/test`(AAA 测试与变异杀伤力审计):
|
|
208
|
+
|
|
209
|
+
<p align="center">
|
|
210
|
+
<img src="core/assets/webui-skills.jpg" alt="技能市场" width="860">
|
|
211
|
+
</p>
|
|
212
|
+
|
|
213
|
+
## 它能干什么
|
|
214
|
+
|
|
215
|
+
**审计**
|
|
216
|
+
- **代码审查**:漏洞与缺陷,按逻辑 / 状态 / 边界 / 异常 / 并发 / 性能 / 资源分类。
|
|
217
|
+
- **功能审查**:业务链路审计 + 行为差分——同一批输入分别喂给你的实现和参考实现,比出行为差异。
|
|
218
|
+
- **性能与内存**:性能/资源类缺陷,外加 native / Python / JVM / Electron / Android / Apple 六类目标的内存专项检查。
|
|
219
|
+
- **UI 审计**:对运行中的网页做布局、对比度、键盘路径与设计 Token 检查(`bugx probe ui`)。
|
|
220
|
+
|
|
221
|
+
**复现与验证**
|
|
222
|
+
- **独立盲审与真实复现**:每个漏洞都由独立验证员执行隔离盲审与环境验证,给出你能亲手运行的 PoC 验证命令。同一段坏数据跑两次都出事,换正常数据跑一次零触发,外加 AST 语法反空壳断言,三份真实记录留案才算数。
|
|
223
|
+
- **误报账本学习**:实跑被证伪的假阳性案例自动沉淀入误报账本(FP Ledger),代码未改动前不再重复报假警;文件被修改后自动解除过时守卫。
|
|
224
|
+
- **模型风控与多模型底座自适应(Gemini 4 / Claude 5.5 / G4 / GPT)**:深度适配 Google 最新 Gemini 4 体系(Gemini 4 Carbon / Neon / Argon)、Claude 5.5 旗舰系列(Claude Sonnet 5.5 / Opus 5.5)与 OpenAI GPT-4o 系列,内置声明式提示词策略引擎,针对不同模型自动切换防御性 QA 视角,彻底解决漏洞审查触发平台 `cyber policy` / Daybreak 拦截的痛点。
|
|
225
|
+
- **测试变异检验**:测试用例的战斗力也能验:`bugx test-verify` 用代码变异检验测试真的抓得住 Bug。
|
|
226
|
+
|
|
227
|
+
**修复与产出**
|
|
228
|
+
- 自动生成 AAA 测试用例或自包含 PoC(`bugx test-generate`)。
|
|
229
|
+
- 生成补丁包并做静态校验,交给你审,不替你提交(`bugx patch-forge`)。
|
|
230
|
+
- 输出报告(`bugx report`)。
|
|
231
|
+
|
|
232
|
+
**长期使用**
|
|
233
|
+
- **错题集**:将本轮核实后写入账本的错题和经验按授权范围推拉到云端(`bugx cloud sync`)。下一轮可用 `bugx lesson retrieve` 按故障症状或模块检索。
|
|
234
|
+
- **无人值守**:跟着宿主跑(`bugx autonomous`)、带目标长跑(`bugx goal`)、常驻守护(`bugx daemon`)。
|
|
235
|
+
- **诊断与反馈**:`bugx doctor` / `bugx log` / `bugx stats` 查安装、日志与消耗;遇到异常或改进建议时运行 `bugx issue report` 或 `bugx feedback`,支持本地安全脱敏打包并直接一键反馈。
|
|
236
|
+
- **官方文档支持 (Remote-First)**:内置 `bugx-docs` MCP 服务与 `bugx guide` 命令,默认直连官方端点获取最新官方文档与最佳实践;离线时毫秒级自动降级至随包离线文档。
|
|
237
|
+
|
|
238
|
+
## 常见问题
|
|
239
|
+
|
|
240
|
+
**BugX 是什么?**
|
|
241
|
+
一款装进 AI 编程助手的自主代码审计 Agent:通过 MCP 在 Claude Code、Codex、Cline、OpenCode、ZCode、MiniMax Code 内运行,也可作为独立 CLI 使用;按单元跟踪审计覆盖,并对每条发现做真实执行验证。
|
|
242
|
+
|
|
243
|
+
**支持哪些 AI 编程工具与大模型?**
|
|
244
|
+
原生支持 **Google Antigravity(反重力)**、**Gemini Code Assist / Gemini CLI**、Claude Code、OpenAI Codex、Cursor、Trae、Windsurf、Cline / Roo Code、OpenCode、Kimi Code、ZCode、MiniMax Code、DeepSeek Harness (DSH)、WorkBuddy、Qoder 等主流 AI 编程助手与 Agent 开发平台;深度兼容 **Google 最新 Gemini 4 体系(Gemini 4 Carbon / Neon / Hydrogen)、Claude 5.5(Sonnet 5.5 / Opus 5.5)、G4 旗舰模型等全系列主力模型**。
|
|
245
|
+
|
|
246
|
+
**如何验证一个漏洞?**
|
|
247
|
+
不靠首发模型的自说自话,由独立的验证员执行盲审验证:一段攻击输入必须两次成功触发该漏洞,一段正常输入必须零触发;三次执行(两正例一负对照)连同命令、退出码与产物哈希全部记录在案,并通过 AST 语法断言防止空壳测试。
|
|
248
|
+
|
|
249
|
+
**我的代码会被上传到云端吗?**
|
|
250
|
+
目标代码和审计执行仍在本地完成;知识同步、项目画像、诊断日志、反馈和 bundle 仍是各自的显式网络路径。另有独立的安装/心跳遥测:遥测门禁未配置时默认开启,普通 CLI 命令每天最多记录一次并尽力发送脱敏的安装元数据。若不希望产生任何新遥测,先执行 `bugx config set telemetry.data_sharing false`,或对当前命令设置 `BUGX_TELEMETRY_ENABLED=0`。安装遥测不包含用户名、主机名、项目绝对路径、凭据或安装密钥;是否真正到达服务端仍以 HTTP 2xx 和服务端统计为准。
|
|
251
|
+
|
|
252
|
+
**BugX 能替代人工审查吗?**
|
|
253
|
+
不能。它提供一份可复查的账本——查了什么、没查什么、每条发现的复现证据——让人工审查从事实开始,而不是从模型的自述开始。
|
|
254
|
+
|
|
255
|
+
**审计支持哪些语言?**
|
|
256
|
+
基于 tree-sitter 的多语言静态与行为分析(Python、JavaScript/TypeScript、Java、Go、Rust 等),外加 native / Python / JVM / Electron / Android / Apple 六类目标的内存专项检查。
|
|
257
|
+
|
|
258
|
+
## 支持的 AI 编程宿主
|
|
259
|
+
|
|
260
|
+
| AI 编程助手 | 接入方式 | 安装命令 |
|
|
261
|
+
| :--- | :--- | :--- |
|
|
262
|
+
| **Claude Code** | 原生 MCP / 自治生命周期 | `bugx install --agent claude` |
|
|
263
|
+
| **OpenAI Codex** | 工作区子 Agent / 原生插件 | `bugx install --agent codex` |
|
|
264
|
+
| **OpenCode** | Headless ACP / 原生 MCP | `bugx install --agent opencode` |
|
|
265
|
+
| **Cline / Roo Code** | MCP 交互会话(单 Claim 串行)/ CLI 多进程池并发 | `bugx install --agent cline` |
|
|
266
|
+
| **Kimi Code** | Headless ACP / 原生 MCP | `bugx install --agent kimi` |
|
|
267
|
+
| **ZCode** | 原生 MCP / 用户级 MCP 注册 | `bugx install --agent zcode` |
|
|
268
|
+
| **MiniMax Code** | 自定义 Agent、Plugin V1 Worker、Skill 和 MCP | `bugx install --agent minimax` |
|
|
269
|
+
| **Google Antigravity(反重力)** | 原生 Agent/Worker、Skill、项目级 Supervisor/Worker/docs MCP、ACP 直通 | `bugx install --agent antigravity` |
|
|
270
|
+
| **Gemini / Gemini Code** | 原生 MCP 连接 / 自动化审查管道(全面支持最新 Gemini 4 体系) | `bugx install --agent gemini` 或标准 MCP 接入 |
|
|
271
|
+
|
|
272
|
+
其余宿主(DeepSeek Harness、WorkBuddy、Cursor / Windsurf 等)持续适配中。
|
|
273
|
+
|
|
274
|
+
运行 `bugx hosts` 查看本机可检测的宿主。
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
## 数据与安全边界
|
|
278
|
+
|
|
279
|
+
- 项目状态存放在项目内的 `.bugx/` 目录;全局引擎、凭据、知识库、缓存使用用户级 BugX 目录。
|
|
280
|
+
- 凭据按需写入受控沙箱(默认仅当前用户可读);`bugx auth status` 只报告凭据是否存在,不输出内容。模型名不等于凭据。
|
|
281
|
+
- 知识同步、项目画像、反馈、诊断日志和 bundle 上传都是显式操作;独立安装/心跳遥测默认开启,可用 `telemetry.data_sharing=false` 或 `BUGX_TELEMETRY_ENABLED=0` 关闭。任何网络动作都应按实际数据面核对 scope、敏感数据策略、详细模式和服务端证据。
|
|
282
|
+
- `reset / uninstall / purge / --no-backup` 会删除数据,请留意各自的 dry-run 与备份行为。
|
|
283
|
+
|
|
284
|
+
## 文档
|
|
285
|
+
|
|
286
|
+
- [用户指南](guides/01_USER_GUIDE.md):安装、配置、宿主能力、生命周期、MCP/ACP、云端范围、结果与恢复。
|
|
287
|
+
- [命令参考](guides/02_COMMANDS.md):全部命令、参数、默认值、作用域、副作用与退出行为。
|
|
288
|
+
- [故障排查](guides/03_TROUBLESHOOTING.md)按症状定位问题与可恢复的下一步。
|
|
289
|
+
- [BugX 极简 Skill](hosts/platform_bugx_SKILL.md) 配合 `bugx guide` 提供秒级操作检索、云同步、审查收尾与自愈指引。
|
|
290
|
+
- [UI 审计(probe ui)](guides/02_COMMANDS.md#63-probe):对运行中的 Web UI 做响应式布局、对比度、键盘路径与设计 Token 审计。
|
|
291
|
+
- [AI 参考](ai/01_AI_REFERENCE.md):面向宿主/Agent 的 MCP、生命周期、状态、证据与失败契约。
|
|
292
|
+
- `文档索引与官方知识库` (`docs/README.md`):架构与文档导航(内置 `bugx-docs` 远程优先 MCP 与随包离线速查知识库,支持宿主直接调用 `search_docs` / `fetch_doc` 查询全套操作指南)。
|
|
293
|
+
|
|
294
|
+
## 交流群
|
|
295
|
+
|
|
296
|
+
加入 Bugx 交流群,反馈问题、交流用法:
|
|
297
|
+
|
|
298
|
+

|
|
299
|
+
|
|
300
|
+
## 开发与贡献
|
|
301
|
+
|
|
302
|
+
仓库开发规范(文档同步、版本契约、验证门禁)见 `AGENTS.md` (`AGENTS.md`);架构与内部设计见 [docs/02_architecture/](docs/02_architecture/)。提交前请跑 `python3 scripts/bump_version.py --check`。
|
|
303
|
+
|
|
304
|
+
## 关键词
|
|
305
|
+
|
|
306
|
+
Google Antigravity · 反重力 · 反重力智能体 · Gemini 4 · Gemini 4 Carbon · Gemini 4 Neon · Gemini · Gemini 编程助手 · Gemini Code Assist · G4 模型 · Claude 5.5 · Claude Sonnet 5.5 · Claude Opus 5.5 · Claude Code 审计 · GPT-4 代码审计 · 自动代码审计 · AI 代码审计 · 自动化 Code Review · Code Review · 代码审查 Agent · 代码审计智能体 · AI Agent · Vibe Coding 安全 · 氛围编程审计 · PR 自动审查 · 零误报 · 真实 PoC 复现 · 盲审验证 · 安全审计 · 漏洞扫描 · 漏洞挖掘 · 静态分析 · MCP 服务 · MCP 安全 · Codex 审计 · 编程助手安全 · 自主审计 · 行为差分 · 内存泄漏检测 · Python 安全 · JavaScript 安全 · DevSecOps
|
|
307
|
+
|
|
308
|
+
## 许可
|
|
309
|
+
|
|
310
|
+
[Business Source License 1.1](LICENSE)。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# core/bundled_docs — BugX 随包官方离线文档基线
|
|
2
|
+
|
|
3
|
+
> 本目录由 `scripts/refresh_signed_mirrors.py` 自动从公开文档生成;严禁手工编辑或纳入 `docs/08_internal/`。
|
|
4
|
+
> `bugx-docs` MCP 与 `bugx guide` 在未连接云端或处于离线/只读环境时自动挂载本基线(`bugx:official`),与项目私有文档隔离。
|
|
5
|
+
|
|
6
|
+
## 清单摘要
|
|
7
|
+
|
|
8
|
+
- 契约版本:`0.1.4`
|
|
9
|
+
- 文档数:22 份(共 485,544 字节)
|
|
10
|
+
- 子目录:`guides/`(用户指南与场景速查卡)、`ai/`(AI 参考与命令选路)、`reference/`(环境变量与拓扑)、`hosts/`(宿主与通用 Skill)
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="README.md">中文</a> · English
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="core/assets/bugx-hero-en.svg" alt="BugX — effortless audits of AI-written code" width="800">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# BugX — Autonomous Code Review & Automated Testing Agent
|
|
10
|
+
|
|
11
|
+
BugX is an autonomous code review and automated testing agent that lives inside your AI coding assistant or runs standalone on the command line.
|
|
12
|
+
|
|
13
|
+
**It safeguards software delivery at every step:**
|
|
14
|
+
- **For Developers**: Catches subtle, high-impact bugs immediately after code is written, eliminating painful debugging loops and rework.
|
|
15
|
+
- **For QA & Test Engineers**: Automates black-box, functional, and performance testing across complex edge cases that manual reviews often miss.
|
|
16
|
+
- **For Engineering Teams**: Guarantees code strictly meets functional contracts with rock-solid stability and resilience, ensuring dependable, crash-free releases.
|
|
17
|
+
|
|
18
|
+
By replacing subjective self-reporting with automated, evidence-backed audits, BugX accelerates release velocity, elevates software quality, and reduces long-term maintenance costs. Supported environments include **Claude Code, OpenAI Codex, Cursor, Trae, Windsurf, Kimi Code, MiniMax Code, OpenCode, ZCode, Cline, DeepSeek Harness (DSH), WorkBuddy, and Qoder**.
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://pypi.org/project/bugx-cli/"><img src="https://img.shields.io/pypi/v/bugx-cli.svg?style=flat&color=0284c7&label=PyPI" alt="PyPI"></a>
|
|
22
|
+
<a href="https://www.npmjs.com/package/bugx-cli"><img src="https://img.shields.io/npm/v/bugx-cli.svg?style=flat&color=0284c7&label=npm" alt="npm"></a>
|
|
23
|
+
<img src="https://img.shields.io/badge/python-%E2%89%A53.11-334155.svg?style=flat" alt="Python">
|
|
24
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-334155.svg?style=flat" alt="Platform">
|
|
25
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-BSL--1.1-334155.svg?style=flat" alt="License"></a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
🌐 Website: **https://bugx.dev**
|
|
29
|
+
|
|
30
|
+
## Contents
|
|
31
|
+
|
|
32
|
+
- [The problem it solves](#the-problem-it-solves)
|
|
33
|
+
- [Quick start](#quick-start)
|
|
34
|
+
- [What a full audit looks like](#what-a-full-audit-looks-like)
|
|
35
|
+
- [Supported AI coding tools](#supported-ai-coding-tools)
|
|
36
|
+
- [Data and security](#data-and-security)
|
|
37
|
+
- [Documentation](#documentation)
|
|
38
|
+
- [Development](#development)
|
|
39
|
+
- [License](#license)
|
|
40
|
+
|
|
41
|
+
## The problem it solves
|
|
42
|
+
|
|
43
|
+
AI writes code faster than any human can review it. And the model carries a quirk that makes this worse: it cuts corners. That isn't malice — it's how the model was trained. Three mechanisms stack together:
|
|
44
|
+
|
|
45
|
+
1. **The grader rewards confidence.** The last stage of training is human raters scoring responses. One answer says "I checked it carefully, nothing found." Another says "I haven't finished reading the files." The first scores better — it sounds reliable and useful. So the model learns that reporting good news earns the reward.
|
|
46
|
+
2. **Checking is expensive; claiming is cheap.** Reading a few hundred files takes real work. Replying "no issues found" takes a few words. When both options sit on the table, the cheap one always wins.
|
|
47
|
+
3. **It doesn't know what it hasn't checked.** The model can't see its own coverage gaps, and nothing in training taught it to say "half done." So it says "done" — every time.
|
|
48
|
+
|
|
49
|
+
BugX replaces that with a ledger and four hard rules:
|
|
50
|
+
|
|
51
|
+
1. **A coverage list.** Your project is split into audit units, each with a real status: checked, blocked, or not yet checked. Coverage is tracked, not assumed.
|
|
52
|
+
2. **Independent blind review & reproduction.** Suspicious findings are blind-reviewed by an isolated verification agent. The attack input must reproduce the bug twice, and a clean input must trigger zero times, backed by AST syntax anti-empty assertions. Refuted findings are logged to the FP Ledger to prevent repeat false alarms.
|
|
53
|
+
3. **It picks up where it left off.** Close your AI tool and reopen it later — the audit resumes from the last recorded step instead of starting over.
|
|
54
|
+
4. **Every verdict stays reviewable.** Who checked what, when, and on what evidence goes into the ledger line by line, with hash chaining between pages. Nothing gets edited quietly.
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
Python `>=3.11`; the npm wrapper needs Node.js `>=18`.
|
|
59
|
+
|
|
60
|
+
Install from PyPI:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
python -m pip install bugx-cli
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or install from npm:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install -g bugx-cli
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Check and update using the server release matching your current install source:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
bugx update --check # check only: 0=up-to-date, 1=update available, 2=check failed
|
|
76
|
+
bugx update # update pip or npm wrapper installation
|
|
77
|
+
bugx update --channel alpha # explicitly choose pre-release channel
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then run this once from any directory:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
bugx install
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> ⚠️ **Important (Restart Required)**: After configuring or updating project MCP settings, **completely restart your host IDE or AI coding assistant** (e.g., Cursor, Trae, VS Code, Kimi Code, MiniMax Code, ZCode) so the host process reloads the project-level MCP server configuration.
|
|
87
|
+
|
|
88
|
+
CLI boolean flags are switches: pass `--force` to enable, omit it to disable. Do not pass `--force=True` or `force=True`.
|
|
89
|
+
It lists every AI host it detects on your machine and walks you through picking one. To install everywhere at once, use `bugx install --agent all`.
|
|
90
|
+
|
|
91
|
+
### Connect the project to BugX Cloud
|
|
92
|
+
|
|
93
|
+
From the repository root, confirm the account, sync scope, and sensitive-data policy. Run `bugx auth login --root .` and check that `bugx auth status --root . --verify --json` reports the expected account and `auth_verified=true`.
|
|
94
|
+
|
|
95
|
+
When both the account-wide and project scopes are authorized, initialize a fresh project with `bugx init --root . --cloud-sync sync` and check the first transfer with `bugx cloud sync --root . --scope all`. Initialization installs `.agents/skills/bugx/SKILL.md`. Invoke `/bugx` or run `bugx guide "<query>"` for on-demand steps in a host that discovers project Skills there. For existing projects, use `bugx cloud sync --root . --scope all` after the full scope is authorized, then check the binding and queue with `bugx cloud status --root . --scope all --json`. This flow includes project registration and profile, project knowledge, and account-wide knowledge. Decline requests for partial sync.
|
|
96
|
+
|
|
97
|
+
### Option 1: use it inside your AI assistant (recommended)
|
|
98
|
+
|
|
99
|
+
No terminal and no commands to remember. Open your AI assistant in any project — Claude Code, Codex, Cline, OpenCode, ZCode — and just tell it what to check:
|
|
100
|
+
|
|
101
|
+
**ZCode**
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+
**Codex**
|
|
105
|
+

|
|
106
|
+
|
|
107
|
+
**DSH**
|
|
108
|
+

|
|
109
|
+
|
|
110
|
+
> "Audit this project"
|
|
111
|
+
> "Check the login module for vulnerabilities"
|
|
112
|
+
> "Review the changes on this branch for security issues"
|
|
113
|
+
|
|
114
|
+
The AI inside your host calls BugX on its own: it builds the coverage list, dispatches concurrent workers, runs probes, verifies the findings, and writes the report. To watch an audit live, run `bugx report serve` in a terminal and open **http://127.0.0.1:8080** — that's the full web report.
|
|
115
|
+
|
|
116
|
+
### Option 2: run it from the command line
|
|
117
|
+
|
|
118
|
+
On the command line, the AI still comes from your installed hosts: BugX reuses the model and credentials you already configured there and never takes over your API keys (`--model` / `--provider` default to your host's configuration).
|
|
119
|
+
|
|
120
|
+
Check the selected host and connection with `bugx doctor --root . --strict`. For a staged CLI run, follow the [lifecycle guide](guides/01_USER_GUIDE.md#8-从-pre-到-post-的完整生命周期) through execution, evidence review, and settlement. See the current stage with `bugx engine --root . status --json`.
|
|
121
|
+
|
|
122
|
+
Or let BugX run the whole thing while you do something else:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
bugx autonomous --host opencode # model and credentials come from your OpenCode setup
|
|
126
|
+
# or give it a target:
|
|
127
|
+
bugx goal --host opencode "audit this project's login and payment flows"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Fixes and outputs are command-line work too:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
bugx test-generate ... # generate AAA tests or a self-contained PoC for a unit
|
|
134
|
+
bugx test-verify ... # mutate the code to prove your tests catch real bugs
|
|
135
|
+
bugx patch-forge --from-issue <id> --diff fix.diff --repro repro.md --test test_ok.py --dry-run
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`patch-forge` builds a patch bundle and runs static checks on it. It produces the bundle but commits nothing — remove `--dry-run` once you've reviewed it.
|
|
139
|
+
|
|
140
|
+
Open the web UI for reports (during or after an audit):
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
bugx report serve # then open http://127.0.0.1:8080 for live coverage, evidence, and findings
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For offline archives, export a static report:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
bugx report both --format html --out report.html
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
See the host table below for valid `--agent` values; `bugx hosts` lists every environment detected on this machine with its capabilities.
|
|
153
|
+
|
|
154
|
+
## What a full audit looks like
|
|
155
|
+
|
|
156
|
+
1. **pre (with the game plan).** BugX enumerates your source and configuration files, then builds a minimal list of audit units (single modules plus cross-module business flows). Before anything runs, you get a plan with five decisions in one pass: **cloud sync** (sign in and sync lessons and experience, or explicitly choose offline use), **review mode**, **polling strategy**, **fix mode**, and **commit handling**. Confirm the actual sync scope and review policies presented by the startup gates.
|
|
157
|
+
2. **Workers fan out.** The host hands audit units to concurrent workers. Each worker takes a lease, sends heartbeats, runs probes, and commits checkpoints.
|
|
158
|
+
3. **Evidence lands on disk.** Every worker conclusion carries the command it ran, the exit code, and the artifact hash. Coverage is only ever `covered` or `blocked` — "roughly checked" doesn't exist here.
|
|
159
|
+
4. **Findings get adjudicated.** Candidate bugs first go through the engine's verification channel: two positive runs plus a negative control, executed for real. Only then are they confirmed or rejected, and a rejection needs a stated reason.
|
|
160
|
+
5. **post.** Coverage and findings are cross-checked and the audit settles. Whether it's actually done is decided by the state machine's final state — the model saying "done" doesn't count.
|
|
161
|
+
6. **The report.** `bugx report both --format html --out report.html` produces the formal and visual reports; `bugx report serve` starts the live preview.
|
|
162
|
+
|
|
163
|
+
## A look at the interface
|
|
164
|
+
|
|
165
|
+
BugX ships with BugX Studio, a web workbench. Run `bugx report serve` and open http://127.0.0.1:8080:
|
|
166
|
+
|
|
167
|
+
<p align="center">
|
|
168
|
+
<img src="core/assets/webui-studio.jpg" alt="BugX Studio workbench" width="860">
|
|
169
|
+
</p>
|
|
170
|
+
|
|
171
|
+
The workspace covers every connected host, and each host keeps its own audit sessions (the sidebar shows ChatGPT, ZCode, Claude, Codex, DSH, OpenCode, Pi, and more):
|
|
172
|
+
|
|
173
|
+
<p align="center">
|
|
174
|
+
<img src="core/assets/webui-chatgpt.jpg" alt="ChatGPT workspace" width="420">
|
|
175
|
+
<img src="core/assets/webui-zcode.jpg" alt="ZCode workspace" width="420">
|
|
176
|
+
</p>
|
|
177
|
+
|
|
178
|
+
The skill marketplace ships with `/audit` (one-shot full-surface audit with a dual-track report), `/review` (structured findings for branch changes), `/mining` (attack-surface survey and hardening), `/fix` (defensive patches with sandboxed regression), and `/test` (AAA tests with mutation-kill scoring):
|
|
179
|
+
|
|
180
|
+
<p align="center">
|
|
181
|
+
<img src="core/assets/webui-skills.jpg" alt="Skill marketplace" width="860">
|
|
182
|
+
</p>
|
|
183
|
+
|
|
184
|
+
## What it can do
|
|
185
|
+
|
|
186
|
+
**Audit**
|
|
187
|
+
- **Code review**: bugs and defects, classified by logic / state / boundary / exception / concurrency / performance / resource.
|
|
188
|
+
- **Functionality review**: business-flow audit plus a behavior diff — feed the same inputs to your implementation and a reference implementation, then compare what differs.
|
|
189
|
+
- **Performance and memory**: performance and resource bugs, plus dedicated memory checks for six target families: native, Python, JVM, Electron, Android, and Apple.
|
|
190
|
+
- **UI audit**: layout, contrast, keyboard paths, and design tokens on a running web page (`bugx probe ui`).
|
|
191
|
+
|
|
192
|
+
**Reproduce and verify**
|
|
193
|
+
- Every finding ships with a command or input you can run yourself: the same bad input breaks it twice, a clean input breaks nothing, and all three runs stay on record.
|
|
194
|
+
- Your tests get graded too: `bugx test-verify` mutates your code to check whether the tests actually catch the bugs.
|
|
195
|
+
|
|
196
|
+
**Fixes and outputs**
|
|
197
|
+
- Generate AAA test cases or self-contained PoCs (`bugx test-generate`).
|
|
198
|
+
- Build patch bundles with static checks, delivered for your review — never committed for you (`bugx patch-forge`).
|
|
199
|
+
- Write reports (`bugx report`).
|
|
200
|
+
|
|
201
|
+
**Long term**
|
|
202
|
+
- **A lessons base**: sync verified lessons and experience with `bugx cloud sync` in the authorized scope. Use `bugx lesson retrieve` to look up a symptom or module in the next review.
|
|
203
|
+
- **Unattended runs**: follow your host (`bugx autonomous`), run toward a goal (`bugx goal`), or keep a resident daemon (`bugx daemon`).
|
|
204
|
+
- **Diagnostics & feedback**: `bugx doctor` / `bugx log` / `bugx stats` for installation, logs, and usage; use `bugx issue report` or `bugx feedback` to package sanitized local diagnostics and submit feedback directly.
|
|
205
|
+
- **Official documentation (Remote-First)**: built-in `bugx-docs` MCP server and `bugx guide` CLI command, connecting directly to official endpoints by default with seamless local fallback when offline.
|
|
206
|
+
|
|
207
|
+
## FAQ
|
|
208
|
+
|
|
209
|
+
**What is BugX?**
|
|
210
|
+
An autonomous code-audit agent that lives inside AI coding assistants: it runs via MCP in Claude Code, Codex, Cline, OpenCode, and ZCode, or as a standalone CLI, tracks audit coverage per unit, and verifies every finding with real executions.
|
|
211
|
+
|
|
212
|
+
**Which AI coding tools does BugX support?**
|
|
213
|
+
BugX currently supports **Claude Code, OpenAI Codex, Cursor, Trae, Windsurf, Kimi Code, MiniMax Code, Google Antigravity, Cline / Roo Code, OpenCode, ZCode, DeepSeek Harness (DSH), WorkBuddy, and Qoder**, with continuous adaptations across the Model Context Protocol (MCP) ecosystem.
|
|
214
|
+
|
|
215
|
+
**How does BugX verify a vulnerability?**
|
|
216
|
+
Rather than trusting the proposing model's self-report, findings are independently blind-reviewed: an attack input must reliably trigger the vulnerability twice, and a clean input must trigger zero times (two positive runs, one negative control) recorded with command, exit code, and artifact hashes, verified by AST syntax assertions. Refuted findings are recorded in the FP Ledger.
|
|
217
|
+
|
|
218
|
+
**Does BugX trigger AI model cyber-security risk blocks?**
|
|
219
|
+
BugX includes a declarative Prompt Policy Engine with adaptive prompt profiles (e.g., defensive QA phrasing for OpenAI Codex / GPT-4o) that prevents models from triggering platform Daybreak / Cyber Risk safety blocks, while preserving 100% of the underlying code and CWE details.
|
|
220
|
+
|
|
221
|
+
**Does BugX send my code to the cloud?**
|
|
222
|
+
The audit itself runs locally. Enabling lesson and experience sync can trigger transfers at startup and after eligible ledger writes. Check the authorized scope and sensitive-data policy before enabling sync.
|
|
223
|
+
|
|
224
|
+
**Does BugX replace human review?**
|
|
225
|
+
No. It gives you a reviewable ledger — what was checked, what wasn't, and reproducible evidence per finding — so human review starts from facts instead of the model's self-report.
|
|
226
|
+
|
|
227
|
+
**What languages does BugX audit?**
|
|
228
|
+
Multi-language static and behavioral analysis (Python, JavaScript/TypeScript, Java, Go, Rust, and more via tree-sitter), plus dedicated memory checks for native, Python, JVM, Electron, Android, and Apple targets.
|
|
229
|
+
|
|
230
|
+
## Supported AI coding tools
|
|
231
|
+
|
|
232
|
+
| AI coding tool | Integration | Install command |
|
|
233
|
+
| :--- | :--- | :--- |
|
|
234
|
+
| **Claude Code** | Native MCP / autonomous lifecycle | `bugx install --agent claude` |
|
|
235
|
+
| **OpenAI Codex** | Workspace subagents / native plugin | `bugx install --agent codex` |
|
|
236
|
+
| **Cursor / Trae / Windsurf** | Native project-level MCP integration | `bugx install --agent cursor` |
|
|
237
|
+
| **Kimi Code** | Managed plugin / project MCP | `bugx install --agent kimi` |
|
|
238
|
+
| **MiniMax Code** | Plugin V1 package / agent & MCP | `bugx install --agent minimax` |
|
|
239
|
+
| **Google Antigravity** | Native Agent/Worker, Skills, project-level Supervisor/Worker/docs MCP, ACP direct passthrough | `bugx install --agent antigravity` |
|
|
240
|
+
| **Gemini / Gemini Code** | Native MCP connection / automated audit pipelines (Full Gemini 4 Carbon / Neon support) | `bugx install --agent gemini` or standard MCP |
|
|
241
|
+
| **OpenCode** | Headless ACP / native MCP | `bugx install --agent opencode` |
|
|
242
|
+
| **Cline / Roo Code** | MCP chat sessions / multi-process concurrency | `bugx install --agent cline` |
|
|
243
|
+
| **ZCode** | Native MCP / user-level MCP registration | `bugx install --agent zcode` |
|
|
244
|
+
| **DeepSeek Harness (DSH)** | Desktop launcher / managed plugin & MCP | `bugx install --agent dsh` |
|
|
245
|
+
| **WorkBuddy / Qoder** | Connector meta / native extension | `bugx install --agent workbuddy` |
|
|
246
|
+
|
|
247
|
+
Run `bugx hosts` to see all environments detected on your machine.
|
|
248
|
+
|
|
249
|
+
## Data and security
|
|
250
|
+
|
|
251
|
+
- Project state lives in the project's `.bugx/` directory; the global engine, credentials, knowledge base, and caches live in a user-level BugX directory.
|
|
252
|
+
- Credentials are written to a controlled sandbox when needed (readable only by the current user by default). `bugx auth status` reports whether credentials exist — it never prints them. A model name is not a credential.
|
|
253
|
+
- Knowledge sync uses the configured scope and sensitive-data policy. Bundle uploads, diagnostic log reports, and feedback have separate commands and data boundaries.
|
|
254
|
+
- `reset` / `uninstall` / `purge` / `--no-backup` delete data. Check each command's dry-run and backup behavior first.
|
|
255
|
+
|
|
256
|
+
## Documentation
|
|
257
|
+
|
|
258
|
+
The documentation is written in Chinese:
|
|
259
|
+
|
|
260
|
+
- [User guide](guides/01_USER_GUIDE.md): installation, configuration, host capabilities, lifecycle, MCP/ACP, cloud scope, results, and recovery.
|
|
261
|
+
- [Command reference](guides/02_COMMANDS.md): every command, argument, default, scope, side effect, and exit behavior.
|
|
262
|
+
- [Troubleshooting](guides/03_TROUBLESHOOTING.md) covers common symptoms and recovery steps.
|
|
263
|
+
- The [BugX skill](hosts/platform_bugx_SKILL.md) and `bugx guide` cover on-demand setup, cloud sync, evidence review, and lesson reuse.
|
|
264
|
+
- [UI audit (probe ui)](guides/02_COMMANDS.md#63-probe): responsive layout, contrast, keyboard paths, and design tokens on a running web UI.
|
|
265
|
+
- [AI reference](ai/01_AI_REFERENCE.md): MCP, lifecycle, state, evidence, and failure contracts for hosts and agents.
|
|
266
|
+
- `Docs index` (`docs/README.md`): architecture and documentation navigation (including 5 topic cookbooks in `docs/01_guides/04_*`..`08_*`, packaged into `core/bundled_docs/` for instant offline `bugx guide` / `bugx-docs` queries and versioned cloud hot-sync).
|
|
267
|
+
|
|
268
|
+
## Development
|
|
269
|
+
|
|
270
|
+
Repository conventions (docs sync, version contract, verification gates) live in `AGENTS.md` (`AGENTS.md`); architecture and internal design live in [docs/02_architecture/](docs/02_architecture/). Before committing, run `python3 scripts/bump_version.py --check`.
|
|
271
|
+
|
|
272
|
+
## Keywords
|
|
273
|
+
|
|
274
|
+
Google Antigravity · Antigravity IDE · Gemini 4 · Gemini 4 Carbon · Gemini 4 Neon · Gemini · Gemini Code Assist · G4 models · Claude 5.5 · Claude Sonnet 5.5 · Claude Opus 5.5 · Claude Code review · GPT-4 code review · vibe coding · vibe coding security · pr review · pull request review · zero false positive · poc generator · mcp security · automated code audit · ai code audit · automated code review · code review agent · ai agent · security audit · vulnerability scanner · vulnerability mining · sast · static analysis · mcp server · claude code · openai codex · opencode · cline · zcode · coding agent · llm code review · autonomous audit · behavior diff · memory leak detection · python security · javascript security · devsecops
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
[Business Source License 1.1](LICENSE).
|