@aaronshaf/ger 3.0.2 → 4.0.1

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.
@@ -2,6 +2,17 @@
2
2
 
3
3
  Complete reference documentation for all ger CLI commands.
4
4
 
5
+ ## Output Format Flags
6
+
7
+ All commands that produce output support:
8
+ - `--json` — Structured JSON for programmatic consumption
9
+ - `--xml` — XML with CDATA-wrapped content (preferred for LLM consumption)
10
+ - (default) — Colored terminal output
11
+
12
+ `--json` and `--xml` are mutually exclusive.
13
+
14
+ ---
15
+
5
16
  ## Change Viewing Commands
6
17
 
7
18
  ### show
@@ -14,31 +25,22 @@ ger show [change-id] [options]
14
25
  ```
15
26
 
16
27
  **Options:**
17
- - `--format <format>` - Output format: `text`, `json`, `markdown`
18
- - `--no-comments` - Exclude comments from output
19
- - `--no-diff` - Exclude diff from output
28
+ - `--json` JSON output
29
+ - `--xml` XML output
30
+ - `--no-comments` Exclude comments
31
+ - `--no-diff` — Exclude diff
20
32
 
21
33
  **Examples:**
22
34
  ```bash
23
- # Show current change
24
35
  ger show
25
-
26
- # Show specific change
27
36
  ger show 12345
28
-
29
- # Show as JSON
30
- ger show 12345 --format json
31
-
32
- # Show without comments
37
+ ger show 12345 --xml
33
38
  ger show --no-comments
34
39
  ```
35
40
 
36
- **Output includes:**
37
- - Change metadata (owner, status, subject)
38
- - Commit message
39
- - File diffs
40
- - All comments and inline feedback
41
- - Jenkins build status (if available)
41
+ **Output includes:** metadata, commit message, file diffs, all comments, Jenkins build status
42
+
43
+ ---
42
44
 
43
45
  ### diff
44
46
 
@@ -50,22 +52,20 @@ ger diff [change-id] [options]
50
52
  ```
51
53
 
52
54
  **Options:**
53
- - `--format <format>` - Output format: `unified`, `context`, `json`
54
- - `--file <path>` - Show diff for specific file only
55
- - `--base <revision>` - Compare against specific base revision
55
+ - `--file <path>` Show diff for specific file only
56
+ - `--base <revision>` Compare against specific base revision
57
+ - `--json` JSON output
58
+ - `--xml` — XML output
56
59
 
57
60
  **Examples:**
58
61
  ```bash
59
- # Get unified diff
60
62
  ger diff 12345
61
-
62
- # Get diff for specific file
63
63
  ger diff 12345 --file src/api/client.ts
64
-
65
- # Get diff as JSON
66
- ger diff 12345 --format json
64
+ ger diff 12345 --xml
67
65
  ```
68
66
 
67
+ ---
68
+
69
69
  ### comments
70
70
 
71
71
  View all comments on a change.
@@ -76,320 +76,389 @@ ger comments [change-id] [options]
76
76
  ```
77
77
 
78
78
  **Options:**
79
- - `--format <format>` - Output format: `text`, `json`, `markdown`
80
- - `--unresolved-only` - Show only unresolved comments
81
- - `--file <path>` - Show comments for specific file only
79
+ - `--unresolved-only` Show only unresolved comments
80
+ - `--file <path>` Show comments for specific file only
81
+ - `--json` JSON output
82
+ - `--xml` — XML output
82
83
 
83
- **Examples:**
84
- ```bash
85
- # View all comments
86
- ger comments 12345
84
+ ---
85
+
86
+ ### files
87
87
 
88
- # View unresolved comments only
89
- ger comments 12345 --unresolved-only
88
+ List changed files in a change.
90
89
 
91
- # View comments for specific file
92
- ger comments 12345 --file src/api/client.ts
90
+ **Syntax:**
91
+ ```bash
92
+ ger files [change-id] [options]
93
93
  ```
94
94
 
95
- ## Change Management Commands
95
+ **Options:**
96
+ - `--json` — JSON output
97
+ - `--xml` — XML output
96
98
 
97
- ### mine
99
+ ---
100
+
101
+ ### reviewers
98
102
 
99
- List all changes owned by you.
103
+ List reviewers on a change.
100
104
 
101
105
  **Syntax:**
102
106
  ```bash
103
- ger mine [options]
107
+ ger reviewers [change-id] [options]
104
108
  ```
105
109
 
106
110
  **Options:**
107
- - `--status <status>` - Filter by status: `open`, `merged`, `abandoned`
108
- - `--format <format>` - Output format: `table`, `json`, `list`
109
- - `--limit <n>` - Limit number of results
111
+ - `--json` JSON output
112
+ - `--xml` XML output
110
113
 
111
- **Examples:**
114
+ ---
115
+
116
+ ## Change Listing Commands
117
+
118
+ ### list
119
+
120
+ List your changes or changes needing your review.
121
+
122
+ **Syntax:**
112
123
  ```bash
113
- # List all your open changes
114
- ger mine
124
+ ger list [options]
125
+ ```
115
126
 
