bingo-light 2.1.1 → 2.1.2

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.en.md CHANGED
@@ -10,7 +10,7 @@
10
10
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
11
11
  <a href="https://github.com/DanOps-1/bingo-light/releases"><img src="https://img.shields.io/github/v/release/DanOps-1/bingo-light?label=Release&color=orange" alt="Release"></a>
12
12
  <br>
13
- <a href="#for-ai-agents"><img src="https://img.shields.io/badge/MCP_Server-29_tools-blueviolet.svg" alt="MCP: 29 tools"></a>
13
+ <a href="#for-ai-agents"><img src="https://img.shields.io/badge/MCP_Server-35_tools-blueviolet.svg" alt="MCP: 35 tools"></a>
14
14
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/Python-3.8+-3776ab.svg" alt="Python 3.8+"></a>
15
15
  <img src="https://img.shields.io/badge/Dependencies-Zero-brightgreen.svg" alt="Zero deps">
16
16
  <a href="https://github.com/DanOps-1/bingo-light/stargazers"><img src="https://img.shields.io/github/stars/DanOps-1/bingo-light?style=social" alt="Stars"></a>
@@ -25,7 +25,7 @@ GitHub's "Sync fork" button breaks the moment you have customizations. `git reba
25
25
 
26
26
  Your patches live as a clean, named stack on top of upstream. Syncing is `bingo-light sync`. Conflicts get remembered so you never solve the same one twice. And if something goes sideways, `bingo-light undo` puts everything back in one second.
27
27
 
28
- Every command speaks JSON. The built-in MCP server gives AI agents 29 tools to manage your fork autonomously -- from init through conflict resolution. No human in the loop required.
28
+ Every command speaks JSON. The built-in MCP server gives AI agents 35 tools to manage your fork autonomously -- from init through conflict resolution. No human in the loop required.
29
29
 
30
30
  ---
31
31
 
@@ -93,13 +93,14 @@ That's it. Three commands and your fork stays in sync forever.
93
93
 
94
94
  ### For AI Agents
95
95
 
96
- - :electric_plug: **MCP server (29 tools)** -- full fork management from init through conflict resolution.
96
+ - :electric_plug: **MCP server (35 tools)** -- full fork management from init through conflict resolution.
97
97
  - :bar_chart: **`--json` on everything** -- every command returns structured JSON. Parse, don't scrape.
98
98
  - :mute: **`--yes` flag** -- fully non-interactive. No TTY required. No prompts. Ever.
99
99
  - :gear: **Auto-detect non-TTY** -- pipes and subprocesses trigger non-interactive mode automatically.
100
100
  - :memo: **`BINGO_DESCRIPTION` env var** -- set patch descriptions without stdin.
101
101
  - :mag: **`conflict-analyze --json`** -- structured conflict data: file, ours, theirs, resolution hints.
102
102
  - :white_check_mark: **`conflict-resolve`** -- write resolved content via MCP, auto-stage, continue rebase. Zero manual intervention.
103
+ - :package: **Dependency patching** -- `dep patch/apply/sync` for npm/pip packages. Patches survive `npm install`.
103
104
  - :satellite: **Advisor agent** -- `contrib/agent.py` monitors drift, analyzes risk, auto-syncs when safe.
104
105
 
105
106
  ---
@@ -199,7 +200,7 @@ make install && bingo-light setup
199
200
 
200
201
  ## For AI Agents
201
202
 
202
- bingo-light was designed from day one for AI agents. Every command speaks JSON. The MCP server exposes 29 tools covering the full lifecycle from `init` to `conflict-resolve`. Non-interactive mode is the default when stdin is not a TTY.
203
+ bingo-light was designed from day one for AI agents. Every command speaks JSON. The MCP server exposes 35 tools covering the full lifecycle from `init` to `conflict-resolve`. Non-interactive mode is the default when stdin is not a TTY.
203
204
 
204
205
  ### MCP setup -- Claude Code
205
206
 
