bugit-cli 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 +276 -0
- package/package.json +11 -4
- package/src/api.js +2 -2
- package/src/format.js +3 -3
- package/src/index.js +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# bugit-cli
|
|
2
|
+
|
|
3
|
+
Log bugs from your terminal without breaking your flow.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g bugit-cli
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Then authenticate:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bug login
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bug login # authenticate via browser
|
|
21
|
+
bug log "Login crashes on Safari" # log a bug
|
|
22
|
+
bug list # see your bugs
|
|
23
|
+
bug view <id> # inspect a bug
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Help
|
|
29
|
+
|
|
30
|
+
Every command has built-in help:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bug --help # list all commands and global options
|
|
34
|
+
bug help <command> # detailed help for a specific command
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Commands
|
|
40
|
+
|
|
41
|
+
### `bug login`
|
|
42
|
+
|
|
43
|
+
Authenticate via browser-based device flow. Opens a browser tab for you to approve the CLI session. Token is stored in `~/.buglogrc`.
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
USAGE
|
|
47
|
+
bug login
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bug login # opens browser → approve in dashboard → CLI is authenticated
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### `bug logout`
|
|
55
|
+
|
|
56
|
+
Remove stored credentials.
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
USAGE
|
|
60
|
+
bug logout
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bug logout # clears token from ~/.buglogrc
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `bug whoami`
|
|
68
|
+
|
|
69
|
+
Show the authenticated email and API endpoint.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
USAGE
|
|
73
|
+
bug whoami
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
bug whoami
|
|
78
|
+
# you@email.com → https://bugit-j70c.onrender.com
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `bug log <title>`
|
|
82
|
+
|
|
83
|
+
Log a new bug.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
USAGE
|
|
87
|
+
bug log <title> [options]
|
|
88
|
+
|
|
89
|
+
ARGUMENTS
|
|
90
|
+
title Bug title (required)
|
|
91
|
+
|
|
92
|
+
OPTIONS
|
|
93
|
+
-s, --sev <level> Severity: low | medium | high | critical (default: medium)
|
|
94
|
+
-p, --project <name> Project name
|
|
95
|
+
-e, --env <env> Environment: local | staging | prod
|
|
96
|
+
-d, --desc <text> Description or steps to reproduce
|
|
97
|
+
-n, --notes <text> Root cause or fix notes
|
|
98
|
+
-t, --tags <tags> Comma-separated tags
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
bug log "Login crashes on Safari 17"
|
|
103
|
+
bug log "Checkout 500 on mobile" -s critical -p storefront -e prod
|
|
104
|
+
bug log "Slow query on reports page" -s medium -p api -t postgres,performance
|
|
105
|
+
bug log "Build failing" -s high --desc "error: cannot find module 'react'"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `bug pipe <title>`
|
|
109
|
+
|
|
110
|
+
Pipe stdin into a bug description. Captures build errors, stack traces, and log output.
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
USAGE
|
|
114
|
+
bug pipe <title> [options]
|
|
115
|
+
|
|
116
|
+
ARGUMENTS
|
|
117
|
+
title Bug title (required)
|
|
118
|
+
|
|
119
|
+
OPTIONS
|
|
120
|
+
-s, --sev <level> Severity: low | medium | high | critical (default: high)
|
|
121
|
+
-p, --project <name> Project name
|
|
122
|
+
-e, --env <env> Environment: local | staging | prod
|
|
123
|
+
-t, --tags <tags> Comma-separated tags
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npm run build 2>&1 | bug pipe "Build failed" -s high -p myapp
|
|
128
|
+
cat error.log | bug pipe "Server crash" -s critical -e prod
|
|
129
|
+
kubectl logs pod-web-1 2>&1 | bug pipe "Pod crash loop" -p infra -t kubernetes
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `bug list`
|
|
133
|
+
|
|
134
|
+
List bugs with optional filters.
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
USAGE
|
|
138
|
+
bug list [options]
|
|
139
|
+
|
|
140
|
+
OPTIONS
|
|
141
|
+
-p, --project <name> Filter by project
|
|
142
|
+
--status <status> Filter by status: open | in-progress | resolved | wontfix
|
|
143
|
+
--sev <level> Filter by severity: low | medium | high | critical
|
|
144
|
+
--limit <n> Number of results (default: 20)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
bug list
|
|
149
|
+
bug list --status open
|
|
150
|
+
bug list --sev critical
|
|
151
|
+
bug list -p myapp --limit 50
|
|
152
|
+
bug list -p api --status in-progress --sev high
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `bug view <id>`
|
|
156
|
+
|
|
157
|
+
View full bug details including description, notes, metadata, and comments. Accepts a full ObjectId or 6-character short ID.
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
USAGE
|
|
161
|
+
bug view <id>
|
|
162
|
+
|
|
163
|
+
ARGUMENTS
|
|
164
|
+
id Full ObjectId or 6-character short ID
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
bug view abc123
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `bug update <id>`
|
|
172
|
+
|
|
173
|
+
Update a bug's fields.
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
USAGE
|
|
177
|
+
bug update <id> [options]
|
|
178
|
+
|
|
179
|
+
ARGUMENTS
|
|
180
|
+
id Full ObjectId or 6-character short ID
|
|
181
|
+
|
|
182
|
+
OPTIONS
|
|
183
|
+
--status <status> New status: open | in-progress | resolved | wontfix
|
|
184
|
+
--sev <level> New severity: low | medium | high | critical
|
|
185
|
+
--notes <text> Replace notes
|
|
186
|
+
--tags <tags> Replace tags (comma-separated)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
bug update abc123 --status in-progress
|
|
191
|
+
bug update abc123 --sev critical --notes "narrowed to auth middleware"
|
|
192
|
+
bug update abc123 --tags nestjs,redis,queue
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### `bug resolve <id>`
|
|
196
|
+
|
|
197
|
+
Shortcut to mark a bug as resolved.
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
USAGE
|
|
201
|
+
bug resolve <id>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
bug resolve abc123
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### `bug wontfix <id>`
|
|
209
|
+
|
|
210
|
+
Shortcut to mark a bug as won't fix.
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
USAGE
|
|
214
|
+
bug wontfix <id>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
bug wontfix abc123
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## All options reference
|
|
224
|
+
|
|
225
|
+
| Flag | Long | Commands | Description |
|
|
226
|
+
|------|------|----------|-------------|
|
|
227
|
+
| `-p` | `--project <name>` | log, pipe, list | Project name |
|
|
228
|
+
| `-s` | `--sev <level>` | log, pipe, list | Severity |
|
|
229
|
+
| `-e` | `--env <env>` | log, pipe | Environment |
|
|
230
|
+
| `-d` | `--desc <text>` | log | Description |
|
|
231
|
+
| `-n` | `--notes <text>` | log, update | Notes |
|
|
232
|
+
| `-t` | `--tags <tags>` | log, pipe, update | Comma-separated tags |
|
|
233
|
+
| | `--status <status>` | list, update | Status filter or value |
|
|
234
|
+
| | `--limit <n>` | list | Max results |
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Environment variables
|
|
239
|
+
|
|
240
|
+
| Variable | Default | Description |
|
|
241
|
+
|----------|---------|-------------|
|
|
242
|
+
| `BUGIT_API_URL` | `https://bugit-j70c.onrender.com` | API endpoint |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Real-world workflows
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Catch a failing build
|
|
250
|
+
npm run build 2>&1 | bug pipe "Build failed" -s high -p webapp
|
|
251
|
+
|
|
252
|
+
# Log a production incident from a log file
|
|
253
|
+
ssh prod tail -100 /var/log/app/error.log | bug pipe "Prod 500s" -s critical -e prod
|
|
254
|
+
|
|
255
|
+
# Triage your open bugs
|
|
256
|
+
bug list --status open --sev critical
|
|
257
|
+
|
|
258
|
+
# Investigate and update
|
|
259
|
+
bug view a1b2c3
|
|
260
|
+
bug update a1b2c3 --status in-progress --notes "looking into it"
|
|
261
|
+
|
|
262
|
+
# Mark resolved after deploy
|
|
263
|
+
bug resolve a1b2c3
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Web dashboard
|
|
269
|
+
|
|
270
|
+
Review, filter, and comment on bugs at [bugit-dev.vercel.app](https://bugit-dev.vercel.app).
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bugit-cli",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "BugIt CLI
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "BugIt CLI - capture bugs from your terminal",
|
|
5
5
|
"author": "Golden Azubuike <goldenazubuike@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://bugit-dev.vercel.app",
|
|
@@ -9,12 +9,19 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/goldenazubuike/bugit"
|
|
11
11
|
},
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"bug",
|
|
14
|
+
"tracker",
|
|
15
|
+
"cli",
|
|
16
|
+
"developer-tools",
|
|
17
|
+
"debugging"
|
|
18
|
+
],
|
|
13
19
|
"bin": {
|
|
14
20
|
"bug": "./src/index.js"
|
|
15
21
|
},
|
|
16
22
|
"files": [
|
|
17
|
-
"src/"
|
|
23
|
+
"src/",
|
|
24
|
+
"README.md"
|
|
18
25
|
],
|
|
19
26
|
"scripts": {
|
|
20
27
|
"start": "node src/index.js"
|
package/src/api.js
CHANGED
|
@@ -27,7 +27,7 @@ export async function apiFetch(path, options = {}) {
|
|
|
27
27
|
clearTimeout(timer);
|
|
28
28
|
|
|
29
29
|
if (res.status === 401) {
|
|
30
|
-
throw new ApiError('Not authenticated
|
|
30
|
+
throw new ApiError('Not authenticated - run: bug login', 401);
|
|
31
31
|
}
|
|
32
32
|
if (!res.ok) {
|
|
33
33
|
let msg = `HTTP ${res.status}`;
|
|
@@ -39,7 +39,7 @@ export async function apiFetch(path, options = {}) {
|
|
|
39
39
|
} catch (err) {
|
|
40
40
|
clearTimeout(timer);
|
|
41
41
|
if (err.name === 'AbortError') {
|
|
42
|
-
throw new ApiError('API unreachable
|
|
42
|
+
throw new ApiError('API unreachable - is the BugIt server running?', 0);
|
|
43
43
|
}
|
|
44
44
|
if (err instanceof ApiError) throw err;
|
|
45
45
|
throw new ApiError(`Network error: ${err.message}`, 0);
|
package/src/format.js
CHANGED
|
@@ -65,12 +65,12 @@ export function printBugDetail(bug, comments = []) {
|
|
|
65
65
|
console.log(chalk.bold(bug.title));
|
|
66
66
|
console.log(line);
|
|
67
67
|
console.log(`${chalk.dim('ID')} ${shortId(bug._id)} (${bug._id})`);
|
|
68
|
-
console.log(`${chalk.dim('Project')} ${bug.project || '
|
|
68
|
+
console.log(`${chalk.dim('Project')} ${bug.project || '-'}`);
|
|
69
69
|
console.log(`${chalk.dim('Severity')} ${colorSev(bug.severity)}`);
|
|
70
70
|
console.log(`${chalk.dim('Status')} ${colorStatus(bug.status)}`);
|
|
71
|
-
console.log(`${chalk.dim('Environment')} ${bug.environment || '
|
|
71
|
+
console.log(`${chalk.dim('Environment')} ${bug.environment || '-'}`);
|
|
72
72
|
console.log(`${chalk.dim('Source')} ${bug.source}`);
|
|
73
|
-
console.log(`${chalk.dim('Tags')} ${bug.tags?.join(', ') || '
|
|
73
|
+
console.log(`${chalk.dim('Tags')} ${bug.tags?.join(', ') || '-'}`);
|
|
74
74
|
console.log(
|
|
75
75
|
`${chalk.dim('Created')} ${new Date(bug.createdAt).toLocaleString()}`,
|
|
76
76
|
);
|
package/src/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function handleError(err) {
|
|
|
16
16
|
process.exit(1);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
program.name('bug').description('BugIt CLI
|
|
19
|
+
program.name('bug').description('BugIt CLI - log and review bugs fast').version('1.0.0');
|
|
20
20
|
|
|
21
21
|
// bug log
|
|
22
22
|
program
|
|
@@ -44,7 +44,7 @@ program
|
|
|
44
44
|
};
|
|
45
45
|
const bug = await apiFetch('/bugs', { method: 'POST', body: JSON.stringify(body) });
|
|
46
46
|
spinner.succeed(
|
|
47
|
-
`Bug logged ${chalk.dim(shortId(bug._id))}
|
|
47
|
+
`Bug logged ${chalk.dim(shortId(bug._id))} - ${colorSev(bug.severity)} ${chalk.bold(bug.title)}`,
|
|
48
48
|
);
|
|
49
49
|
} catch (err) {
|
|
50
50
|
spinner.fail();
|
|
@@ -126,7 +126,7 @@ program
|
|
|
126
126
|
}
|
|
127
127
|
const bug = await apiFetch(`/bugs/${id}`, { method: 'PATCH', body: JSON.stringify(body) });
|
|
128
128
|
spinner.succeed(
|
|
129
|
-
`Updated ${chalk.dim(shortId(bug._id))}
|
|
129
|
+
`Updated ${chalk.dim(shortId(bug._id))} - status: ${colorStatus(bug.status)}, sev: ${colorSev(bug.severity)}`,
|
|
130
130
|
);
|
|
131
131
|
} catch (err) {
|
|
132
132
|
spinner.fail();
|
|
@@ -192,7 +192,7 @@ program
|
|
|
192
192
|
};
|
|
193
193
|
const bug = await apiFetch('/bugs', { method: 'POST', body: JSON.stringify(body) });
|
|
194
194
|
spinner.succeed(
|
|
195
|
-
`Piped bug logged ${chalk.dim(shortId(bug._id))}
|
|
195
|
+
`Piped bug logged ${chalk.dim(shortId(bug._id))} - ${colorSev(bug.severity)} ${chalk.bold(bug.title)}`,
|
|
196
196
|
);
|
|
197
197
|
} catch (err) {
|
|
198
198
|
spinner.fail();
|
|
@@ -200,7 +200,7 @@ program
|
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
// bug login
|
|
203
|
+
// bug login - device flow
|
|
204
204
|
program
|
|
205
205
|
.command('login')
|
|
206
206
|
.description('Authenticate via browser')
|