116
- # List merged changes
117
- ger mine --status merged
127
+ **Options:**
128
+ - `--status <status>` — Filter by status: `open`, `merged`, `abandoned` (default: open)
129
+ - `-n, --limit <n>` — Maximum number of changes (default: 25)
130
+ - `--detailed` — Show detailed information
131
+ - `--reviewer` — Show changes where you are a reviewer or CC'd
132
+ - `--json` — JSON output
133
+ - `--xml` — XML output
134
+
135
+ ---
118
136
 
119
- # List as JSON
120
- ger mine --format json
137
+ ### mine
138
+
139
+ List all changes owned by you. Alias for `ger list`.
140
+
141
+ **Syntax:**
142
+ ```bash
143
+ ger mine [options]
121
144
  ```
122
145
 
123
- ### incoming
146
+ **Options:**
147
+ - `--json` — JSON output
148
+ - `--xml` — XML output
149
+
150
+ ---
151
+
152
+ ### incoming / team
124
153
 
125
- List changes that need your review.
154
+ List changes where you are a reviewer or CC'd.
155
+ Both commands are aliases for `ger list --reviewer`.
156
+ Query: `(reviewer:self OR cc:self) status:open`
126
157
 
127
158
  **Syntax:**
128
159
  ```bash
129
160
  ger incoming [options]
161
+ ger team [options]
130
162
  ```
131
163
 
132
164
  **Options:**
133
- - `--format <format>` - Output format: `table`, `json`, `list`
134
- - `--limit <n>` - Limit number of results
165
+ - `--status <status>` Filter by status (default: open)
166
+ - `-n, --limit <n>` Maximum number of changes (default: 25)
167
+ - `--detailed` — Show detailed information
168
+ - `--all-verified` — Include all verification states (default: excludes unverified)
169
+ - `-f, --filter <query>` — Append custom Gerrit query syntax (e.g. `project:canvas-lms`)
170
+ - `--json` — JSON output
171
+ - `--xml` — XML output
135
172
 
136
173
  **Examples:**
137
174
  ```bash
138
- # List incoming review requests
139
- ger incoming
140
-
141
- # Get as JSON
142
- ger incoming --format json
175
+ ger team
176
+ ger incoming --filter "project:canvas-lms"
177
+ ger team --all-verified --json
143
178
  ```
144
179
 
145
- ### open
180
+ ---
181
+
182
+ ### search
146
183
 
147
- List all open changes in the project.
184
+ Search for changes using Gerrit query syntax.
148
185
 
149
186
  **Syntax:**
150
187
  ```bash
151
- ger open [options]
188
+ ger search [query] [options]
152
189
  ```
153
190
 
154
191
  **Options:**
155
- - `--owner <email>` - Filter by change owner
156
- - `--format <format>` - Output format: `table`, `json`, `list`
157
- - `--limit <n>` - Limit number of results
192
+ - `-n, --limit <n>` Maximum results (default: 25)
193
+ - `--xml` XML output
194
+
195
+ **Common Query Operators:**
196
+ - `owner:USER` / `owner:self`
197
+ - `status:open|merged|abandoned`
198
+ - `project:NAME`
199
+ - `branch:NAME`
200
+ - `reviewer:USER` / `cc:USER`
201
+ - `is:wip` / `is:submittable`
202
+ - `after:YYYY-MM-DD` / `before:YYYY-MM-DD`
203
+ - `age:1d|2w|1mon`
204
+ - `label:Code-Review+2`
158
205
 
159
206
  **Examples:**
160
207
  ```bash
161
- # List all open changes
162
- ger open
163
-
164
- # Filter by owner
165
- ger open --owner user@example.com
208
+ ger search "owner:self status:open"
209
+ ger search "is:wip"
210
+ ger search "project:canvas-lms after:2025-01-01" -n 10 --xml
166
211
  ```
167
212
 
168
- ### abandon
213
+ ---
169
214
 
170
- Mark a change as abandoned.
215
+ ## Comment and Vote Commands
216
+
217
+ ### comment
218
+
219
+ Post a comment on a Gerrit change.
171
220
 
172
221
  **Syntax:**
173
222
  ```bash
174
- ger abandon [change-id] [options]
223
+ ger comment [change-id] [options]
175
224
  ```
176
225
 
177
226
  **Options:**
178
- - `--message <text>` - Abandonment message
227
+ - `-m, --message <text>` Comment message (reads from stdin if omitted)
228
+ - `--file <path>` — File for inline comment
229
+ - `--line <n>` — Line number for inline comment
230
+ - `--unresolved` — Mark comment as unresolved
179
231
 
180
232
  **Examples:**
181
233
  ```bash
182
- # Abandon with message
183
- ger abandon 12345 --message "No longer needed"
184
-
185
- # Abandon current change
186
- ger abandon
234
+ ger comment 12345 -m "Looks good!"
235
+ ger comment 12345 --file src/api/client.ts --line 42 -m "Consider error handling"
236
+ echo "Review feedback" | ger comment 12345
187
237
  ```