@@ -233,7 +234,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
233
234
 
234
235
  **Any MCP client** (VS Code Copilot, Cursor, custom agents): connect via stdio to `python3 mcp-server.py`.
235
236
 
236
- ### 29 MCP Tools
237
+ ### 35 MCP Tools
237
238
 
238
239
  | Tool | Purpose |
239
240
  |------|---------|
@@ -375,6 +376,12 @@ bingo-light patch meta <name> [key] [value] Get/set patch metadata
375
376
  bingo-light conflict-analyze Structured conflict data for AI
376
377
  bingo-light config get|set|list [key] [val] Manage configuration
377
378
  bingo-light test Run configured test suite
379
+ bingo-light dep patch <package> [name] Patch a modified npm/pip dependency
380
+ bingo-light dep apply [package] Re-apply dependency patches after install
381
+ bingo-light dep sync Re-apply after update + detect conflicts
382
+ bingo-light dep status Dependency patch health check
383
+ bingo-light dep list List all dependency patches
384
+ bingo-light dep drop <package> [patch] Remove a dependency patch
378
385
  bingo-light workspace init|add|status|sync Multi-repo management
379
386
  bingo-light auto-sync Generate GitHub Actions workflow
380
387
  bingo-light version Print version
@@ -417,7 +424,7 @@ StGit (649 stars) manages patch stacks but has no AI integration, no MCP server,
417
424
  | Handles customizations | **Yes** | **No** | Manual | Manual | Manual |
418
425
  | Conflict memory (rerere) | **Auto** | No | Manual | No | No |
419
426
  | Conflict prediction | **Yes** | No | No | No | No |
420
- | AI / MCP integration | **29 tools** | No | No | No | No |
427
+ | AI / MCP integration | **35 tools** | No | No | No | No |
421
428
  | JSON output | **All commands** | No | No | No | No |
422
429
  | Non-interactive mode | **Native** | No | Partial | Partial | Partial |
423
430
  | Undo sync | **One command** | No | git reflog | Manual | Manual |
