error-solution-ai-buddy 1.0.0 → 1.0.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.md +117 -234
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,292 +1,175 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# errbuddy
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-

|
|
5
|
+
**Plain-English explanations for errors, right in your terminal.**
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Stop copying stack traces into a browser. Prefix your command with `errbuddy` and get *what* went wrong, *why*, and *how to fix it* — from an AI model that runs on your own machine.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
5. Go back to terminal
|
|
17
|
-
6. Forget what you were doing
|
|
9
|
+
[](https://www.npmjs.com/package/error-solution-ai-buddy)
|
|
10
|
+
[](https://www.npmjs.com/package/error-solution-ai-buddy)
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
[](https://github.com/sithija-jayasinghe/solution-ai-buddy-v1/blob/main/error-solution-ai-buddy/LICENSE)
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
</div>
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
<p align="center">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/sithija-jayasinghe/solution-ai-buddy-v1/main/error-solution-ai-buddy/docs/demo.gif" alt="errbuddy running node app.js: a TypeError appears, followed by an explanation of what went wrong, why, and how to fix it" width="760">
|
|
19
|
+
</p>
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
TypeError: Cannot read properties of undefined (reading 'map')
|
|
27
|
-
at app.js:12:5
|
|
28
|
-
|
|
29
|
-
╭─ 🤖 Error Buddy Explanation: ─────────────────────────────────────╮
|
|
30
|
-
│ │
|
|
31
|
-
│ 📘 What is this? │
|
|
32
|
-
│ You tried to use `.map()` on a variable that is undefined. │
|
|
33
|
-
│ │
|
|
34
|
-
│ ❓ Why it happens? │
|
|
35
|
-
│ The data you expected (probably from an API) wasn't available. │
|
|
36
|
-
│ │
|
|
37
|
-
│ ✅ How to fix it: │
|
|
38
|
-
│ Check if the variable exists before calling `.map()`. │
|
|
39
|
-
│ │
|
|
40
|
-
│ 💡 Example: │
|
|
41
|
-
│ if (data) { │
|
|
42
|
-
│ data.map(...) │
|
|
43
|
-
│ } │
|
|
44
|
-
│ │
|
|
45
|
-
╰────────────────────────────────────────────────────────────────────╯
|
|
46
|
-
```
|
|
21
|
+
## Why errbuddy
|
|
22
|
+
|
|
23
|
+
When an error shows up, most of us copy it, open a browser, paste it into a search engine or chatbot, read, switch back, and lose our train of thought. errbuddy removes every one of those steps.
|
|
47
24
|
|
|
48
|
-
|
|
25
|
+
- **Zero context switching.** The explanation appears right under the error.
|
|
26
|
+
- **Private by default.** The AI runs locally through [Ollama](https://ollama.com). Your code and errors never leave your computer.
|
|
27
|
+
- **Free.** No API keys, no accounts, no usage limits.
|
|
28
|
+
- **Works offline, and without AI.** If Ollama isn't running, errbuddy falls back to built-in explanations for common errors.
|
|
29
|
+
- **Drop-in.** Your program runs exactly as before: same output, same input, same exit code.
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
49
32
|
|
|
50
33
|
```bash
|
|
51
34
|
npm install -g error-solution-ai-buddy
|
|
52
35
|
errbuddy node app.js
|
|
53
36
|
```
|
|
54
37
|
|
|
55
|
-
That's it.
|
|
56
|
-
|
|
57
|
-
### Turn on AI explanations (optional, free, runs on your machine)
|
|
38
|
+
That's it. You'll get pattern-based explanations straight away.
|
|
58
39
|
|
|
59
|
-
|
|
40
|
+
### Turn on AI explanations (optional)
|
|
60
41
|
|
|
61
|
-
1. Install Ollama from https://ollama.com/download
|
|
62
|
-
2. Download the default model (about 400 MB):
|
|
42
|
+
1. Install Ollama from [ollama.com/download](https://ollama.com/download)
|
|
43
|
+
2. Download the default model (about 400 MB, runs fine on low-RAM laptops):
|
|
63
44
|
```bash
|
|
64
45
|
ollama pull qwen2.5:0.5b
|
|
65
46
|
```
|
|
66
|
-
3. Make sure Ollama is running
|
|
67
|
-
|
|
68
|
-
Want better explanations? Use a bigger model: `errbuddy --model llama3.2 node app.js`
|
|
69
|
-
|
|
70
|
-
If Ollama isn't running, errbuddy still works — it falls back to pattern matching.
|
|
71
|
-
|
|
72
|
-
## Installation & Usage
|
|
73
|
-
|
|
74
|
-
### 1. Download the Project
|
|
75
|
-
- Clone the repository:
|
|
76
|
-
```sh
|
|
77
|
-
git clone <your-repo-url>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### 2. Install Dependencies
|
|
81
|
-
- In the project folder, run:
|
|
82
|
-
```sh
|
|
83
|
-
npm install
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### 3. Use the CLI Tool
|
|
87
|
-
- Go to the CLI directory:
|
|
88
|
-
```sh
|
|
89
|
-
cd error-solution-ai-buddy/cli
|
|
90
|
-
npm link
|
|
91
|
-
```
|
|
92
|
-
- Now you can run the CLI from anywhere:
|
|
93
|
-
```sh
|
|
94
|
-
errbuddy <your-command>
|
|
95
|
-
# Example:
|
|
96
|
-
errbuddy node test-error.js
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### 4. Use the VS Code Extension
|
|
100
|
-
- Build the extension (if needed):
|
|
101
|
-
```sh
|
|
102
|
-
cd error-solution-ai-buddy/extension
|
|
103
|
-
npm install
|
|
104
|
-
npm run build
|
|
105
|
-
```
|
|
106
|
-
- Install the extension in VS Code:
|
|
107
|
-
- Use "Install from VSIX..." if you have a packaged file.
|
|
108
|
-
- Or run:
|
|
109
|
-
```sh
|
|
110
|
-
code --install-extension <path-to-extension-folder>
|
|
111
|
-
```
|
|
112
|
-
- Reload VS Code.
|
|
113
|
-
|
|
114
|
-
### 5. Start Using
|
|
115
|
-
- For CLI: Run commands with `errbuddy` prefix.
|
|
116
|
-
- For extension: Use terminal and Error Buddy commands in VS Code.
|
|
117
|
-
### Manual Setup
|
|
118
|
-
|
|
119
|
-
#### Step 1: Install Ollama (Optional - for AI features)
|
|
47
|
+
3. Make sure Ollama is running: open the Ollama app, or run `ollama serve`
|
|
120
48
|
|
|
121
|
-
|
|
122
|
-
# Windows: Download from https://ollama.ai
|
|
123
|
-
|
|
124
|
-
# macOS
|
|
125
|
-
brew install ollama
|
|
49
|
+
The next time you run `errbuddy`, it detects Ollama automatically. If the default model isn't installed but another one is, errbuddy uses that instead.
|
|
126
50
|
|
|
127
|
-
|
|
128
|
-
curl -fsSL https://ollama.ai/install.sh | sh
|
|
129
|
-
```
|
|
51
|
+
## Usage
|
|
130
52
|
|
|
131
|
-
|
|
53
|
+
Put `errbuddy` in front of the command you normally run:
|
|
132
54
|
|
|
133
55
|
```bash
|
|
134
|
-
|
|
135
|
-
|
|
56
|
+
errbuddy node app.js # instead of: node app.js
|
|
57
|
+
errbuddy npm start # instead of: npm start
|
|
58
|
+
errbuddy java MyApp # instead of: java MyApp
|
|
59
|
+
errbuddy dotnet run # instead of: dotnet run
|
|
136
60
|
```
|
|
137
|
-
### 3. Install Error Buddy
|
|
138
61
|
|
|
139
|
-
|
|
140
|
-
# From this directory
|
|
141
|
-
npm install
|
|
142
|
-
npm link # Makes 'errbuddy' available globally
|
|
143
|
-
```
|
|
62
|
+
### Options
|
|
144
63
|
|
|
145
|
-
|
|
64
|
+
| Option | What it does |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `--model <name>` | Use a different Ollama model, e.g. `--model llama3.2` for richer answers |
|
|
67
|
+
| `--offline` | Skip AI and use built-in pattern matching only |
|
|
68
|
+
| `--no-ai` | Show errors without any explanation |
|
|
69
|
+
| `-V, --version` | Show the installed version |
|
|
70
|
+
| `-h, --help` | Show help |
|
|
146
71
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
errbuddy
|
|
72
|
+
| Command | What it does |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `errbuddy examples` | Show usage examples |
|
|
75
|
+
| `errbuddy config` | Show the current model and Ollama URL |
|
|
150
76
|
|
|
151
|
-
|
|
152
|
-
errbuddy npm start
|
|
77
|
+
> Put errbuddy's own options **before** your command: `errbuddy --model llama3.2 node app.js`. Anything after the command is passed straight through to it.
|
|
153
78
|
|
|
154
|
-
|
|
155
|
-
errbuddy java MyApp
|
|
79
|
+
## Supported languages
|
|
156
80
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
81
|
+
| Language | Detected errors include |
|
|
82
|
+
|---|---|
|
|
83
|
+
| JavaScript / Node.js | `TypeError`, `ReferenceError`, `SyntaxError`, missing modules |
|
|
84
|
+
| Java | `NullPointerException`, `ArrayIndexOutOfBoundsException`, `ClassNotFoundException`, compile errors |
|
|
85
|
+
| C# / .NET | `NullReferenceException`, `IndexOutOfRangeException`, `CSxxxx` compiler errors |
|
|
160
86
|
|
|
161
|
-
|
|
87
|
+
With AI enabled, errbuddy can explain other errors too; pattern matching covers the cases above.
|
|
162
88
|
|
|
163
|
-
|
|
164
|
-
|----------|--------|-------------|
|
|
165
|
-
| JavaScript/Node.js | ✅ Full | TypeError, ReferenceError, SyntaxError, Module errors |
|
|
166
|
-
| Java | ✅ Full | NullPointer, ArrayIndex, ClassNotFound, Compile errors |
|
|
167
|
-
| C#/.NET | ✅ Full | NullReference, Index, CS errors, Runtime exceptions |
|
|
89
|
+
## How it works
|
|
168
90
|
|
|
169
|
-
|
|
91
|
+
```text
|
|
92
|
+
errbuddy node app.js
|
|
93
|
+
│
|
|
94
|
+
▼
|
|
95
|
+
Runs your command ──► stdout is shown as normal
|
|
96
|
+
│ stderr is shown AND captured
|
|
97
|
+
▼
|
|
98
|
+
Error detector ──► finds the language, error type, file and line
|
|
99
|
+
│
|
|
100
|
+
▼
|
|
101
|
+
Sanitizer ──► strips file paths and anything that looks like a secret
|
|
102
|
+
│
|
|
103
|
+
├── Ollama running? ──► local AI explains WHAT / WHY / FIX / EXAMPLE
|
|
104
|
+
└── Not running? ──► built-in pattern explanation
|
|
105
|
+
│
|
|
106
|
+
▼
|
|
107
|
+
Formatted explanation printed under the error, then your exit code is returned
|
|
108
|
+
```
|
|
170
109
|
|
|
171
|
-
|
|
172
|
-
# Disable AI (use pattern matching only)
|
|
173
|
-
errbuddy --no-ai node app.js
|
|
110
|
+
Want the design reasoning? See [architecture](https://github.com/sithija-jayasinghe/solution-ai-buddy-v1/blob/main/error-solution-ai-buddy/docs/architecture.md) and [design decisions](https://github.com/sithija-jayasinghe/solution-ai-buddy-v1/blob/main/error-solution-ai-buddy/docs/decisions.md).
|
|
174
111
|
|
|
175
|
-
|
|
176
|
-
errbuddy --model codellama node app.js
|
|
112
|
+
## Privacy
|
|
177
113
|
|
|
178
|
-
|
|
179
|
-
|
|
114
|
+
- The AI runs **100% locally** through Ollama. Nothing is sent to the cloud.
|
|
115
|
+
- Before an error reaches the model, absolute file paths (`/Users/...`, `C:\Users\...`) are replaced with `[path]` and values that look like API keys, tokens or passwords are replaced with `[REDACTED]`.
|
|
116
|
+
- No telemetry, no analytics, no account.
|
|
117
|
+
- A local history of errors and explanations is kept in `~/.errbuddy/history.json`. Delete that file at any time to clear it.
|
|
180
118
|
|
|
181
|
-
|
|
182
|
-
errbuddy examples
|
|
119
|
+
## VS Code extension
|
|
183
120
|
|
|
184
|
-
|
|
185
|
-
errbuddy config
|
|
186
|
-
```
|
|
121
|
+
The repo also includes an Error Buddy extension for VS Code that explains errors from the integrated terminal or from selected text. It isn't on the Marketplace yet. To try it, install [`error-buddy-1.0.0.vsix`](https://github.com/sithija-jayasinghe/solution-ai-buddy-v1/tree/main/error-solution-ai-buddy/extension) with **Extensions → … → Install from VSIX**.
|
|
187
122
|
|
|
188
|
-
|
|
123
|
+
Commands: *Explain Selected Error*, *Explain Last Terminal Error*, *Toggle Auto-Explain*, *Open Error Buddy Terminal*, *Show Error History*.
|
|
189
124
|
|
|
190
|
-
|
|
191
|
-
┌─────────────────────────────────────────┐
|
|
192
|
-
│ You run: errbuddy node app.js │
|
|
193
|
-
└─────────────────────────────────────────┘
|
|
194
|
-
↓
|
|
195
|
-
┌─────────────────────────────────────────┐
|
|
196
|
-
│ CLI spawns: node app.js │
|
|
197
|
-
│ • stdout → displayed normally │
|
|
198
|
-
│ • stderr → captured for analysis │
|
|
199
|
-
└─────────────────────────────────────────┘
|
|
200
|
-
↓
|
|
201
|
-
┌─────────────────────────────────────────┐
|
|
202
|
-
│ Error Detector │
|
|
203
|
-
│ • Detects language (JS/Java/C#) │
|
|
204
|
-
│ • Extracts error type, file, line │
|
|
205
|
-
└─────────────────────────────────────────┘
|
|
206
|
-
↓
|
|
207
|
-
┌─────────────────────────────────────────┐
|
|
208
|
-
│ Ollama AI (local) │
|
|
209
|
-
│ • Receives sanitized error │
|
|
210
|
-
│ • Returns structured explanation │
|
|
211
|
-
└─────────────────────────────────────────┘
|
|
212
|
-
↓
|
|
213
|
-
┌─────────────────────────────────────────┐
|
|
214
|
-
│ Pretty Terminal Output │
|
|
215
|
-
│ • WHAT / WHY / FIX / EXAMPLE │
|
|
216
|
-
└─────────────────────────────────────────┘
|
|
217
|
-
```
|
|
125
|
+
## Troubleshooting
|
|
218
126
|
|
|
219
|
-
|
|
127
|
+
**"Ollama not detected"**
|
|
128
|
+
1. Open the Ollama app, or run `ollama serve`
|
|
129
|
+
2. Check it responds: `curl http://localhost:11434/api/tags`
|
|
130
|
+
3. Make sure you have a model: `ollama pull qwen2.5:0.5b`
|
|
220
131
|
|
|
221
|
-
|
|
132
|
+
**The AI explanation timed out**
|
|
133
|
+
Your machine may be busy or the model too large. Use the default `qwen2.5:0.5b`, or run with `--offline`.
|
|
222
134
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
- ✅ No telemetry or analytics
|
|
226
|
-
- ✅ No API keys required
|
|
227
|
-
- ✅ Works completely offline
|
|
135
|
+
**`errbuddy: command not found`**
|
|
136
|
+
Restart your terminal. If it still fails, check that npm's global bin folder is on your `PATH` (`npm prefix -g` shows where it is).
|
|
228
137
|
|
|
229
|
-
##
|
|
138
|
+
## Development
|
|
230
139
|
|
|
140
|
+
```bash
|
|
141
|
+
git clone https://github.com/sithija-jayasinghe/solution-ai-buddy-v1.git
|
|
142
|
+
cd solution-ai-buddy-v1/error-solution-ai-buddy
|
|
143
|
+
npm install
|
|
144
|
+
npm test # 62 tests, Node's built-in test runner
|
|
145
|
+
npm link # use your local copy as the global `errbuddy`
|
|
231
146
|
```
|
|
147
|
+
|
|
148
|
+
```text
|
|
232
149
|
error-solution-ai-buddy/
|
|
233
150
|
├── cli/
|
|
234
|
-
│ ├── index.js
|
|
235
|
-
│ ├── error-listener.js
|
|
236
|
-
│ └── formatter.js
|
|
237
|
-
├── backend/
|
|
238
|
-
│
|
|
239
|
-
│
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
├── docs/
|
|
244
|
-
│ ├── architecture.md # System design
|
|
245
|
-
│ ├── decisions.md # Why we made these choices
|
|
246
|
-
│ └── terminal-integration.md
|
|
247
|
-
├── tests/
|
|
248
|
-
│ └── *.test.js
|
|
249
|
-
├── package.json
|
|
250
|
-
└── README.md
|
|
151
|
+
│ ├── index.js # CLI entry: runs the command, wires everything together
|
|
152
|
+
│ ├── error-listener.js # language detection and error patterns
|
|
153
|
+
│ └── formatter.js # terminal output
|
|
154
|
+
├── backend/src/
|
|
155
|
+
│ ├── ai/ollama-service.js # Ollama client, prompt and response parsing
|
|
156
|
+
│ └── services/history-service.js # local error history
|
|
157
|
+
├── extension/ # VS Code extension (TypeScript)
|
|
158
|
+
├── docs/ # architecture and design decisions
|
|
159
|
+
└── tests/
|
|
251
160
|
```
|
|
252
161
|
|
|
253
|
-
##
|
|
254
|
-
|
|
255
|
-
Configuration is stored in `~/.errbuddy/config.json`:
|
|
256
|
-
|
|
257
|
-
```json
|
|
258
|
-
{
|
|
259
|
-
"ollamaUrl": "http://localhost:11434",
|
|
260
|
-
"model": "llama3.2",
|
|
261
|
-
"showSpinner": true,
|
|
262
|
-
"saveHistory": true
|
|
263
|
-
}
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
## Troubleshooting
|
|
267
|
-
|
|
268
|
-
### "Ollama not detected"
|
|
269
|
-
|
|
270
|
-
1. Make sure Ollama is running: `ollama serve`
|
|
271
|
-
2. Check it's accessible: `curl http://localhost:11434/api/tags`
|
|
272
|
-
3. Pull a model: `ollama pull qwen2.5:0.5b`
|
|
273
|
-
|
|
274
|
-
### "AI explanation timed out"
|
|
275
|
-
|
|
276
|
-
- Try a smaller model: `errbuddy --model llama3.2:1b node app.js`
|
|
277
|
-
- Check system resources (Ollama needs ~4GB RAM)
|
|
278
|
-
|
|
279
|
-
### Command not found after `npm link`
|
|
162
|
+
## Roadmap
|
|
280
163
|
|
|
281
|
-
-
|
|
282
|
-
-
|
|
164
|
+
- [ ] Python and Go error patterns
|
|
165
|
+
- [ ] Optional cloud models (bring your own API key) for people who don't want to run Ollama
|
|
166
|
+
- [ ] `errbuddy history` command to search past errors
|
|
167
|
+
- [ ] Publish the VS Code extension to the Marketplace
|
|
283
168
|
|
|
284
169
|
## Contributing
|
|
285
170
|
|
|
286
|
-
|
|
287
|
-
2. Create a feature branch
|
|
288
|
-
3. Submit a PR
|
|
171
|
+
Issues and pull requests are welcome. If errbuddy explained something badly, [open an issue](https://github.com/sithija-jayasinghe/solution-ai-buddy-v1/issues) with the error text so the patterns and prompts can improve.
|
|
289
172
|
|
|
290
173
|
## License
|
|
291
174
|
|
|
292
|
-
MIT ©
|
|
175
|
+
[MIT](https://github.com/sithija-jayasinghe/solution-ai-buddy-v1/blob/main/error-solution-ai-buddy/LICENSE) © Sithija Harshana Jayasinghe
|