188
238
 
189
- ### checkout
239
+ ---
190
240
 
191
- Checkout a specific change revision locally.
241
+ ### vote
242
+
243
+ Vote on a Gerrit change.
192
244
 
193
245
  **Syntax:**
194
246
  ```bash
195
- ger checkout <change-id> [options]
247
+ ger vote [change-id] <label> <score>
196
248
  ```
197
249
 
198
- **Options:**
199
- - `--revision <n>` - Checkout specific patchset revision (default: latest)
200
-
201
250
  **Examples:**
202
251
  ```bash
203
- # Checkout latest revision
204
- ger checkout 12345
205
-
206
- # Checkout specific revision
207
- ger checkout 12345 --revision 3
252
+ ger vote 12345 Code-Review +2
253
+ ger vote 12345 Code-Review -1
254
+ ger vote 12345 Verified +1
255
+ ger vote --xml
208
256
  ```
209
257
 
210
- ### push
258
+ ---
211
259
 
212
- Push changes to Gerrit for review.
260
+ ## Change Management Commands
261
+
262
+ ### abandon
263
+
264
+ Mark a change as abandoned.
213
265
 
214
266
  **Syntax:**
215
267
  ```bash
216
- ger push [options]
268
+ ger abandon [change-id] [options]
217
269
  ```
218
270
 
219
271
  **Options:**
220
- - `-b, --branch <branch>` - Target branch (auto-detected from tracking branch)
221
- - `-t, --topic <topic>` - Topic name
222
- - `-r, --reviewer <email>` - Add reviewer (can be repeated)
223
- - `--cc <email>` - Add CC (can be repeated)
224
- - `--wip` - Mark as work-in-progress (not ready for review)
225
- - `--ready` - Mark as ready for review (remove WIP status)
226
- - `--hashtag <tag>` - Add hashtag (can be repeated)
227
- - `--private` - Mark as private change
228
- - `--draft` - Alias for --wip
229
- - `--dry-run` - Preview push without actually pushing
272
+ - `-m, --message <text>` Abandonment message
273
+ - `--json` JSON output
274
+ - `--xml` XML output
230
275
 
231
- **Examples:**
276
+ ---
277
+
278
+ ### restore
279
+
280
+ Restore an abandoned change.
281
+
282
+ **Syntax:**
232
283
  ```bash
233
- # Basic push to auto-detected branch
234
- ger push
284
+ ger restore [change-id] [options]
285
+ ```
235
286
 
236
- # Push to specific branch
237
- ger push -b main
238
- ger push --branch feature/auth
287
+ **Options:**
288
+ - `-m, --message <text>` — Restoration message
289
+ - `--json` JSON output
290
+ - `--xml` — XML output
239
291
 
240
- # Push with topic
241
- ger push -t my-feature
292
+ ---
242
293
 
243
- # Push with reviewers
244
- ger push -r alice@example.com -r bob@example.com
294
+ ### submit
245
295
 
246
- # Push with CC
247
- ger push --cc manager@example.com
296
+ Submit a change (merge it).
248
297
 
249
- # Push as work-in-progress (WIP)
250
- ger push --wip
298
+ **Syntax:**
299
+ ```bash
300
+ ger submit [change-id] [options]
301
+ ```
251
302
 
252
- # Mark change as ready for review
253
- ger push --ready
303
+ **Options:**
304
+ - `--json` — JSON output
305
+ - `--xml` — XML output
254
306
 
255
- # Add hashtag
256
- ger push --hashtag bugfix
307
+ ---
257
308
 
258
- # Combine multiple options
259
- ger push -b main -t refactor-auth -r alice@example.com --wip
309
+ ### set-wip
260
310
 
261
- # Preview push without executing
262
- ger push --dry-run
263
- ```
311
+ Mark a change as work-in-progress.
264
312
 
265
- **WIP Workflow:**
266
- Work-in-progress changes are useful for getting early feedback or saving work:
313
+ **Syntax:**
267
314
  ```bash
268
- # Push initial work as WIP
269
- ger push --wip
315
+ ger set-wip [change-id] [options]
316
+ ```
317
+
318
+ **Options:**
319
+ - `-m, --message <text>` — Optional message
320
+ - `--json` — JSON output
321
+ - `--xml` — XML output
322
+
323
+ ---
270
324
 
271
- # Continue updating (stays WIP)
272
- ger push --wip
325
+ ### set-ready
273
326
 
274
- # Mark ready when complete
275
- ger push --ready
327
+ Mark a change as ready for review.
328
+
329
+ **Syntax:**
330
+ ```bash
331
+ ger set-ready [change-id] [options]
276
332
  ```
277
333
 
278
- **Features:**
279
- - Auto-installs commit-msg hook if missing
280
- - Auto-detects target branch from tracking branch or defaults to main/master
281
- - Validates reviewer email addresses
282
- - Returns change URL on successful push
334
+ **Options:**
335
+ - `-m, --message <text>` Optional message
336
+ - `--json` JSON output
337
+ - `--xml` XML output
338
+
339
+ ---
283
340
 
284
- ### search
341
+ ### topic
285
342
 
286
- Search for changes using Gerrit query syntax.
343
+ Get or set the topic on a change.
287
344
 
288
345
  **Syntax:**
289
346
  ```bash
