bingo-light 2.0.0
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/LICENSE +21 -0
- package/README.md +522 -0
- package/README.zh-CN.md +534 -0
- package/bin/cli.js +46 -0
- package/bin/mcp.js +45 -0
- package/bingo-light +1094 -0
- package/bingo_core/__init__.py +77 -0
- package/bingo_core/__pycache__/__init__.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/_entry.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/config.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/exceptions.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/git.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/models.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/repo.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/setup.cpython-313.pyc +0 -0
- package/bingo_core/__pycache__/state.cpython-313.pyc +0 -0
- package/bingo_core/config.py +110 -0
- package/bingo_core/exceptions.py +48 -0
- package/bingo_core/git.py +194 -0
- package/bingo_core/models.py +37 -0
- package/bingo_core/repo.py +2376 -0
- package/bingo_core/setup.py +549 -0
- package/bingo_core/state.py +306 -0
- package/completions/bingo-light.bash +118 -0
- package/completions/bingo-light.fish +197 -0
- package/completions/bingo-light.zsh +169 -0
- package/mcp-server.py +788 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bingo-light contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<br>
|
|
3
|
+
<img src="docs/logo.svg" alt="bingo-light logo" width="200">
|
|
4
|
+
<br><br>
|
|
5
|
+
<strong>Fork maintenance for humans and AI agents.<br>One command to sync. Zero dependencies.</strong>
|
|
6
|
+
<br><br>
|
|
7
|
+
<b>English</b> | <a href="README.zh-CN.md">简体中文</a>
|
|
8
|
+
<br><br>
|
|
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
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
|
|
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
|
+
<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>
|
|
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
|
+
<img src="https://img.shields.io/badge/Dependencies-Zero-brightgreen.svg" alt="Zero deps">
|
|
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>
|
|
17
|
+
<br><br>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
GitHub's "Sync fork" button breaks the moment you have customizations. `git rebase` is a 6-step ritual. And none of it works from an AI agent.
|
|
23
|
+
|
|
24
|
+
**bingo-light fixes all three.**
|
|
25
|
+
|
|
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
|
+
|
|
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.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<img src="docs/demo.svg" alt="bingo-light demo" width="850">
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Install (pick one)
|
|
42
|
+
pip install bingo-light # Python
|
|
43
|
+
npm install -g bingo-light # Node.js
|
|
44
|
+
brew install DanOps-1/tap/bingo-light # Homebrew
|
|
45
|
+
|
|
46
|
+
# Point at upstream
|
|
47
|
+
cd your-forked-project
|
|
48
|
+
bingo-light init https://github.com/original/project.git
|
|
49
|
+
|
|
50
|
+
# Sync whenever you want -- patches rebase on top automatically
|
|
51
|
+
bingo-light sync
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That's it. Three commands and your fork stays in sync forever.
|
|
55
|
+
|
|
56
|
+
## Demo
|
|
57
|
+
|
|
58
|
+
### Basic workflow: init, patch, sync
|
|
59
|
+
|
|
60
|
+
<p align="center">
|
|
61
|
+
<img src="docs/demo.svg" alt="bingo-light basic demo" width="850">
|
|
62
|
+
</p>
|
|
63
|
+
|
|
64
|
+
### Conflict resolution: sync, analyze, resolve
|
|
65
|
+
|
|
66
|
+
<p align="center">
|
|
67
|
+
<img src="docs/demo-conflict.svg" alt="bingo-light conflict resolution demo" width="850">
|
|
68
|
+
</p>
|
|
69
|
+
|
|
70
|
+
> The AI calls `conflict-analyze --json`, reads the structured ours/theirs data, writes the merged file, and the rebase continues. No human needed.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Key Features
|
|
75
|
+
|
|
76
|
+
### For Humans
|
|
77
|
+
|
|
78
|
+
- :wrench: **Zero deps** -- just Python 3 + git. `pip install bingo-light` and go.
|
|
79
|
+
- :bookmark_tabs: **Named patch stack** -- each customization is one atomic, named commit. No more guessing which changes are yours.
|
|
80
|
+
- :zap: **One-command sync** -- `bingo-light sync` fetches upstream and rebases your patches on top. Done.
|
|
81
|
+
- :brain: **Conflict memory** -- git rerere auto-enabled. Resolve a conflict once, never resolve it again.
|
|
82
|
+
- :rewind: **Instant undo** -- `bingo-light undo` restores pre-sync state. No reflog spelunking.
|
|
83
|
+
- :crystal_ball: **Conflict prediction** -- `status` warns you about risky files before you sync.
|
|
84
|
+
- :test_tube: **Dry-run mode** -- `sync --dry-run` tests on a throwaway branch first.
|
|
85
|
+
- :stethoscope: **Built-in doctor** -- full diagnostic with test rebase to catch problems early.
|
|
86
|
+
- :package: **Export/Import patches** -- share as `.patch` files, quilt-compatible format.
|
|
87
|
+
- :robot: **Auto-sync CI** -- generates a GitHub Actions workflow with conflict alerting.
|
|
88
|
+
- :tv: **TUI dashboard** -- curses-based real-time monitoring via `contrib/tui.py`.
|
|
89
|
+
- :globe_with_meridians: **Multi-repo workspace** -- manage multiple forks from one place.
|
|
90
|
+
- :bell: **Notification hooks** -- Slack, Discord, webhooks on sync/conflict/test events.
|
|
91
|
+
- :label: **Patch metadata** -- tags, reasons, expiry dates, upstream PR tracking.
|
|
92
|
+
- :tab: **Shell completions** -- tab completion for bash, zsh, and fish.
|
|
93
|
+
|
|
94
|
+
### For AI Agents
|
|
95
|
+
|
|
96
|
+
- :electric_plug: **MCP server (29 tools)** -- full fork management from init through conflict resolution.
|
|
97
|
+
- :bar_chart: **`--json` on everything** -- every command returns structured JSON. Parse, don't scrape.
|
|
98
|
+
- :mute: **`--yes` flag** -- fully non-interactive. No TTY required. No prompts. Ever.
|
|
99
|
+
- :gear: **Auto-detect non-TTY** -- pipes and subprocesses trigger non-interactive mode automatically.
|
|
100
|
+
- :memo: **`BINGO_DESCRIPTION` env var** -- set patch descriptions without stdin.
|
|
101
|
+
- :mag: **`conflict-analyze --json`** -- structured conflict data: file, ours, theirs, resolution hints.
|
|
102
|
+
- :white_check_mark: **`conflict-resolve`** -- write resolved content via MCP, auto-stage, continue rebase. Zero manual intervention.
|
|
103
|
+
- :satellite: **Advisor agent** -- `contrib/agent.py` monitors drift, analyzes risk, auto-syncs when safe.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Installation
|
|
108
|
+
|
|
109
|
+
Install with any package manager, then run `bingo-light setup` to interactively configure MCP for your AI tools (Claude Code, Cursor, Windsurf, VS Code/Copilot, Zed, Gemini CLI, etc.).
|
|
110
|
+
|
|
111
|
+
### pip / pipx
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pip install bingo-light # or: pipx install bingo-light
|
|
115
|
+
bingo-light setup # interactive — pick which AI tools to configure
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### npm / npx
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npm install -g bingo-light # global install
|
|
122
|
+
bingo-light setup
|
|
123
|
+
|
|
124
|
+
# Or use npx — no install needed:
|
|
125
|
+
npx bingo-light setup
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
MCP clients can use npx directly:
|
|
129
|
+
```json
|
|
130
|
+
{"command": "npx", "args": ["-y", "bingo-light-mcp"]}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Homebrew
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
brew install DanOps-1/tap/bingo-light
|
|
137
|
+
bingo-light setup
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Docker
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# CLI
|
|
144
|
+
docker run --rm -v "$PWD:/repo" -w /repo ghcr.io/danops-1/bingo-light status
|
|
145
|
+
|
|
146
|
+
# MCP server (stdio transport)
|
|
147
|
+
docker run --rm -i -v "$PWD:/repo" -w /repo ghcr.io/danops-1/bingo-light mcp-server.py
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Shell installer
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
curl -fsSL https://raw.githubusercontent.com/DanOps-1/bingo-light/main/install.sh | sh
|
|
154
|
+
|
|
155
|
+
# Non-interactive (CI / Docker)
|
|
156
|
+
curl -fsSL .../install.sh | sh -s -- --yes
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### From source
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
git clone https://github.com/DanOps-1/bingo-light.git
|
|
163
|
+
cd bingo-light
|
|
164
|
+
make install && bingo-light setup
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Requirements:** Python 3.8+, git 2.20+. Zero pip dependencies.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## How It Works
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
upstream (github.com/original/project)
|
|
175
|
+
|
|
|
176
|
+
| git fetch
|
|
177
|
+
v
|
|
178
|
+
upstream-tracking ──────── exact mirror of upstream, never touched
|
|
179
|
+
|
|
|
180
|
+
| git rebase
|
|
181
|
+
v
|
|
182
|
+
bingo-patches ──────────── your customizations stacked here
|
|
183
|
+
|
|
|
184
|
+
+── [bl] custom-scheduler: O(1) task scheduling
|
|
185
|
+
+── [bl] perf-monitoring: eBPF tracing hooks
|
|
186
|
+
+── [bl] fix-logging: structured JSON logs
|
|
187
|
+
|
|
|
188
|
+
v
|
|
189
|
+
HEAD (your working fork)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Sync flow:** fetch upstream, fast-forward the tracking branch, rebase your patches on top. Your patches always sit cleanly on the latest upstream.
|
|
193
|
+
|
|
194
|
+
**Conflict memory:** `init` auto-enables git rerere. Resolve a conflict once and git remembers the resolution. Next sync applies it automatically. bingo-light detects auto-resolved conflicts and continues the rebase without stopping.
|
|
195
|
+
|
|
196
|
+
**AI conflict flow:** rebase hits a conflict, the AI calls `conflict-analyze` for structured data (ours/theirs/hints per file), writes the resolution via `conflict-resolve`, and rebase continues. No human in the loop.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## For AI Agents
|
|
201
|
+
|
|
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
|
+
|
|
204
|
+
### MCP setup -- Claude Code
|
|
205
|
+
|
|
206
|
+
Add to `.mcp.json` in your project root or `~/.claude/settings.json`:
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"mcpServers": {
|
|
211
|
+
"bingo-light": {
|
|
212
|
+
"command": "python3",
|
|
213
|
+
"args": ["/path/to/bingo-light/mcp-server.py"]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### MCP setup -- Claude Desktop
|
|
220
|
+
|
|
221
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{
|
|
225
|
+
"mcpServers": {
|
|
226
|
+
"bingo-light": {
|
|
227
|
+
"command": "python3",
|
|
228
|
+
"args": ["/path/to/bingo-light/mcp-server.py"]
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Any MCP client** (VS Code Copilot, Cursor, custom agents): connect via stdio to `python3 mcp-server.py`.
|
|
235
|
+
|
|
236
|
+
### 29 MCP Tools
|
|
237
|
+
|
|
238
|
+
| Tool | Purpose |
|
|
239
|
+
|------|---------|
|
|
240
|
+
| `bingo_init` | Initialize fork tracking |
|
|
241
|
+
| `bingo_status` | Fork health: drift, patches, conflict risk |
|
|
242
|
+
| `bingo_sync` | Fetch upstream + rebase patches |
|
|
243
|
+
| `bingo_undo` | Revert to pre-sync state |
|
|
244
|
+
| `bingo_patch_new` | Create a named patch |
|
|
245
|
+
| `bingo_patch_list` | List patch stack with stats |
|
|
246
|
+
| `bingo_patch_show` | Show patch diff |
|
|
247
|
+
| `bingo_patch_drop` | Remove a patch |
|
|
248
|
+
| `bingo_patch_export` | Export as `.patch` files |
|
|
249
|
+
| `bingo_patch_import` | Import `.patch` files |
|
|
250
|
+
| `bingo_patch_meta` | Get/set patch metadata |
|
|
251
|
+
| `bingo_patch_squash` | Merge two patches into one |
|
|
252
|
+
| `bingo_patch_reorder` | Reorder patches non-interactively |
|
|
253
|
+
| `bingo_doctor` | Full diagnostic with test rebase |
|
|
254
|
+
| `bingo_diff` | Combined diff vs upstream |
|
|
255
|
+
| `bingo_auto_sync` | Generate GitHub Actions workflow |
|
|
256
|
+
| `bingo_conflict_analyze` | Structured conflict data for AI resolution |
|
|
257
|
+
| `bingo_conflict_resolve` | Write resolution, stage, continue rebase |
|
|
258
|
+
| `bingo_config` | Get/set configuration |
|
|
259
|
+
| `bingo_history` | Sync history with hash mappings |
|
|
260
|
+
| `bingo_test` | Run configured test suite |
|
|
261
|
+
| `bingo_workspace_status` | Multi-repo workspace overview |
|
|
262
|
+
| `bingo_patch_edit` | Amend an existing patch |
|
|
263
|
+
| `bingo_workspace_init` | Initialize multi-repo workspace |
|
|
264
|
+
| `bingo_workspace_add` | Add a repo to workspace |
|
|
265
|
+
| `bingo_workspace_sync` | Sync all workspace repos |
|
|
266
|
+
| `bingo_workspace_list` | List workspace repos |
|
|
267
|
+
|
|
268
|
+
### JSON examples
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Fork status (AI-friendly)
|
|
272
|
+
bingo-light status --json
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"ok": true,
|
|
278
|
+
"upstream_url": "https://github.com/torvalds/linux.git",
|
|
279
|
+
"behind": 47,
|
|
280
|
+
"patch_count": 2,
|
|
281
|
+
"patches": [
|
|
282
|
+
{"name": "custom-scheduler", "hash": "a3f7c21", "subject": "O(1) task scheduling", "files": 3},
|
|
283
|
+
{"name": "perf-monitoring", "hash": "b8e2d4f", "subject": "eBPF tracing hooks", "files": 5}
|
|
284
|
+
],
|
|
285
|
+
"conflict_risk": ["kernel/sched/core.c"]
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Conflict analysis (structured data for AI resolution)
|
|
291
|
+
bingo-light conflict-analyze --json
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
```json
|
|
295
|
+
{
|
|
296
|
+
"rebase_in_progress": true,
|
|
297
|
+
"current_patch": "custom-scheduler",
|
|
298
|
+
"conflicts": [
|
|
299
|
+
{
|
|
300
|
+
"file": "kernel/sched/core.c",
|
|
301
|
+
"conflict_count": 2,
|
|
302
|
+
"ours": "... upstream version ...",
|
|
303
|
+
"theirs": "... your patch version ...",
|
|
304
|
+
"hint": "Upstream refactored scheduler core; patch needs to target new structure."
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### End-to-end AI workflow
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
User: "Sync my fork and fix any conflicts."
|
|
314
|
+
|
|
315
|
+
AI Agent:
|
|
316
|
+
1. bingo_status(cwd) -> 47 behind, risk: core.c
|
|
317
|
+
2. bingo_sync(cwd, dry_run=true) -> 1 conflict predicted
|
|
318
|
+
3. bingo_sync(cwd) -> rebase stops at conflict
|
|
319
|
+
4. bingo_conflict_analyze(cwd) -> structured ours/theirs/hints
|
|
320
|
+
5. AI reads both versions, generates merge
|
|
321
|
+
6. bingo_conflict_resolve(cwd, file, content) -> resolved, rebase continues
|
|
322
|
+
7. bingo_status(cwd) -> 0 behind, all patches clean
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### CLI integration (Aider, custom agents)
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
bingo-light status --json # Parse fork state
|
|
329
|
+
bingo-light sync --yes # Non-interactive sync
|
|
330
|
+
bingo-light conflict-analyze --json # Structured conflict data
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
```python
|
|
334
|
+
import subprocess, json
|
|
335
|
+
|
|
336
|
+
def bingo(cmd, cwd="/path/to/repo"):
|
|
337
|
+
result = subprocess.run(
|
|
338
|
+
["bingo-light"] + cmd.split() + ["--json", "--yes"],
|
|
339
|
+
cwd=cwd, capture_output=True, text=True
|
|
340
|
+
)
|
|
341
|
+
return json.loads(result.stdout)
|
|
342
|
+
|
|
343
|
+
status = bingo("status")
|
|
344
|
+
if status["behind"] > 0:
|
|
345
|
+
result = bingo("sync")
|
|
346
|
+
if result.get("conflicts"):
|
|
347
|
+
analysis = bingo("conflict-analyze")
|
|
348
|
+
# AI resolves each conflict...
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Command Reference
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
bingo-light init <upstream-url> [branch] Set up upstream tracking
|
|
357
|
+
bingo-light sync [--dry-run] [--force] Sync with upstream
|
|
358
|
+
bingo-light sync --test Sync + run tests, undo on failure
|
|
359
|
+
bingo-light undo Revert to pre-sync state
|
|
360
|
+
bingo-light status Fork health + conflict prediction
|
|
361
|
+
bingo-light diff Combined patch diff vs upstream
|
|
362
|
+
bingo-light doctor Full diagnostic
|
|
363
|
+
bingo-light log Sync history
|
|
364
|
+
bingo-light history Detailed sync history with hash mappings
|
|
365
|
+
bingo-light patch new <name> Create named patch from staged changes
|
|
366
|
+
bingo-light patch list [-v] List patch stack
|
|
367
|
+
bingo-light patch show <name|index> Show patch diff
|
|
368
|
+
bingo-light patch edit <name|index> Amend a patch (stage changes first)
|
|
369
|
+
bingo-light patch drop <name|index> Remove a patch
|
|
370
|
+
bingo-light patch reorder [--order "3,1,2"] Reorder patches
|
|
371
|
+
bingo-light patch export [dir] Export as .patch files
|
|
372
|
+
bingo-light patch import <file|dir> Import .patch files
|
|
373
|
+
bingo-light patch squash <idx1> <idx2> Merge two patches
|
|
374
|
+
bingo-light patch meta <name> [key] [value] Get/set patch metadata
|
|
375
|
+
bingo-light conflict-analyze Structured conflict data for AI
|
|
376
|
+
bingo-light config get|set|list [key] [val] Manage configuration
|
|
377
|
+
bingo-light test Run configured test suite
|
|
378
|
+
bingo-light workspace init|add|status|sync Multi-repo management
|
|
379
|
+
bingo-light auto-sync Generate GitHub Actions workflow
|
|
380
|
+
bingo-light version Print version
|
|
381
|
+
bingo-light help Show usage
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Global flags:** `--json` (structured output) | `--yes` / `-y` (skip all prompts)
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Why not just...
|
|
389
|
+
|
|
390
|
+
<details>
|
|
391
|
+
<summary><b>...click GitHub's "Sync fork" button?</b></summary>
|
|
392
|
+
<br>
|
|
393
|
+
|
|
394
|
+
It only does fast-forward. The moment you have any customizations (commits on your fork that aren't in upstream), it either refuses or creates a merge commit that buries your changes. It has no concept of a patch stack, no conflict memory, and no API for AI agents.
|
|
395
|
+
</details>
|
|
396
|
+
|
|
397
|
+
<details>
|
|
398
|
+
<summary><b>...use <code>git rebase</code> manually?</b></summary>
|
|
399
|
+
<br>
|
|
400
|
+
|
|
401
|
+
You can. It takes 6 steps: fetch, checkout tracking branch, pull, checkout patches branch, rebase, push. You need to remember which branch is which, manually enable rerere, and hope you don't mess up the reflog if something goes wrong. bingo-light wraps all of this into `bingo-light sync` with automatic undo, conflict prediction, and structured output.
|
|
402
|
+
</details>
|
|
403
|
+
|
|
404
|
+
<details>
|
|
405
|
+
<summary><b>...use StGit / quilt / TopGit?</b></summary>
|
|
406
|
+
<br>
|
|
407
|
+
|
|
408
|
+
StGit (649 stars) manages patch stacks but has no AI integration, no MCP server, no JSON output, and no conflict prediction. quilt operates outside git entirely -- no rerere, no history. TopGit is effectively abandoned. None of them were designed for the AI-agent era.
|
|
409
|
+
</details>
|
|
410
|
+
|
|
411
|
+
## Comparison
|
|
412
|
+
|
|
413
|
+
| | **bingo-light** | GitHub Sync | git rebase | quilt | StGit |
|
|
414
|
+
|---|:---:|:---:|:---:|:---:|:---:|
|
|
415
|
+
| Named patch stack | **Yes** | No | No | Yes | Yes |
|
|
416
|
+
| One-command sync | **Yes** | Click only | No (6 steps) | No | No |
|
|
417
|
+
| Handles customizations | **Yes** | **No** | Manual | Manual | Manual |
|
|
418
|
+
| Conflict memory (rerere) | **Auto** | No | Manual | No | No |
|
|
419
|
+
| Conflict prediction | **Yes** | No | No | No | No |
|
|
420
|
+
| AI / MCP integration | **29 tools** | No | No | No | No |
|
|
421
|
+
| JSON output | **All commands** | No | No | No | No |
|
|
422
|
+
| Non-interactive mode | **Native** | No | Partial | Partial | Partial |
|
|
423
|
+
| Undo sync | **One command** | No | git reflog | Manual | Manual |
|
|
424
|
+
| Install | One command | Built-in | Built-in | Package mgr | Package mgr |
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
## FAQ
|
|
429
|
+
|
|
430
|
+
<details>
|
|
431
|
+
<summary><b>Why not just <code>git rebase</code>?</b></summary>
|
|
432
|
+
<br>
|
|
433
|
+
|
|
434
|
+
You can. bingo-light automates everything around it: tracking the upstream remote, maintaining a dedicated patch branch, enabling rerere, predicting conflicts before you sync, and exposing structured output for automation. For a one-off rebase it's overkill. For ongoing fork maintenance with 3+ patches across months of upstream drift, it saves serious time and eliminates an entire class of mistakes.
|
|
435
|
+
</details>
|
|
436
|
+
|
|
437
|
+
<details>
|
|
438
|
+
<summary><b>Can I use this on an existing fork?</b></summary>
|
|
439
|
+
<br>
|
|
440
|
+
|
|
441
|
+
Yes. Run `bingo-light init <upstream-url>` in your fork. Convert your existing changes into named patches with `bingo-light patch new <name>`. The tool works with any standard git repository -- it doesn't care how you got here.
|
|
442
|
+
</details>
|
|
443
|
+
|
|
444
|
+
<details>
|
|
445
|
+
<summary><b>Is this only for AI agents?</b></summary>
|
|
446
|
+
<br>
|
|
447
|
+
|
|
448
|
+
No. The CLI is designed for humans first. `bingo-light sync` is the same command whether you run it or an AI does. The AI-native features (`--json`, `--yes`, MCP server) are purely additive -- without them you get normal, human-readable output with colors and progress indicators.
|
|
449
|
+
</details>
|
|
450
|
+
|
|
451
|
+
<details>
|
|
452
|
+
<summary><b>How does conflict memory work?</b></summary>
|
|
453
|
+
<br>
|
|
454
|
+
|
|
455
|
+
bingo-light enables git's `rerere` (reuse recorded resolution) on `init`. When you resolve a conflict, git records the resolution. Next time the exact same conflict appears during sync, it's applied automatically. bingo-light detects when rerere has auto-resolved all conflicts and continues the rebase without stopping. You solve each conflict exactly once.
|
|
456
|
+
</details>
|
|
457
|
+
|
|
458
|
+
<details>
|
|
459
|
+
<summary><b>What if sync goes wrong?</b></summary>
|
|
460
|
+
<br>
|
|
461
|
+
|
|
462
|
+
Run `bingo-light undo`. It restores your patches branch to exactly where it was before the sync. This works via git reflog, so it's reliable even after complex rebases. You can also use `sync --dry-run` to test on a throwaway branch first, or `sync --test` to auto-undo if your test suite fails after sync.
|
|
463
|
+
</details>
|
|
464
|
+
|
|
465
|
+
<details>
|
|
466
|
+
<summary><b>Does it work with GitHub / GitLab / Bitbucket?</b></summary>
|
|
467
|
+
<br>
|
|
468
|
+
|
|
469
|
+
Yes. bingo-light uses standard git operations (fetch, rebase, push). It works with any git remote on any platform. The `auto-sync` command generates a GitHub Actions workflow specifically, but the core tool is completely platform-agnostic.
|
|
470
|
+
</details>
|
|
471
|
+
|
|
472
|
+
<details>
|
|
473
|
+
<summary><b>How is this different from <code>git format-patch</code> / quilt?</b></summary>
|
|
474
|
+
<br>
|
|
475
|
+
|
|
476
|
+
`git format-patch` exports patches but doesn't manage them as a living stack. quilt manages patch stacks but operates outside git -- no conflict resolution, no rerere, no history. bingo-light keeps patches as real git commits so you get full git history, proper conflict resolution, and automatic rerere, while still supporting export/import in quilt-compatible `.patch` format. Best of both worlds.
|
|
477
|
+
</details>
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
## Project Ecosystem
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
bingo-light CLI tool (Python 3, zero deps)
|
|
485
|
+
bingo_core/ Core library package (all business logic)
|
|
486
|
+
mcp-server.py MCP server (zero-dep Python 3, 29 tools, JSON-RPC 2.0)
|
|
487
|
+
contrib/agent.py Advisor agent (monitors drift, auto-syncs when safe)
|
|
488
|
+
contrib/tui.py Terminal dashboard (curses TUI, real-time monitoring)
|
|
489
|
+
install.sh Installer (--yes for CI, --help for options)
|
|
490
|
+
completions/ Shell completions (bash / zsh / fish)
|
|
491
|
+
contrib/hooks/ Notification hook examples (Slack / Discord / Webhook)
|
|
492
|
+
tests/test.sh Test suite (70 tests)
|
|
493
|
+
docs/ Documentation + demo SVG
|
|
494
|
+
docs/llms.txt Complete LLM-consumable reference
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Documentation
|
|
500
|
+
|
|
501
|
+
- [Getting Started](docs/getting-started.md) -- 5-minute quickstart guide
|
|
502
|
+
- [Concepts](docs/concepts.md) -- branch model, patch stack, sync flow
|
|
503
|
+
- [Changelog](CHANGELOG.md) -- version history
|
|
504
|
+
- [Security](.github/SECURITY.md) -- security model and vulnerability reporting
|
|
505
|
+
|
|
506
|
+
## Contributing
|
|
507
|
+
|
|
508
|
+
Pure Python, zero dependencies, no build step. If you can read Python, you can contribute.
|
|
509
|
+
|
|
510
|
+
```bash
|
|
511
|
+
git clone https://github.com/DanOps-1/bingo-light.git
|
|
512
|
+
cd bingo-light
|
|
513
|
+
make test # core test suite
|
|
514
|
+
make test-all # all 250 tests (core + fuzz + edge + MCP + unit)
|
|
515
|
+
make lint # python syntax + flake8 + shellcheck
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
519
|
+
|
|
520
|
+
## License
|
|
521
|
+
|
|
522
|
+
[MIT](LICENSE) -- do whatever you want.
|