bugzero 0.0.3 → 0.0.5
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/.turbo/turbo-build.log +6 -4
- package/README.md +189 -74
- package/dist/chunk-4ANZDGVD.js +426 -0
- package/dist/dist-FQYNA36C.js +4 -0
- package/dist/index.js +234 -510
- package/package.json +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> bugzero@0.0.
|
|
2
|
+
> bugzero@0.0.4 build D:\WD projects\OpsPilot\packages\cli
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist\index.js
|
|
11
|
-
[32mESM[39m
|
|
10
|
+
[32mESM[39m [1mdist\index.js [22m[32m31.38 KB[39m
|
|
11
|
+
[32mESM[39m [1mdist\chunk-4ANZDGVD.js [22m[32m16.11 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist\dist-FQYNA36C.js [22m[32m85.00 B[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 133ms
|
|
12
14
|
[34mDTS[39m Build start
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 1828ms
|
|
14
16
|
[32mDTS[39m [1mdist\index.d.ts [22m[32m20.00 B[39m
|
package/README.md
CHANGED
|
@@ -1,143 +1,258 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BugZero
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/bugzero)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org)
|
|
5
6
|
[](https://pnpm.io/)
|
|
6
7
|
[](https://github.com/Saksham1800t)
|
|
7
8
|
|
|
8
|
-
**BugZero** is an autonomous, AI-powered
|
|
9
|
+
**BugZero** is an autonomous, AI-powered CLI tool for automatic build error detection and repair. It runs your build pipeline, parses compiler and linter output, invokes an LLM to generate a surgical code fix, applies it safely with a backup, and re-runs validation — looping until your project builds successfully or the attempt limit is reached.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Built for developers who want zero-downtime repair cycles, automated CI/CD recovery, and production-grade error resolution without manual debugging.
|
|
11
12
|
|
|
12
13
|
---
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
## Why BugZero?
|
|
16
|
+
|
|
17
|
+
Modern applications fail at build and deployment time for reasons that are repetitive, predictable, and ultimately fixable by a knowledgeable agent. BugZero bridges the gap between raw compiler output and working code — automatically.
|
|
18
|
+
|
|
19
|
+
- **No more debugging the same TypeScript error twice.** The agent reads the stack trace, finds the file, generates the fix, and verifies it.
|
|
20
|
+
- **Safe by design.** Every file modified gets a `.opspilot.bak` backup before any change is applied.
|
|
21
|
+
- **Model agnostic.** Works with DeepSeek, Claude, Gemini, GPT-4o, Llama, or any model available on OpenRouter.
|
|
22
|
+
- **Feedback loop included.** The LangGraph state machine retries intelligently until the build passes or the max attempts threshold is hit.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## How it Works
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
bugzero rescue
|
|
30
|
+
|
|
|
31
|
+
v
|
|
32
|
+
Run Build + Lint + Tests
|
|
33
|
+
|
|
|
34
|
+
v
|
|
35
|
+
Any failures? ---- No ---> Build already passing. Exit cleanly.
|
|
36
|
+
|
|
|
37
|
+
Yes
|
|
38
|
+
|
|
|
39
|
+
v
|
|
40
|
+
Capture and parse error logs
|
|
41
|
+
|
|
|
42
|
+
v
|
|
43
|
+
Prompt selected LLM via LangGraph Agent
|
|
44
|
+
|
|
|
45
|
+
v
|
|
46
|
+
Parse structured fix suggestion (JSON)
|
|
47
|
+
|
|
|
48
|
+
v
|
|
49
|
+
Apply search-and-replace patch (with .bak backup)
|
|
50
|
+
|
|
|
51
|
+
v
|
|
52
|
+
Re-run build to verify the fix
|
|
53
|
+
|
|
|
54
|
+
v
|
|
55
|
+
Build fixed? --- Yes ---> Print fix details. Exit success.
|
|
56
|
+
|
|
|
57
|
+
No
|
|
58
|
+
|
|
|
59
|
+
v
|
|
60
|
+
Max attempts reached? -- Yes ---> Exit with failure logs.
|
|
61
|
+
|
|
|
62
|
+
No
|
|
63
|
+
|
|
|
64
|
+
+-------------------> Prompt LLM again (next attempt)
|
|
31
65
|
```
|
|
32
66
|
|
|
33
67
|
---
|
|
34
68
|
|
|
35
|
-
##
|
|
69
|
+
## Key Features
|
|
36
70
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
71
|
+
| Feature | Description |
|
|
72
|
+
|---|---|
|
|
73
|
+
| Autonomous repair loop | Runs analyze, patch, verify in a stateful LangGraph graph |
|
|
74
|
+
| Multi-model support | DeepSeek, Claude, GPT-4o, Gemini, Llama via OpenRouter |
|
|
75
|
+
| Framework detection | Automatically identifies your project's tooling setup |
|
|
76
|
+
| Safe file patching | Every modified file receives a `.opspilot.bak` backup |
|
|
77
|
+
| Error type parsing | Parses TypeScript, ESLint, and Jest error formats |
|
|
78
|
+
| Dry-run mode | Analyze and report without writing any files |
|
|
79
|
+
| Local model config | Save preferred model to `.bugzerorc` per project |
|
|
42
80
|
|
|
43
81
|
---
|
|
44
82
|
|
|
45
|
-
##
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
Install globally from the NPM registry:
|
|
46
86
|
|
|
47
|
-
### 1. Global Installation
|
|
48
|
-
Install `bugzero` globally from NPM:
|
|
49
87
|
```bash
|
|
50
88
|
npm install -g bugzero
|
|
51
89
|
```
|
|
52
90
|
|
|
53
|
-
|
|
54
|
-
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Setup
|
|
94
|
+
|
|
95
|
+
BugZero requires an [OpenRouter](https://openrouter.ai) API key to call AI models. Set it as an environment variable before running any command.
|
|
55
96
|
|
|
56
|
-
**
|
|
97
|
+
**Linux / macOS:**
|
|
57
98
|
```bash
|
|
58
99
|
export OPENROUTER_API_KEY="your_openrouter_api_key_here"
|
|
59
100
|
```
|
|
60
101
|
|
|
61
|
-
**
|
|
102
|
+
**Windows (PowerShell):**
|
|
62
103
|
```powershell
|
|
63
104
|
$env:OPENROUTER_API_KEY="your_openrouter_api_key_here"
|
|
64
105
|
```
|
|
65
106
|
|
|
107
|
+
**Or** create a `.env` file in the project root you are targeting:
|
|
108
|
+
```env
|
|
109
|
+
OPENROUTER_API_KEY=your_openrouter_api_key_here
|
|
110
|
+
```
|
|
111
|
+
|
|
66
112
|
---
|
|
67
113
|
|
|
68
|
-
##
|
|
114
|
+
## Commands
|
|
69
115
|
|
|
70
|
-
|
|
116
|
+
### `bugzero hunt`
|
|
117
|
+
Run build, lint, and test checks. Reports all failures without modifying any files.
|
|
71
118
|
|
|
72
|
-
### 1. Hunt for Bugs (Dry-Run / Safe Check)
|
|
73
|
-
Run build, lint, and test checks to report error diagnostics without modifying any files.
|
|
74
119
|
```bash
|
|
75
120
|
bugzero hunt --path /path/to/your/project
|
|
76
121
|
```
|
|
77
122
|
|
|
78
|
-
###
|
|
79
|
-
Run the AI repair loop
|
|
123
|
+
### `bugzero rescue`
|
|
124
|
+
Run the full AI-powered repair loop. Detects build failures, generates precise code patches, applies them, and verifies the result.
|
|
125
|
+
|
|
80
126
|
```bash
|
|
81
127
|
bugzero rescue --path /path/to/your/project
|
|
82
128
|
```
|
|
83
129
|
|
|
84
|
-
|
|
85
|
-
|
|
130
|
+
Options:
|
|
131
|
+
|
|
132
|
+
| Flag | Short | Default | Description |
|
|
133
|
+
|---|---|---|---|
|
|
134
|
+
| `--path <dir>` | `-p` | `.` | Path to the target project |
|
|
135
|
+
| `--max-attempts <n>` | `-n` | `3` | Maximum AI fix iterations before giving up |
|
|
136
|
+
| `--dry-run` | | `false` | Analyze only — no files will be written |
|
|
137
|
+
|
|
138
|
+
### `bugzero vibe`
|
|
139
|
+
Interactively select which AI model to use. Fetches the current model list from OpenRouter, lets you pick one, and saves the selection to a local `.bugzerorc` config file.
|
|
140
|
+
|
|
86
141
|
```bash
|
|
87
142
|
bugzero vibe
|
|
88
143
|
```
|
|
89
144
|
|
|
90
|
-
|
|
145
|
+
Supported models (curated list, plus custom entry):
|
|
146
|
+
- DeepSeek V3 / DeepSeek R1
|
|
147
|
+
- Anthropic Claude 3.5 Sonnet
|
|
148
|
+
- Google Gemini 2.5 Pro / Flash
|
|
149
|
+
- OpenAI GPT-4o
|
|
150
|
+
- Meta Llama 3.3 Instruct
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Configuration
|
|
155
|
+
|
|
156
|
+
BugZero reads a `.bugzerorc` JSON file in your target project directory to pick up model preferences:
|
|
91
157
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"model": "deepseek/deepseek-chat"
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
This file is created automatically when you run `bugzero vibe`.
|
|
97
165
|
|
|
98
166
|
---
|
|
99
167
|
|
|
100
|
-
##
|
|
168
|
+
## Development Setup
|
|
101
169
|
|
|
102
|
-
|
|
170
|
+
Clone the repository and install dependencies. This project uses a pnpm monorepo managed by Turborepo.
|
|
103
171
|
|
|
104
172
|
### Prerequisites
|
|
105
|
-
|
|
106
|
-
|
|
173
|
+
- Node.js 18 or later
|
|
174
|
+
- pnpm
|
|
175
|
+
|
|
176
|
+
### Install
|
|
107
177
|
|
|
108
|
-
### Installation
|
|
109
|
-
Clone the repository, go into the workspace root, and run:
|
|
110
178
|
```bash
|
|
111
179
|
pnpm install
|
|
112
180
|
```
|
|
113
181
|
|
|
114
|
-
###
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
182
|
+
### Build all packages
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pnpm build
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Run commands locally without installing globally
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
pnpm hunt --path ./demo-project
|
|
192
|
+
pnpm rescue --path ./demo-project
|
|
193
|
+
pnpm vibe
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Monorepo package structure
|
|
197
|
+
|
|
198
|
+
| Package | Role |
|
|
199
|
+
|---|---|
|
|
200
|
+
| `packages/cli` | CLI entrypoint (Commander) |
|
|
201
|
+
| `packages/core` | Orchestrates build and fix flow |
|
|
202
|
+
| `packages/agents` | LangGraph state machine (analyze, patch, verify) |
|
|
203
|
+
| `packages/ai-provider` | OpenRouter HTTP client |
|
|
204
|
+
| `packages/analyzers` | Runs build/lint/test and parses output |
|
|
205
|
+
| `packages/patcher` | Applies search-and-replace patches with backup |
|
|
206
|
+
| `packages/prompts` | LLM prompt templates |
|
|
207
|
+
| `packages/config` | Env loading and local `.bugzerorc` config store |
|
|
208
|
+
| `packages/shared` | Shared TypeScript types |
|
|
125
209
|
|
|
126
210
|
---
|
|
127
211
|
|
|
128
|
-
##
|
|
212
|
+
## Error Handling
|
|
129
213
|
|
|
130
|
-
|
|
214
|
+
BugZero provides clear, actionable output for common failure modes:
|
|
131
215
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
216
|
+
| Error | Message |
|
|
217
|
+
|---|---|
|
|
218
|
+
| Invalid API key (401) | Prompts you to check your `OPENROUTER_API_KEY` |
|
|
219
|
+
| Rate limit exceeded (429) | Prompts you to check your OpenRouter credit balance |
|
|
220
|
+
| Model not found | Displays the invalid model ID and suggests running `bugzero vibe` |
|
|
221
|
+
| Patch not applied | Reports exact mismatch between AI suggestion and file content |
|
|
222
|
+
| Max attempts reached | Exits cleanly with the last error log for manual review |
|
|
136
223
|
|
|
137
224
|
---
|
|
138
225
|
|
|
139
|
-
##
|
|
226
|
+
## Contributing
|
|
227
|
+
|
|
228
|
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
229
|
+
|
|
230
|
+
1. Fork the repository
|
|
231
|
+
2. Create your feature branch (`git checkout -b feature/my-feature`)
|
|
232
|
+
3. Commit your changes (`git commit -m 'Add my feature'`)
|
|
233
|
+
4. Push to the branch (`git push origin feature/my-feature`)
|
|
234
|
+
5. Open a Pull Request
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Author
|
|
239
|
+
|
|
240
|
+
**Saksham Agarwal**
|
|
241
|
+
|
|
242
|
+
- GitHub: [@Saksham1800t](https://github.com/Saksham1800t)
|
|
243
|
+
- LinkedIn: [Saksham Agarwal](https://www.linkedin.com/in/saksham-agarwal-/)
|
|
244
|
+
- Email: [sakshamagarwal0507@gmail.com](mailto:sakshamagarwal0507@gmail.com)
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Support
|
|
249
|
+
|
|
250
|
+
If BugZero saved you debugging hours in production or deployment pipelines, consider buying the author a coffee.
|
|
251
|
+
|
|
252
|
+
[](https://www.buymeacoffee.com/saksham_)
|
|
253
|
+
|
|
254
|
+
---
|
|
140
255
|
|
|
141
|
-
|
|
256
|
+
## License
|
|
142
257
|
|
|
143
|
-
|
|
258
|
+
MIT — see [LICENSE](LICENSE) for details.
|