290
- ger search [query] [options]
347
+ ger topic [change-id] [topic] [options]
291
348
  ```
292
349
 
293
350
  **Options:**
294
- - `-n, --limit <n>` - Maximum number of results (default: 25)
295
- - `--format <format>` - Output format: `table`, `json`, `list`
296
- - `--xml` - XML output for automation
297
-
298
- **Common Query Operators:**
299
- - `owner:USER` - Changes owned by USER (use 'self' for yourself)
300
- - `status:STATE` - open, merged, abandoned, closed
301
- - `project:NAME` - Changes in a specific project
302
- - `branch:NAME` - Changes targeting a branch
303
- - `age:TIME` - Time since last update (e.g., 1d, 2w, 1mon)
304
- - `before:DATE` - Changes modified before date (YYYY-MM-DD)
305
- - `after:DATE` - Changes modified after date (YYYY-MM-DD)
306
- - `is:wip` - Work-in-progress changes
307
- - `is:submittable` - Changes ready to submit
308
- - `reviewer:USER` - Changes where USER is a reviewer
309
- - `label:NAME=VALUE` - Filter by label (e.g., label:Code-Review+2)
351
+ - `--delete` Remove the topic
352
+ - `--json` JSON output
353
+ - `--xml` XML output
310
354
 
311
355
  **Examples:**
312
356
  ```bash
313
- # Search for all open changes (default)
314
- ger search
357
+ ger topic 12345 # get topic
358
+ ger topic 12345 my-feature # set topic
359
+ ger topic 12345 --delete # delete topic
360
+ ```
315
361
 
316
- # Search for your open changes
317
- ger search "owner:self status:open"
362
+ ---
318
363
 
319
- # Search for changes by a specific user
320
- ger search "owner:john@example.com"
364
+ ## Push and Checkout Commands
321
365
 
322
- # Search by project
323
- ger search "project:my-project status:open"
366
+ ### push
324
367
 
325
- # Search with date filters
326
- ger search "owner:self after:2025-01-01"
327
- ger search "status:merged age:7d"
368
+ Push changes to Gerrit for review.
328
369
 
329
- # Search for WIP changes
330
- ger search "is:wip"
331
- ger search "owner:self is:wip"
370
+ **Syntax:**
371
+ ```bash
372
+ ger push [options]
373
+ ```
332
374
 
333
- # Search for submittable changes
334
- ger search "is:submittable"
375
+ **Options:**
376
+ - `-b, --branch <branch>` — Target branch (auto-detected from tracking branch)
377
+ - `-t, --topic <topic>` — Topic name
378
+ - `-r, --reviewer <email>` — Add reviewer (repeatable)
379
+ - `--cc <email>` — Add CC (repeatable)
380
+ - `--wip` — Mark as work-in-progress
381
+ - `--ready` — Mark as ready for review
382
+ - `--hashtag <tag>` — Add hashtag (repeatable)
383
+ - `--private` — Mark as private
384
+ - `--dry-run` — Preview without pushing
385
+
386
+ ---
335
387
 
336
- # Combine filters
337
- ger search "owner:self status:merged before:2025-06-01"
388
+ ### checkout
338
389
 
339
- # Limit results
340
- ger search "project:my-project" -n 10
390
+ Checkout a specific change revision locally.
341
391
 
342
- # XML output for automation
343
- ger search "owner:self" --xml
392
+ **Syntax:**
393
+ ```bash
394
+ ger checkout <change-id> [options]
344
395
  ```
345
396
 
346
- ## Commenting Commands
397
+ **Options:**
398
+ - `--revision <n>` — Checkout specific patchset (default: latest)
347
399
 
348
- ### comment
400
+ ---
349
401
 
350
- Post a comment on a Gerrit change.
402
+ ### cherry
403
+
404
+ Cherry-pick a Gerrit change into the current branch.
351
405
 
352
406
  **Syntax:**
353
407
  ```bash
354
- ger comment [change-id] [options]
408
+ ger cherry <change-id>[/<patchset>] [options]
355
409
  ```
356
410
 
357
411
  **Options:**
358
- - `-m, --message <text>` - Comment message
359
- - `--file <path>` - File for inline comment
360
- - `--line <n>` - Line number for inline comment
361
- - `--unresolved` - Mark comment as unresolved (requiring action)
412
+ - `--no-commit` Stage changes without committing (`git cherry-pick -n`)
413
+ - `--no-verify` Skip pre-commit hooks during cherry-pick
414
+ - `--remote <name>` Use specific git remote (default: auto-detected from Gerrit host)
415
+
416
+ **Input formats:**
417
+ - `12345` — Latest patchset
418
+ - `12345/3` — Specific patchset
419
+ - `If5a3ae8cb5a107e187447802358417f311d0c4b1` — Change-ID
420
+ - `https://gerrit.example.com/c/my-project/+/12345` — Full URL
362
421
 
