bugit-cli 1.0.1 → 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 CHANGED
@@ -6,78 +6,270 @@ Log bugs from your terminal without breaking your flow.
6
6
  npm install -g bugit-cli
7
7
  ```
8
8
 
9
- ## Authentication
9
+ Then authenticate:
10
10
 
11
11
  ```bash
12
- bug login # opens a browser tab to authenticate
13
- bug whoami # show your email and API endpoint
14
- bug logout # clear stored credentials
12
+ bug login
15
13
  ```
16
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
+
17
39
  ## Commands
18
40
 
19
- ### Log a bug
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
+ ```
20
100
 
21
101
  ```bash
22
102
  bug log "Login crashes on Safari 17"
23
103
  bug log "Checkout 500 on mobile" -s critical -p storefront -e prod
24
104
  bug log "Slow query on reports page" -s medium -p api -t postgres,performance
25
- bug log "Build failing" -s high --desc "Error: cannot find module 'react'"
105
+ bug log "Build failing" -s high --desc "error: cannot find module 'react'"
26
106
  ```
27
107
 
28
- **Options**
108
+ ### `bug pipe <title>`
29
109
 
30
- | Flag | Description | Default |
31
- |------|-------------|---------|
32
- | `-s, --sev` | `low` \| `medium` \| `high` \| `critical` | `medium` |
33
- | `-p, --project` | Project name | |
34
- | `-e, --env` | `local` \| `staging` \| `prod` | |
35
- | `-d, --desc` | Description or steps to reproduce | |
36
- | `-n, --notes` | Root cause or fix notes | |
37
- | `-t, --tags` | Comma-separated tags | |
110
+ Pipe stdin into a bug description. Captures build errors, stack traces, and log output.
38
111
 
39
- ### Pipe from stdin
112
+ ```
113
+ USAGE
114
+ bug pipe <title> [options]
40
115
 
41
- Pipe build errors, stack traces, or any output directly into a bug.
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
+ ```
42
125
 
43
126
  ```bash
44
127
  npm run build 2>&1 | bug pipe "Build failed" -s high -p myapp
45
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
46
130
  ```
47
131
 
48
- ### List bugs
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
+ ```
49
146
 
50
147
  ```bash
51
- bug list # all bugs, last 20
148
+ bug list
52
149
  bug list --status open
53
150
  bug list --sev critical
54
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
+
55
159
  ```
160
+ USAGE
161
+ bug view <id>
56
162
 
57
- ### View a bug
163
+ ARGUMENTS
164
+ id Full ObjectId or 6-character short ID
165
+ ```
58
166
 
59
167
  ```bash
60
- bug view <id> # accepts full ID or short 6-char ID
168
+ bug view abc123
61
169
  ```
62
170
 
63
- ### Update a bug
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
+ ```
64
188
 
65
189
  ```bash
66
- bug update <id> --status in-progress
67
- bug update <id> --sev critical --notes "narrowed to auth middleware"
68
- bug update <id> --tags nestjs,redis
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
69
193
  ```
70
194
 
71
- ### Shortcuts
195
+ ### `bug resolve <id>`
196
+
197
+ Shortcut to mark a bug as resolved.
198
+
199
+ ```
200
+ USAGE
201
+ bug resolve <id>
202
+ ```
72
203
 
73
204
  ```bash
74
- bug resolve <id> # set status to resolved
75
- bug wontfix <id> # set status to wontfix
205
+ bug resolve abc123
76
206
  ```
77
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
+
78
268
  ## Web dashboard
79
269
 
80
- Review, filter, and comment on bugs at [https://bugit-dev.vercel.app](https://bugit-dev.vercel.app).
270
+ Review, filter, and comment on bugs at [bugit-dev.vercel.app](https://bugit-dev.vercel.app).
271
+
272
+ ---
81
273
 
82
274
  ## License
83
275
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bugit-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "BugIt CLI - capture bugs from your terminal",
5
5
  "author": "Golden Azubuike <goldenazubuike@gmail.com>",
6
6
  "license": "MIT",
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 run: bug login', 401);
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 is the BugIt server running?', 0);
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 log and review bugs fast').version('1.0.0');
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))} ${colorSev(bug.severity)} ${chalk.bold(bug.title)}`,
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))} status: ${colorStatus(bug.status)}, sev: ${colorSev(bug.severity)}`,
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))} ${colorSev(bug.severity)} ${chalk.bold(bug.title)}`,
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 device flow
203
+ // bug login - device flow
204
204
  program
205
205
  .command('login')
206
206
  .description('Authenticate via browser')