@@ -483,7 +490,7 @@ Yes. bingo-light uses standard git operations (fetch, rebase, push). It works wi
483
490
  ```
484
491
  bingo-light CLI tool (Python 3, zero deps)
485
492
  bingo_core/ Core library package (all business logic)
486
- mcp-server.py MCP server (zero-dep Python 3, 29 tools, JSON-RPC 2.0)
493
+ mcp-server.py MCP server (zero-dep Python 3, 35 tools, JSON-RPC 2.0)
487
494
  contrib/agent.py Advisor agent (monitors drift, auto-syncs when safe)
488
495
  contrib/tui.py Terminal dashboard (curses TUI, real-time monitoring)
489
496
  install.sh Installer (--yes for CI, --help for options)
package/README.md CHANGED
@@ -2,38 +2,43 @@
2
2
  <br>
3
3
  <img src="docs/logo.svg" alt="bingo-light logo" width="200">
4
4
  <br><br>
5
- <strong>Fork 同步,一条命令搞定。<br>人用、AI 用,零依赖。</strong>
5
+ <strong>让 AI 接管你的 Fork 维护。<br>同步、冲突、补丁管理 — 全自动。</strong>
6
6
  <br><br>
7
7
  <a href="README.en.md">English</a> | <b>简体中文</b>
8
8
  <br><br>
9
9
  <a href="https://github.com/DanOps-1/bingo-light/actions"><img src="https://github.com/DanOps-1/bingo-light/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
10
10
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
11
11
  <a href="https://github.com/DanOps-1/bingo-light/releases"><img src="https://img.shields.io/github/v/release/DanOps-1/bingo-light?label=Release&color=orange" alt="Release"></a>
12
- <a href="#mcp-服务器"><img src="https://img.shields.io/badge/MCP_Server-29_tools-blueviolet.svg" alt="MCP: 27 tools"></a>
12
+ <a href="#mcp-服务器"><img src="https://img.shields.io/badge/MCP_Server-35_tools-blueviolet.svg" alt="MCP: 35 tools"></a>
13
13
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/Python-3.8+-3776ab.svg" alt="Python 3.8+"></a>
14
14
  <img src="https://img.shields.io/badge/Dependencies-Zero-brightgreen.svg" alt="Zero deps">
15
15
  <a href="https://github.com/DanOps-1/bingo-light/stargazers"><img src="https://img.shields.io/github/stars/DanOps-1/bingo-light?style=social" alt="Stars"></a>
16
16
  <br><br>
17
17
  </p>
18
18
 
19
- GitHub 的 "Sync fork" 按钮?你一改代码它就废了。手动 `git rebase`?六步操作,每次都得记。AI 想帮你同步?没接口可调。
19
+ Fork 维护是个苦差事 — 上游一更新,你的定制化改动就得手动 rebase。GitHub 的 "Sync fork" 按钮碰到自定义 commit 直接废了。手动操作六步起步,冲突反复解,搞砸了还得从 reflog 里捞。
20
20
 
21
- **bingo-light 把这三个问题一锅端。**
21
+ **装完 bingo-light,跟你的 AI 说一句"帮我同步 Fork",剩下的它全搞定。**
22
22
 
23
- 改动以补丁栈的形式叠在上游之上,干干净净。同步一句 `bingo-light sync`。冲突解过一次就记住了,下次自动跳过。搞砸了 `bingo-light undo` 秒回。
23
+ 内置 MCP 服务器 35 个工具,AI 自主完成:拉上游、rebase 补丁、分析冲突、写合并代码、继续 rebase。冲突解过一次自动记住(rerere),下次不再问。搞砸了 `undo` 秒回。
24
24
 
25
- 所有命令支持 `--json` 输出。内置 MCP 服务器 29 个工具,AI 从初始化到冲突解决全程自主,不用人盯。
25
+ > [!TIP]
26
+ > **不想读文档?** 把这段丢给你的 AI,让它帮你装:
27
+ >
28
+ > ```
29
+ > 帮我安装 bingo-light 并配置好 MCP,参考:
30
+ > https://raw.githubusercontent.com/DanOps-1/bingo-light/main/docs/ai-setup.md
31
+ > ```
26
32
 
27
33
  ---
28
34
 
29
35
  ## 目录
30
36
 
31
- - [快速开始](#快速开始)
32
- - [演示](#演示)
33
37
  - [安装](#安装)
38
+ - [演示](#演示)
34
39
  - [功能特性](#功能特性)
40
+ - [MCP 服务器(35 工具)](#mcp-服务器)
35
41
  - [工作原理](#工作原理)
36
- - [MCP 服务器](#mcp-服务器)
37
42
  - [命令参考](#命令参考)
38
43
  - [集成指南](#集成指南)
39
44
  - [配置](#配置)
@@ -41,53 +46,97 @@ GitHub 的 "Sync fork" 按钮?你一改代码它就废了。手动 `git rebase
41
46
  - [与其他方案对比](#与其他方案对比)
42
47
  - [项目生态](#项目生态)
43
48
  - [参与贡献](#参与贡献)
44
- - [许可证](#许可证)
45
49
 
46
50
  ---
47
51
 
48
- ## 快速开始
52
+ ## 安装
53
+
54
+ ### 让 AI 帮你装(推荐)
49
55
 
50
- ```bash
51
- # 安装(任选一种)
52
- pip install bingo-light # Python
53
- npm install -g bingo-light # Node.js
54
- brew install DanOps-1/tap/bingo-light # Homebrew
56
+ 把下面这段丢给你的 AI(Claude Code、Cursor、Windsurf 等),它会自动装好并配好 MCP + Skill:
57
+
58
+ ```
59
+ 帮我安装并配置 bingo-light,参考这个文档:
60
+ https://raw.githubusercontent.com/DanOps-1/bingo-light/main/docs/ai-setup.md
61
+ ```
62
+
63
+ ### 自己装
55
64
 
56
- # 初始化 Fork 追踪
57
- cd my-forked-project
58
- bingo-light init https://github.com/original/project.git
65
+ | 方式 | 命令 |
66
+ |------|------|
67
+ | **pip** | `pip install bingo-light && bingo-light setup` |
68
+ | **npm** | `npm install -g bingo-light && bingo-light setup` |
69
+ | **npx** | `npx bingo-light setup` |
70
+ | **Homebrew** | `brew install DanOps-1/tap/bingo-light && bingo-light setup` |
59
71
 
60
- # 改代码,创建命名补丁
61
- vim src/feature.py
62
- bingo-light patch new my-feature
72
+ <details>
73
+ <summary><b>更多安装方式</b>(Docker / Shell / 源码)</summary>
63
74
 
64
- # 上游有更新?一句话同步
65
- bingo-light sync
75
+ **Docker**
76
+ ```bash
77
+ docker run --rm -v "$PWD:/repo" -w /repo ghcr.io/danops-1/bingo-light status
78
+ docker run --rm -i -v "$PWD:/repo" -w /repo ghcr.io/danops-1/bingo-light mcp-server.py
79
+ ```
80
+
81
+ **Shell 一键安装**
82
+ ```bash
83
+ curl -fsSL https://raw.githubusercontent.com/DanOps-1/bingo-light/main/install.sh | sh
66
84
  ```
67
85
 
68
- 就这么简单。补丁永远干净地叠在最新上游之上。
86
+ **从源码**
87
+ ```bash
88
+ git clone https://github.com/DanOps-1/bingo-light.git
89
+ cd bingo-light && make install && bingo-light setup
90
+ ```
91
+
92
+ </details>
93
+
94
+ > [!NOTE]
95
+ > **依赖:** Python 3.8+ / git 2.20+,没了。零 pip 依赖。
96
+ >
97
+ > MCP 客户端可直接用 npx:`{"command": "npx", "args": ["-y", "bingo-light-mcp"]}`
98
+
99
+ ---
69
100
 
70
101
  ## 演示
71
102
 
72
- ### 日常操作:初始化 → 建补丁 → 同步
103
+ <table>
104
+ <tr>
105
+ <td width="50%">
106
+
107
+ ### 日常操作
108
+
109
+ 初始化 → 建补丁 → 同步上游
73
110
 
74
111
  <p align="center">
75
- <img src="docs/demo.svg" alt="bingo-light 基本演示" width="850">
112
+ <img src="docs/demo.svg" alt="bingo-light 基本演示" width="100%">
76
113
  </p>
77
114
 
78
- ### 冲突处理:同步 → 分析 → 搞定
115
+ </td>
116
+ <td width="50%">
117
+
118
+ ### 冲突解决
119
+
120
+ 同步 → AI 分析 → 自动修复
79
121
 
80
122
  <p align="center">
81
- <img src="docs/demo-conflict.svg" alt="bingo-light 冲突解决演示" width="850">
123
+ <img src="docs/demo-conflict.svg" alt="bingo-light 冲突解决演示" width="100%">
82
124
  </p>
83
125
 
84
- > AI 调 `conflict-analyze --json` 拿到双方代码,写好合并结果,rebase 自动继续。全程零人工。
126
+ </td>
127
+ </tr>
128
+ </table>
85
129
 
86
- ### AI 拿到的是结构化数据
130
+ > [!NOTE]
131
+ > AI 调 `conflict-analyze --json` 拿到双方代码和解决提示,写好合并结果,rebase 自动继续。全程零人工。
132
+
133
+ ---
134
+
135
+ ### `--json` 输出:AI 直接消费
136
+
137
+ <details open>
138
+ <summary><b>Fork 状态</b> — <code>bingo-light status --json</code></summary>
87
139
 
88
- ```
89
- $ bingo-light status --json
90
- ```
91
140
  ```json
92
141
  {
93
142
  "ok": true,
@@ -102,11 +151,11 @@ $ bingo-light status --json
102
151
  }
103
152
  ```
104
153
 
105
- ### 冲突分析(AI 直接消费)
154
+ </details>
155
+
156
+ <details>
157
+ <summary><b>冲突分析</b> — <code>bingo-light conflict-analyze --json</code></summary>
106
158
 
107
- ```
108
- $ bingo-light conflict-analyze --json
109
- ```
110
159
  ```json
111
160
  {
112
161
  "rebase_in_progress": true,
@@ -123,92 +172,119 @@ $ bingo-light conflict-analyze --json
123
172
  }
124
173
  ```
125
174
 
126
- ## 安装
127
-
128
- 装完跑 `bingo-light setup`,交互式配好 MCP 和 AI Skill(Claude Code、Cursor、Windsurf、VS Code/Copilot、Gemini CLI 等一键选配)。
175
+ </details>
129
176
 
130
- ### pip / pipx
177
+ <details>
178
+ <summary><b>AI 全自动解冲突</b> — Claude Code 实际工作流</summary>
131
179
 
132
- ```bash
133
- pip install bingo-light # 或: pipx install bingo-light
134
- bingo-light setup # 选配 AI 工具
135
180
  ```
181
+ 你: "同步上游,冲突帮我修了。"
136
182
 
137
- ### npm / npx
183
+ Claude Code:
184
+ 1. bingo_status(cwd) → 落后 47 commit,risk: core.c
185
+ 2. bingo_sync(cwd, dry_run) → 预判 1 个冲突
186
+ 3. bingo_sync(cwd) → rebase 卡在冲突
187
+ 4. bingo_conflict_analyze() → 拿到双方代码 + 提示
188
+ 5. 读两边,写合并结果
189
+ 6. bingo_conflict_resolve(file) → 搞定
190
+ 7. bingo_status(cwd) → 0 落后,补丁干净 ✓
191
+ ```
138
192
 
139
- ```bash
140
- npm install -g bingo-light # 全局安装
141
- bingo-light setup
193
+ </details>
142
194
 
143
- # npx 免装:
144
- npx bingo-light setup
195
+ ### 交互式 Setup
196
+
197
+ ```console
198
+ $ bingo-light setup
199
+
200
+ ◆ bingo-light setup v2.1.1
201
+
202
+ ◆ MCP Server
203
+ │ Connect bingo-light tools to your AI coding assistants
204
+
205
+ │ › ■ Claude Code ~/.claude/settings.json
206
+ │ ■ Cursor ~/.cursor/mcp.json
207
+ │ □ Windsurf (not detected)
208
+ │ ■ VS Code / Copilot ~/.vscode/mcp.json
209
+
210
+ ◆ Skills / Custom Instructions
211
+ │ Teach your AI how to use bingo-light
212
+
213
+ │ ■ Claude Code ~/.claude/commands/bingo.md
214
+ │ ■ Continue ~/.continue/rules/bingo.md
215
+
216
+ └ 5 MCP + 2 skill(s) configured — ready to go!
145
217
  ```
146
218
 
147
- MCP 客户端直接用 npx:
148
- ```json
149
- {"command": "npx", "args": ["-y", "bingo-light-mcp"]}
150
- ```
219
+ > [!TIP]
220
+ > 支持 10 个 AI 工具的 MCP 配置 + 6 个平台的 Skill 安装。方向键多选,一次配完。
151
221
 
152
- ### Homebrew
222
+ ## AI 如何使用 bingo-light
153
223
 
154
- ```bash
155
- brew install DanOps-1/tap/bingo-light
156
- bingo-light setup
157
- ```
224
+ 这才是重点。bingo-light 是为 AI agent 设计的 Fork 维护工具。
158
225
 
159
- ### Docker
226
+ ### AI 拿到什么
160
227
 
161
- ```bash
162
- # CLI
163
- docker run --rm -v "$PWD:/repo" -w /repo ghcr.io/danops-1/bingo-light status
228
+ | | 能力 | 说明 |
229
+ |---|------|------|
230
+ | 🔌 | **MCP 服务器** | 35 个工具,AI 直接调用,从 init 到冲突解决全链路 |
231
+ | 📊 | **结构化输出** | 所有命令 `--json` 输出,AI 直接 parse |
232
+ | 🤖 | **零交互** | `--yes` + 非 TTY 自适应,不会卡在确认提示 |
233
+ | 🔍 | **冲突分析** | `conflict-analyze` 返回双方代码 + AI 可执行的解决提示 |
234
+ | ✏️ | **冲突解决** | `conflict-resolve` 直接写入合并代码,自动 stage + 继续 rebase |
235
+ | 🧠 | **冲突记忆** | rerere 自动记住解法,同样冲突不用 AI 再解第二次 |
236
+ | 📋 | **Skill / 指令** | `/bingo` 教 AI 整套工作流,不用你写 prompt |
237
+ | 📦 | **依赖补丁** | `dep patch/apply/sync` — npm/pip 包改了不怕 install 覆盖 |
238
+ | 🔄 | **Advisor 代理** | `contrib/agent.py` 后台监控漂移,安全时自动同步 |
164
239
 
165
- # MCP 服务器(stdio)
166
- docker run --rm -i -v "$PWD:/repo" -w /repo ghcr.io/danops-1/bingo-light mcp-server.py
167
- ```
168
-
169
- ### Shell 安装器
240
+ ### AI 实际工作流
170
241
 
171
- ```bash
172
- curl -fsSL https://raw.githubusercontent.com/DanOps-1/bingo-light/main/install.sh | sh
242
+ 你说一句 **"同步上游"**,AI 自己跑完整个流程:
173
243
 
174
- # 非交互模式(CI / Docker)
175
- curl -fsSL .../install.sh | sh -s -- --yes
244
+ ```
245
+ bingo_status() → 落后 47 commit,risk: core.c
246
+ bingo_sync(dry_run=true) → 预判 1 个冲突
247
+ bingo_sync() → rebase 卡在冲突
248
+ bingo_conflict_analyze() → 拿到 ours/theirs + hint
249
+ → AI 读两边代码,写合并结果
250
+ bingo_conflict_resolve() → 写入、stage、rebase 继续
251
+ bingo_status() → 0 落后,补丁干净 ✓
176
252
  ```
177
253
 
178
- ### 从源码安装
254
+ > [!IMPORTANT]
255
+ > **你不需要理解 rebase、rerere、tracking branch 这些概念。** AI 全部处理。你只需要装好工具,告诉 AI 你想干嘛。
179
256
 
180
- ```bash
181
- git clone https://github.com/DanOps-1/bingo-light.git
182
- cd bingo-light
183
- make install && bingo-light setup
184
- ```
257
+ ### 支持哪些 AI 工具
258
+
259
+ `bingo-light setup` 一键配好 MCP + Skill:
185
260
 
186
- **依赖:** Python 3.8+ / git 2.20+,没了。
261
+ | AI 工具 | MCP | Skill |
262
+ |---------|:---:|:-----:|
263
+ | Claude Code | ✅ | ✅ |
264
+ | Cursor | ✅ | — |
265
+ | Windsurf | ✅ | ✅ |
266
+ | VS Code / Copilot | ✅ | — |
267
+ | Cline | ✅ | ✅ |
268
+ | Roo Code | ✅ | ✅ |
269
+ | Zed | ✅ | — |
270
+ | Gemini CLI | ✅ | ✅ |
271
+ | Continue | — | ✅ |
272
+ | Amazon Q | ✅ | — |
187
273
 
188
- ## 功能特性
274
+ ---
189
275
 
190
- ### AI 侧
276
+ ## 人也能用
191
277
 
192
- | 功能 | 说明 |
193
- |------|------|
194
- | **MCP 服务器** | 29 个工具,初始化到冲突解决全覆盖 |
195
- | **`--json`** | 所有命令输出结构化 JSON |
196
- | **`--yes`** | 跳过一切确认,不需要 TTY |
197
- | **非 TTY 自适应** | 管道或子进程调用时自动静默 |
198
- | **`BINGO_DESCRIPTION`** | 环境变量设补丁描述 |
199
- | **`conflict-analyze`** | 冲突数据结构化:文件、双方代码、解决提示 |
200
- | **`conflict-resolve`** | MCP 直接写入解决内容,自动暂存 + 继续 rebase |
201
- | **Advisor 代理** | `contrib/agent.py` 自动监控、分析、安全时自动同步 |
278
+ 不用 AI 也完全没问题。同一套命令,人跑和 AI 跑效果一样。
202
279
 
203
- ### 人类侧
280
+ <details>
281
+ <summary><b>人类功能一览</b></summary>
204
282
 
205
283
  | 功能 | 说明 |
206
284
  |------|------|
207
- | **零依赖** | Python 3 + git,一行装完 |
208
- | **命名补丁** | 每个改动是独立的、有名字的 commit |
209
285
  | **一键同步** | `bingo-light sync`,补丁自动 rebase 到最新上游 |
286
+ | **命名补丁** | 每个改动是独立的、有名字的 commit |
210
287
  | **先试后跑** | `sync --dry-run` 临时分支预演,不碰真代码 |
211
- | **冲突记忆** | rerere 自动开,解一次就记住,再也不问 |
212
288
  | **秒级撤销** | `bingo-light undo` 恢复同步前状态 |
213
289
  | **冲突预警** | `status` 提前告诉你哪些文件会出事 |
214
290
  | **自检修复** | `doctor` 全面体检 + 试跑 rebase |
@@ -218,9 +294,10 @@ make install && bingo-light setup
218
294
  | **多仓管理** | `workspace` 统一管所有 Fork |
219
295
  | **补全** | bash / zsh / fish |
220
296
  | **通知推送** | Discord、Slack、Webhook,事件触发 |
221
- | **补丁元数据** | 标签、原因、过期时间、关联上游 PR |
222
297
  | **测试联动** | 同步后自动跑测试,挂了自动回滚 |
223
298
 
299
+ </details>
300
+
224
301
  ## 工作原理
225
302
 
226
303
  ```
@@ -250,7 +327,7 @@ make install && bingo-light setup
250
327
 
251
328
  ## MCP 服务器
252
329
 
253
- `mcp-server.py`,纯 Python 3,零依赖,stdio 传输,29 个工具,JSON-RPC 2.0。
330
+ `mcp-server.py`,纯 Python 3,零依赖,stdio 传输,35 个工具,JSON-RPC 2.0。
254
331
 
255
332
  运行 `bingo-light setup` 自动配置,或手动添加:
256
333
 
@@ -339,6 +416,12 @@ bingo-light conflict-analyze 分析 rebase 冲突
339
416
  bingo-light config get|set|list [key] [val] 管理配置
340
417
  bingo-light history 详细同步历史 + 映射
341
418
  bingo-light test 运行测试套件
419
+ bingo-light dep patch <package> [name] 补丁 npm/pip 依赖
420
+ bingo-light dep apply [package] 重新应用依赖补丁
421
+ bingo-light dep sync 更新后重新应用 + 冲突检测
422
+ bingo-light dep status 依赖补丁健康状态
423
+ bingo-light dep list 列出所有依赖补丁
424
+ bingo-light dep drop <package> [patch] 删除依赖补丁
342
425
  bingo-light workspace init|add|status|sync 多仓库管理
343
426
  bingo-light auto-sync 生成 GitHub Actions 工作流
344
427
  bingo-light version 打印版本
@@ -349,32 +432,14 @@ bingo-light help 打印帮助
349
432
 
350
433
  ## 集成指南
351
434
 
352
- ### Claude Code (MCP)
353
-
354
- MCP 配好后,Claude Code 全程接管:
355
-
356
- ```
357
- 你: "同步上游,冲突帮我修了。"
435
+ | 集成方式 | 适用场景 | 示例 |
436
+ |---------|---------|------|
437
+ | **MCP** (35 tools) | Claude Code / Cursor / Windsurf 等 | `bingo-light setup` 自动配 |
438
+ | **CLI `--json`** | 任何能跑 shell 的 AI | `bingo-light sync --json --yes` |
439
+ | **Skill** | Claude Code / Continue / Gemini 等 | `/bingo` 教 AI 用法 |
358
440
 
359
- Claude Code:
360
- 1. bingo_status(cwd) → 落后 47 commit,risk: core.c
361
- 2. bingo_sync(cwd, dry_run) → 预判 1 个冲突
362
- 3. bingo_sync(cwd) → rebase 卡在冲突
363
- 4. bingo_conflict_analyze() → 拿到双方代码 + 提示
364
- 5. 读两边,写合并结果
365
- 6. bingo_conflict_resolve(cwd, file, content) → 搞定
366
- 7. bingo_status(cwd) → 0 落后,补丁干净
367
- ```
368
-
369
- ### Aider / CLI 代理
370
-
371
- ```bash
372
- bingo-light status --json # 解析 Fork 状态
373
- bingo-light sync --yes # 非交互同步
374
- bingo-light conflict-analyze --json # 结构化冲突数据
375
- ```
376
-
377
- ### 自定义 Python 代理
441
+ <details>
442
+ <summary><b>自定义 Python 代理</b></summary>
378
443
 
379
444
  ```python
380
445
  import subprocess, json
@@ -393,9 +458,10 @@ if status["behind"] > 0:
393
458
  analysis = bingo("conflict-analyze")
394
459
  for c in analysis["conflicts"]:
395
460
  resolved = my_llm_resolve(c["ours"], c["theirs"], c["hint"])
396
- # 通过 CLI 或 MCP 写入解决内容
397
461
  ```
398
462
 
463
+ </details>
464
+
399
465
  ## 配置
400
466
 
401
467
  配置存在 `.bingolight`(git-config 格式),自动排除在版本控制外。
@@ -494,7 +560,7 @@ StGit 管栈但没 AI 集成、没 MCP、没 JSON 输出、没冲突预测。qui
494
560
  | 处理定制化改动 | **有** | **不行** | 手动 | 手动 | 手动 |
495
561
  | 冲突记忆 (rerere) | **自动** | 无 | 需手动启用 | 无 | 无 |
496
562
  | 冲突预测 | **有** | 无 | 无 | 无 | 无 |
497
- | AI/MCP 集成 | **29 个工具** | 无 | 无 | 无 | 无 |
563
+ | AI/MCP 集成 | **35 个工具** | 无 | 无 | 无 | 无 |
498
564
  | JSON 输出 | **所有命令** | 无 | 无 | 无 | 无 |
499
565
  | 非交互模式 | **原生支持** | 无 | 部分 | 部分 | 部分 |
500
566
  | 撤销同步 | **一条命令** | 无 | git reflog | 手动 | 手动 |
@@ -505,7 +571,7 @@ StGit 管栈但没 AI 集成、没 MCP、没 JSON 输出、没冲突预测。qui
505
571
  ```
506
572
  bingo-light CLI 入口(Python 3,零依赖)
507
573
  bingo_core/ 核心库包(全部业务逻辑)
508
- mcp-server.py MCP 服务器(零依赖 Python 3,29 个工具)
574
+ mcp-server.py MCP 服务器(零依赖 Python 3,35 个工具)
509
575
  contrib/agent.py Advisor 代理(监控 + 分析 + 安全时自动同步)
510
576
  contrib/tui.py 终端面板(curses TUI)
511
577
  install.sh 安装器(--yes 支持 CI,--help 查看选项)