363
422
  **Examples:**
364
423
  ```bash
365
- # Post general comment
366
- ger comment 12345 -m "Looks good!"
424
+ ger cherry 12345
425
+ ger cherry 12345/3
426
+ ger cherry 12345 --no-commit
427
+ ger cherry 12345 --no-verify
428
+ ```
367
429
 
368
- # Post inline comment
369
- ger comment 12345 --file src/api/client.ts --line 42 -m "Consider error handling here"
430
+ ---
370
431
 
371
- # Mark as unresolved
372
- ger comment 12345 -m "Please fix the type error" --unresolved
432
+ ### rebase
373
433
 
374
- # Pipe input from stdin
375
- echo "Review feedback from AI" | ger comment 12345
376
- ```
434
+ Rebase a change on Gerrit (server-side rebase).
377
435
 
378
- **Piped Input:**
379
- The comment command accepts piped input, making it easy to integrate with AI tools:
436
+ **Syntax:**
380
437
  ```bash
381
- # AI-generated review
382
- cat diff.txt | ai-review-tool | ger comment 12345
438
+ ger rebase [change-id] [options]
439
+ ```
440
+
441
+ **Options:**
442
+ - `--base <sha-or-id>` — Rebase onto specific base commit or change
443
+ - `--allow-conflicts` — Allow rebase even when conflicts exist
444
+ - `--json` — JSON output
445
+ - `--xml` — XML output
383
446
 
384
- # GPT-4 review
385
- ger diff 12345 | gpt-4-review | ger comment 12345
447
+ **Examples:**
448
+ ```bash
449
+ ger rebase
450
+ ger rebase 12345
451
+ ger rebase 12345 --allow-conflicts
452
+ ger rebase 12345 --base abc123def --xml
386
453
  ```
387
454
 
388
- ## Build Integration Commands
455
+ ---
456
+
457
+ ## Build and CI Commands
389
458
 
390
459
  ### build-status
391
460
 
392
- Check the build status for a change.
461
+ Check the Jenkins build status for a change.
393
462
 
394
463
  **Syntax:**
395
464
  ```bash
@@ -397,332 +466,325 @@ ger build-status [change-id] [options]
397
466
  ```
398
467
 
399
468
  **Options:**
400
- - `--watch` - Watch build status and wait for completion
401
- - `--interval <seconds>` - Polling interval for watch mode (default: 30)
402
- - `--timeout <seconds>` - Maximum wait time for watch mode
469
+ - `--watch` Poll until build completes
470
+ - `--interval <seconds>` Polling interval (default: 30)
471
+ - `--timeout <seconds>` Maximum wait time
472
+ - `--exit-status` — Return non-zero exit code on build failure (for scripting)
473
+ - `--json` — JSON output
474
+ - `--xml` — XML output
403
475
 
404
476
  **Examples:**
405
477
  ```bash
406
- # Check current status
407
478
  ger build-status 12345
408
-
409
- # Watch until build completes
410
- ger build-status 12345 --watch
411
-
412
- # Watch with custom interval and timeout
413
- ger build-status 12345 --watch --interval 20 --timeout 1800
479
+ ger build-status --watch --interval 20 --timeout 1800
480
+ ger build-status --exit-status
414
481
  ```
415
482
 
483
+ ---
484
+
416
485
  ### extract-url
417
486
 
418
- Extract URLs from change metadata (e.g., build reports, Jenkins links).
487
+ Extract URLs from change messages (e.g., Jenkins build links).
419
488
 
420
489
  **Syntax:**
421
490
  ```bash
422
- ger extract-url <url-type> [change-id]
491
+ ger extract-url <pattern> [change-id]
423
492
  ```
424
493
 
425
- **URL Types:**
426
- - `build-summary-report` - Jenkins build summary report
427
- - `jenkins` - Main Jenkins build URL
428
- - `test-results` - Test results URL
429
-
430
494
  **Examples:**
431
495
  ```bash
432
- # Extract build summary report URL
433
496
  ger extract-url "build-summary-report"
434
-
435
- # Extract for specific change
436
- ger extract-url "jenkins" 12345
437
-
438
- # Get the latest URL
439
497
  ger extract-url "build-summary-report" | tail -1
498
+ ger extract-url "jenkins" 12345
440
499
  ```
441
500
 
442
- ## Configuration Commands
501
+ ---
443
502
 
444
- ### config
503
+ ### retrigger
445
504
 
446
- Manage ger CLI configuration.
505
+ Post a CI retrigger comment on a change.
447
506
 
448
507
  **Syntax:**
449
508
  ```bash
450
- ger config <action> [key] [value]
509
+ ger retrigger [change-id] [options]
451
510
  ```
452
511
 
453
- **Actions:**
454
- - `get <key>` - Get configuration value
455
- - `set <key> <value>` - Set configuration value
456
- - `list` - List all configuration
457
- - `reset` - Reset to defaults
512
+ **Options:**
513
+ - `--json` JSON output
514
+ - `--xml` XML output
515
+
516
+ The retrigger comment is configured via `ger setup` or prompted on first use and saved to config.
458
517
 
459
518
  **Examples:**
460
519
  ```bash
461
- # Set Gerrit URL
462
- ger config set gerrit.url https://gerrit.example.com
463
-
464
- # Get current URL
465
- ger config get gerrit.url
466
-
467
- # List all config
468
- ger config list
520
+ ger retrigger
521
+ ger retrigger 12345
522
+ ger retrigger 12345 --json
469
523
  ```
470
524
 
471
- ## Groups and Reviewers Commands
525
+ ---
472
526
 
473
- ### add-reviewer
527
+ ## Analytics Commands
474
528
 
475
- Add reviewers, groups, or CCs to a change.
529
+ ### analyze
530
+
531
+ View merged change analytics.
476
532
 
477
533
  **Syntax:**
478
534
  ```bash
479
- ger add-reviewer <reviewers...> -c <change-id> [options]
535
+ ger analyze [options]
480
536
  ```
481
537
 
482
538
  **Options:**
483
- - `-c, --change <id>` - Change ID (required)
484
- - `--group` - Add as group instead of individual reviewer
485
- - `--cc` - Add as CC instead of reviewer
486
- - `--notify <level>` - Notification level: `none`, `owner`, `owner_reviewers`, `all`
487
- - `--xml` - XML output for automation
539
+ - `--start-date <YYYY-MM-DD>` Start date (default: January 1 of current year)
540
+ - `--end-date <YYYY-MM-DD>` End date (default: today)
541
+ - `--repo <name>` Filter by repository
542
+ - `--json` JSON output
543
+ - `--xml` XML output
544
+ - `--markdown` — Markdown output
545
+ - `--csv` — CSV output
546
+ - `--output <file>` — Write output to file
488
547
 
489
548
  **Examples:**
490
549
  ```bash
491
- # Add individual reviewers
492
- ger add-reviewer user@example.com -c 12345
493
- ger add-reviewer user1@example.com user2@example.com -c 12345
550
+ ger analyze
551
+ ger analyze --start-date 2025-01-01 --end-date 2025-06-30
552
+ ger analyze --repo canvas-lms --markdown
553
+ ger analyze --csv --output report.csv
554
+ ```
494
555
 
495
- # Add a group as reviewer
496
- ger add-reviewer --group project-reviewers -c 12345
556
+ ---
497
557
 
498
- # Add a group as CC
499
- ger add-reviewer --group administrators --cc -c 12345
558
+ ### update
500
559
 
501
- # Add as CC instead of reviewer
502
- ger add-reviewer --cc user@example.com -c 12345
560
+ Update local cache of merged changes.
503
561
 
504
- # Suppress notifications
505
- ger add-reviewer --notify none user@example.com -c 12345
562
+ **Syntax:**
563
+ ```bash
564
+ ger update [options]
565
+ ```
506
566
 
507
- # XML output
508
- ger add-reviewer user@example.com -c 12345 --xml
567
+ **Options:**
568
+ - `--since <YYYY-MM-DD>` Fetch changes since this date
569
+ - `--json` — JSON output
570
+
571
+ ---
572
+
573
+ ### failures
574
+
575
+ View recent build failures summary.
576
+
577
+ **Syntax:**
578
+ ```bash
579
+ ger failures [options]
509
580
  ```
510
581
 
511
- ### groups
582
+ **Options:**
583
+ - `--json` — JSON output
584
+ - `--xml` — XML output
512
585
 
513
- List and search Gerrit groups.
586
+ ---
587
+
588
+ ## Worktree (tree) Commands
589
+
590
+ ### tree setup
591
+
592
+ Create a git worktree for a Gerrit change, checked out at `<repo-root>/.ger/<change-number>/`.
514
593
 
515
594
  **Syntax:**
516
595
  ```bash
517
- ger groups [options]
596
+ ger tree setup <change-id>[:<patchset>] [options]
518
597
  ```
519
598
 
520
599
  **Options:**
521
- - `--pattern <regex>` - Filter groups by name pattern
522
- - `--owned` - Show only groups you own
523
- - `--project <name>` - Show groups for a specific project
524
- - `--user <account>` - Show groups a user belongs to
525
- - `--limit <n>` - Limit results (default: 25)
526
- - `--xml` - XML output for automation
600
+ - `--json` JSON output
601
+ - `--xml` XML output
527
602
 
528
603
  **Examples:**
529
604
  ```bash
530
- # List all groups
531
- ger groups
532
-
533
- # Filter by pattern
534
- ger groups --pattern "^project-.*"
605
+ ger tree setup 12345
606
+ ger tree setup 12345:3 # specific patchset
607
+ ger tree setup 12345 --xml
608
+ ```
535
609
 
536
- # Show only owned groups
537
- ger groups --owned
610
+ ---
538
611
 
539
- # Show groups for a project
540
- ger groups --project my-project
612
+ ### trees
541
613
 
542
- # Limit results
543
- ger groups --limit 50
614
+ List all ger-managed worktrees.
544
615
 
545
- # XML output
546
- ger groups --xml
616
+ **Syntax:**
617
+ ```bash
618
+ ger trees [options]
547
619
  ```
548
620
 
549
- **Output includes:**
550
- - Group name and ID
551
- - Description
552
- - Owner group
553
- - Visibility settings
554
- - Creation date (when available)
621
+ **Options:**
622
+ - `--json` JSON output
623
+ - `--xml` — XML output
555
624
 
556
- ### groups-show
625
+ ---
557
626
 
558
- Show detailed information about a specific group.
627
+ ### tree rebase
628
+
629
+ Rebase the current worktree onto the latest base branch. Must be run from inside a ger worktree.
559
630
 
560
631
  **Syntax:**
561
632
  ```bash
562
- ger groups-show <group-id> [options]
633
+ ger tree rebase [options]
563
634
  ```
564
635
 
565
636
  **Options:**
566
- - `--xml` - XML output for automation
567
-
568
- **Group ID formats:**
569
- - Group name: `administrators`
570
- - Numeric ID: `1`
571
- - UUID: `uuid-123456`
637
+ - `--onto <branch>` — Rebase onto specific branch (default: auto-detected from tracking branch)
638
+ - `-i, --interactive` — Interactive rebase (`git rebase -i`)
639
+ - `--json` — JSON output
640
+ - `--xml` XML output
572
641
 
573
642
  **Examples:**
574
643
  ```bash
575
- # Show by name
576
- ger groups-show administrators
644
+ cd .ger/12345
645
+ ger tree rebase
646
+ ger tree rebase --onto origin/main
647
+ ger tree rebase --interactive
648
+ ```
577
649
 
578
- # Show by numeric ID
579
- ger groups-show 1
650
+ ---
580
651
 
581
- # Show by UUID
582
- ger groups-show uuid-123456
652
+ ### tree cleanup
583
653
 
584
- # XML output
585
- ger groups-show administrators --xml
654
+ Remove a ger-managed worktree.
655
+
656
+ **Syntax:**
657
+ ```bash
658
+ ger tree cleanup <change-id> [options]
586
659
  ```
587
660
 
588
- **Output includes:**
589
- - Basic group information (name, ID, owner, description)
590
- - Visibility settings
591
- - All group members with details
592
- - Subgroups (included groups)
593
- - Metadata (creation date, group ID)
661
+ ---
594
662
 
595
- ### groups-members
663
+ ## Groups and Reviewer Commands
596
664
 
597
- List all members of a group.
665
+ ### add-reviewer
666
+
667
+ Add reviewers, groups, or CCs to a change.
598
668
 
599
669
  **Syntax:**
600
670
  ```bash
601
- ger groups-members <group-id> [options]
671
+ ger add-reviewer <reviewers...> -c <change-id> [options]
602
672
  ```
603
673
 
604
674
  **Options:**
605
- - `--xml` - XML output for automation
675
+ - `-c, --change <id>` Change ID (required)
676
+ - `--group` — Add as group
677
+ - `--cc` — Add as CC
678
+ - `--notify <level>` — `none`, `owner`, `owner_reviewers`, `all`
679
+ - `--xml` — XML output
606
680
 
607
- **Examples:**
608
- ```bash
609
- # List members
610
- ger groups-members project-reviewers
681
+ ---
611
682
 
612
- # List members by numeric ID
613
- ger groups-members 1
683
+ ### remove-reviewer
614
684
 
615
- # XML output
616
- ger groups-members project-reviewers --xml
617
- ```
685
+ Remove a reviewer from a change.
618
686
 
619
- **Output includes:**
620
- - Member name
621
- - Email address
622
- - Username
623
- - Account ID
687
+ **Syntax:**
688
+ ```bash
689
+ ger remove-reviewer <account> -c <change-id> [options]
690
+ ```
624
691
 
625
- **Notes:**
626
- - All group commands are read-only
627
- - Group operations do not support creating, modifying, or deleting groups
628
- - Use with `add-reviewer --group` to add teams as reviewers
692
+ **Options:**
693
+ - `-c, --change <id>` Change ID (required)
694
+ - `--notify <level>` `none`, `owner`, `owner_reviewers`, `all`
695
+ - `--xml` XML output
629
696
 
630
- ## Global Options
697
+ ---
631
698
 
632
- These options work with all commands:
699
+ ### groups
633
700
 
634
- - `--help` - Show help for command
635
- - `--version` - Show ger version
636
- - `--no-cache` - Skip cache and fetch fresh data
637
- - `--debug` - Enable debug logging
638
- - `--quiet` - Suppress non-essential output
701
+ List and search Gerrit groups.
639
702
 
640
- **Examples:**
703
+ **Syntax:**
641
704
  ```bash
642
- # Show help for a command
643
- ger show --help
705
+ ger groups [options]
706
+ ```
707
+
708
+ **Options:**
709
+ - `--pattern <regex>` — Filter by name pattern
710
+ - `--owned` — Show only groups you own
711
+ - `--project <name>` — Show groups for a project
712
+ - `--user <account>` — Show groups a user belongs to
713
+ - `--limit <n>` — Limit results (default: 25)
714
+ - `--xml` — XML output
715
+
716
+ ---
717
+
718
+ ### groups-show
644
719
 
645
- # Skip cache
646
- ger mine --no-cache
720
+ Show detailed information about a specific group.
647
721
 
648
- # Enable debug mode
649
- ger show 12345 --debug
722
+ **Syntax:**
723
+ ```bash
724
+ ger groups-show <group-id> [options]
650
725
  ```
651
726
 
652
- ## Exit Codes
727
+ **Options:**
728
+ - `--xml` — XML output
653
729
 
654
- - `0` - Success
655
- - `1` - General error
656
- - `2` - Invalid arguments
657
- - `3` - API error
658
- - `4` - Authentication error
659
- - `5` - Not found error
730
+ ---
660
731
 
661
- ## Environment Variables
732
+ ### groups-members
662
733
 
663
- - `GER_URL` - Gerrit server URL
664
- - `GER_USERNAME` - Gerrit username
665
- - `GER_PASSWORD` - Gerrit password/token
666
- - `GER_CACHE_DIR` - Cache directory path (default: `~/.ger/cache`)
667
- - `GER_LOG_LEVEL` - Log level: `debug`, `info`, `warn`, `error`
734
+ List all members of a group.
668
735
 
669
- **Example:**
736
+ **Syntax:**
670
737
  ```bash
671
- export GER_URL=https://gerrit.example.com
672
- export GER_LOG_LEVEL=debug
673
- ger mine
738
+ ger groups-members <group-id> [options]
674
739
  ```
675
740
 
676
- ## Cache Behavior
741
+ **Options:**
742
+ - `--xml` — XML output
677
743
 
678
- The ger CLI uses SQLite for local-first caching:
744
+ ---
679
745
 
680
- - **Changes** - Cached for 5 minutes
681
- - **Comments** - Cached for 2 minutes
682
- - **Diffs** - Cached for 10 minutes
683
- - **User data** - Cached for 1 hour
746
+ ## Configuration Commands
684
747
 
685
- Use `--no-cache` to bypass cache and fetch fresh data.
748
+ ### setup
686
749
 
687
- ## API Rate Limiting
750
+ Interactive first-time setup.
688
751
 
689
- The ger CLI respects Gerrit API rate limits:
752
+ ```bash
753
+ ger setup
754
+ ```
690
755
 
691
- - Maximum 100 requests per minute
692
- - Automatic retry with exponential backoff
693
- - Rate limit status shown in debug mode
756
+ Configures Gerrit URL, credentials, and retrigger comment.
694
757
 
695
- ## Error Handling
758
+ ### config
696
759
 
697
- All commands use Effect Schema for validation and provide clear error messages:
760
+ Manage ger CLI configuration.
698
761
 
762
+ **Syntax:**
699
763
  ```bash
700
- # Invalid change ID
701
- $ ger show invalid
702
- Error: Invalid change ID format. Expected number or Change-Id string.
764
+ ger config <action> [key] [value]
765
+ ```
703
766
 
704
- # Network error
705
- $ ger mine
706
- Error: Failed to connect to Gerrit server. Check your network connection.
767
+ **Actions:** `get`, `set`, `list`, `reset`
707
768
 
708
- # Permission error
709
- $ ger abandon 12345
710
- Error: Permission denied. You must be the change owner to abandon it.
769
+ **Examples:**
770
+ ```bash
771
+ ger config list
772
+ ger config get gerrit.url
773
+ ger config set gerrit.url https://gerrit.example.com
711
774
  ```
712
775
 
713
- ## Internationalization
776
+ ---
714
777
 
715
- The ger CLI supports multiple languages via i18next. Set your locale:
778
+ ## Auto-Detection
716
779
 
717
- ```bash
718
- export LANG=es_ES.UTF-8
719
- ger mine
720
- ```
780
+ These commands auto-detect the change from the HEAD commit's `Change-Id` footer when no change-id is provided:
781
+
782
+ `show`, `build-status`, `topic`, `rebase`, `extract-url`, `diff`, `comments`, `vote`, `retrigger`, `files`, `reviewers`
783
+
784
+ ---
785
+
786
+ ## Exit Codes
721
787
 
722
- Supported languages:
723
- - English (en)
724
- - Spanish (es)
725
- - French (fr)
726
- - German (de)
727
- - Japanese (ja)
728
- - Chinese (zh)
788
+ - `0` — Success
789
+ - `1` — General error (network, API, validation)
790
+ - `build-status --exit-status` returns non-zero on build failure