gitxplain 0.1.6 → 0.1.8

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,7 +2,7 @@ name: Release
2
2
  on:
3
3
  push:
4
4
  tags:
5
- - 'v*.*.*'
5
+ - '*.*.*'
6
6
  jobs:
7
7
  publish:
8
8
  runs-on: ubuntu-latest
package/README.md CHANGED
@@ -29,7 +29,6 @@ Supported providers:
29
29
  - Supports plain, JSON, Markdown, and HTML output
30
30
  - Supports clipboard copy, verbosity controls, and hook installation
31
31
  - Supports project-level and user-level config files
32
- - Falls back to an interactive prompt when no analysis flag is supplied
33
32
  - Returns plain text or JSON output
34
33
  - Uses native Node APIs only, so the MVP has no runtime dependencies
35
34
 
@@ -39,7 +38,7 @@ Supported providers:
39
38
  - A Git repository in your current working directory
40
39
  - An API key for your chosen provider, or a local Ollama instance
41
40
 
42
- Optional environment variables:
41
+ Optional advanced environment variables:
43
42
 
44
43
  - `LLM_PROVIDER` default: `openai`
45
44
  - `LLM_MODEL` optional shared model override
@@ -55,7 +54,7 @@ Optional environment variables:
55
54
  Optional config files:
56
55
 
57
56
  - Project: `.gitxplainrc` or `.gitxplainrc.json`
58
- - User: `~/.gitxplain/config.json`
57
+ - User: `~/.gitxplain/config.json` on macOS/Linux, or `%USERPROFILE%\.gitxplain\config.json` on Windows
59
58
 
60
59
  You can start from:
61
60
 
@@ -65,84 +64,344 @@ cp .env.example .env
65
64
 
66
65
  ## Usage
67
66
 
67
+ Show the built-in command reference.
68
+
69
+ ```bash
70
+ gitxplain --help
71
+ ```
72
+
73
+ Save the default AI provider.
74
+
75
+ ```bash
76
+ gitxplain config set provider <name>
77
+ ```
78
+
79
+ Save the API key for a provider.
80
+
81
+ ```bash
82
+ gitxplain config set api-key <value> [--provider <name>]
83
+ ```
84
+
85
+ Print one saved config value, or all of them.
86
+
87
+ ```bash
88
+ gitxplain config get [key]
89
+ ```
90
+
91
+ List saved user config values.
92
+
93
+ ```bash
94
+ gitxplain config list
95
+ ```
96
+
97
+ Analyze a single commit.
98
+
99
+ ```bash
100
+ gitxplain <commit-id> [options]
101
+ ```
102
+
103
+ Analyze a commit range.
104
+
105
+ ```bash
106
+ gitxplain <start>..<end> [options]
107
+ ```
108
+
109
+ Compare the current branch to a base branch.
110
+
111
+ ```bash
112
+ gitxplain --branch [base-ref] [options]
113
+ ```
114
+
115
+ Compare the current branch like a PR.
116
+
117
+ ```bash
118
+ gitxplain --pr [base-ref] [options]
119
+ ```
120
+
121
+ Plan commits for uncommitted working tree changes.
122
+
68
123
  ```bash
69
- gitxplain help
70
- gitxplain branch -a
71
- gitxplain checkout -b feature/demo
72
- gitxplain commit
73
124
  gitxplain --commit
74
- gitxplain merge
125
+ ```
126
+
127
+ Show release branch health and next steps.
128
+
129
+ ```bash
130
+ gitxplain --release [status]
131
+ ```
132
+
133
+ Preview or execute a release merge.
134
+
135
+ ```bash
75
136
  gitxplain --merge
76
- gitxplain tag
137
+ ```
138
+
139
+ Preview or create release tags.
140
+
141
+ ```bash
77
142
  gitxplain --tag
78
- gitxplain release
79
- gitxplain release status
80
- gitxplore tag
81
- gitxplore --tag
82
- gitxplain log --log
83
- gitxplain status
143
+ ```
144
+
145
+ Print repository log output.
146
+
147
+ ```bash
148
+ gitxplain --log
149
+ ```
150
+
151
+ Print repository status output.
152
+
153
+ ```bash
84
154
  gitxplain --status
85
- gitxplain pipeline
155
+ ```
156
+
157
+ Detect and generate CI/CD workflow files.
158
+
159
+ ```bash
86
160
  gitxplain --pipeline
87
- gitxplain add README.md
88
- gitxplain remove README.md
89
- gitxplain remove hard
90
- gitxplain del scratch.txt
91
- gitxplain bin
92
- gitxplain pop
93
- gitxplain pop 2
94
- gitxplain pull
95
- gitxplain pull origin main
96
- gitxplain push
97
- gitxplain push origin main
98
- gitxplain <commit-id>
99
- gitxplain <commit-id> --summary
100
- gitxplain <commit-id> --issues
101
- gitxplain <commit-id> --fix
102
- gitxplain <commit-id> --impact
103
- gitxplain <commit-id> --full
104
- gitxplain <commit-id> --lines
105
- gitxplain <commit-id> --review
106
- gitxplain <commit-id> --security
107
- gitxplain <commit-id> --split
108
- gitxplain --commit --execute
109
- gitxplain merge
110
- gitxplain --merge --execute
111
- gitxplain tag
112
- gitxplain --tag --execute
113
- gitxplain <commit-id> --json
114
- gitxplain <commit-id> --markdown
115
- gitxplain <commit-id> --html
116
- gitxplain <commit-id> --stream
117
- gitxplain <commit-id> --clipboard
118
- gitxplain <commit-id> --verbose
119
- gitxplain <commit-id> --quiet
120
- gitxplain log --log
121
- gitxplain <start>..<end> --markdown
122
- gitxplain --branch main --review
123
- gitxplain --pr origin/main --security
124
- gitxplain install-hook
125
- gitxplain <commit-id> --provider openrouter --model anthropic/claude-3.7-sonnet
126
- gitxplain <commit-id> --provider chutes --model deepseek-ai/DeepSeek-V3-0324
127
- gitxplain <commit-id> --split --execute
128
161
  ```
129
162
 
130
- Examples:
163
+ Analysis:
164
+
165
+ Generate a one-line summary.
166
+
167
+ ```bash
168
+ --summary
169
+ ```
170
+
171
+ Focus on the issue being fixed.
172
+
173
+ ```bash
174
+ --issues
175
+ ```
176
+
177
+ Explain the fix in simple terms.
178
+
179
+ ```bash
180
+ --fix
181
+ ```
182
+
183
+ Explain behavior changes before vs after.
184
+
185
+ ```bash
186
+ --impact
187
+ ```
188
+
189
+ Generate the full structured analysis.
190
+
191
+ ```bash
192
+ --full
193
+ ```
194
+
195
+ Walk through the changed code file by file.
196
+
197
+ ```bash
198
+ --lines
199
+ ```
200
+
201
+ Generate review findings and risks.
202
+
203
+ ```bash
204
+ --review
205
+ ```
206
+
207
+ Focus on security-relevant changes.
208
+
209
+ ```bash
210
+ --security
211
+ ```
212
+
213
+ Propose splitting a commit into smaller commits.
214
+
215
+ ```bash
216
+ --split
217
+ ```
218
+
219
+ Propose commits for current working tree changes.
220
+
221
+ ```bash
222
+ --commit
223
+ ```
224
+
225
+ Apply a split, commit, merge, or tag plan.
226
+
227
+ ```bash
228
+ --execute
229
+ ```
230
+
231
+ Preview a plan without applying it.
232
+
233
+ ```bash
234
+ --dry-run
235
+ ```
236
+
237
+ Release:
238
+
239
+ Show release status details.
240
+
241
+ ```bash
242
+ --release [status]
243
+ ```
244
+
245
+ Preview or apply a merge into the release branch.
246
+
247
+ ```bash
248
+ --merge
249
+ ```
250
+
251
+ Preview or create release tags from version bumps.
252
+
253
+ ```bash
254
+ --tag
255
+ ```
256
+
257
+ Repo:
258
+
259
+ Print the current repository log.
260
+
261
+ ```bash
262
+ --log
263
+ ```
264
+
265
+ Print the current working tree status.
266
+
267
+ ```bash
268
+ --status
269
+ ```
270
+
271
+ Inspect the repo and create CI/CD workflow files.
272
+
273
+ ```bash
274
+ --pipeline
275
+ ```
276
+
277
+ Quick Actions:
278
+
279
+ Persist provider, model, and API key settings.
280
+
281
+ ```bash
282
+ config
283
+ ```
284
+
285
+ Stage one or more files.
286
+
287
+ ```bash
288
+ add
289
+ ```
290
+
291
+ Unstage one or more files.
292
+
293
+ ```bash
294
+ remove
295
+ ```
296
+
297
+ Hard reset the repository to HEAD.
298
+
299
+ ```bash
300
+ remove hard
301
+ ```
302
+
303
+ Delete one or more files from the working tree.
304
+
305
+ ```bash
306
+ del
307
+ ```
308
+
309
+ Soft reset `HEAD~1` and keep your changes.
310
+
311
+ ```bash
312
+ bin
313
+ ```
314
+
315
+ Pop a stash entry.
316
+
317
+ ```bash
318
+ pop
319
+ ```
320
+
321
+ Run `git pull`.
322
+
323
+ ```bash
324
+ pull
325
+ ```
326
+
327
+ Run `git push`.
328
+
329
+ ```bash
330
+ push
331
+ ```
332
+
333
+ Install the `gitxplain` hook.
334
+
335
+ ```bash
336
+ install-hook
337
+ ```
338
+
339
+ Pass through to native Git commands.
131
340
 
132
341
  ```bash
133
- npm start -- HEAD~1 --summary
134
- npm start -- commit
135
- npm start -- merge
136
- npm start -- tag
137
- npm start -- log --log
138
- npm start -- a1b2c3d --full
139
- npm start -- HEAD~1 --lines
140
- npm start -- HEAD~5..HEAD --markdown
141
- npm start -- --branch main --review
142
- npm start -- HEAD~1 --provider groq --model llama-3.3-70b-versatile
143
- npm start -- HEAD~1 --provider gemini --model gemini-2.5-flash
144
- npm start -- HEAD~1 --provider chutes --model deepseek-ai/DeepSeek-V3-0324
145
- npm start -- HEAD --split --execute
342
+ git
343
+ ```
344
+
345
+ Output:
346
+
347
+ Override the configured provider for one command.
348
+
349
+ ```bash
350
+ --provider <name>
351
+ ```
352
+
353
+ Override the configured model for one command.
354
+
355
+ ```bash
356
+ --model <name>
357
+ ```
358
+
359
+ Return JSON output.
360
+
361
+ ```bash
362
+ --json
363
+ ```
364
+
365
+ Return Markdown output.
366
+
367
+ ```bash
368
+ --markdown
369
+ ```
370
+
371
+ Return HTML output.
372
+
373
+ ```bash
374
+ --html
375
+ ```
376
+
377
+ Reduce extra console output.
378
+
379
+ ```bash
380
+ --quiet
381
+ ```
382
+
383
+ Show extra response metadata.
384
+
385
+ ```bash
386
+ --verbose
387
+ ```
388
+
389
+ Copy the final output to the clipboard.
390
+
391
+ ```bash
392
+ --clipboard
393
+ ```
394
+
395
+ Stream model output as it arrives.
396
+
397
+ ```bash
398
+ --stream
399
+ ```
400
+
401
+ Limit diff size before sending it to the model.
402
+
403
+ ```bash
404
+ --max-diff-lines <n>
146
405
  ```
147
406
 
148
407
  ## Running The CLI
@@ -150,16 +409,15 @@ npm start -- HEAD --split --execute
150
409
  To use the actual `gitxplain` command directly:
151
410
 
152
411
  ```bash
153
- cd /home/guru/Dev/gitxplain
154
412
  npm link
155
413
  ```
156
414
 
415
+ Run that from the repository root. `npm link` works on Windows, macOS, and Linux, though it may require elevated privileges depending on your Node/npm install prefix.
416
+
157
417
  Then from any Git repository:
158
418
 
159
419
  ```bash
160
- gitxplain help
161
- gitxplain --connect-github <token>
162
- gitxplain --boot
420
+ gitxplain --help
163
421
  gitxplain HEAD~1 --full
164
422
  gitxplain a1b2c3d --summary
165
423
  gitxplain HEAD~1 --lines
@@ -167,29 +425,10 @@ gitxplain HEAD~5..HEAD --markdown
167
425
  gitxplain --branch main --review
168
426
  ```
169
427
 
170
- Inside `gitxplain --boot`, the session now prints the available interactive commands on startup. You can also type `help` at any time to re-display:
171
-
172
- - `help`
173
- - `repos`
174
- - `issues`
175
- - `status`
176
- - `download`
177
- - `clear`
178
- - `exit`
179
-
180
- The `gitxplain help` command also prints quick API-key setup examples for:
181
-
182
- - OpenAI
183
- - Groq
184
- - OpenRouter
185
- - Gemini
186
- - Ollama
187
- - Chutes AI
188
-
189
428
  If you do not want to link it globally, you can still run it locally:
190
429
 
191
430
  ```bash
192
- node /home/guru/Dev/gitxplain/cli/index.js HEAD~1 --full
431
+ node ./cli/index.js HEAD~1 --full
193
432
  ```
194
433
 
195
434
  ## Output Modes
@@ -205,36 +444,33 @@ node /home/guru/Dev/gitxplain/cli/index.js HEAD~1 --full
205
444
  - `--split`: propose how to split a commit into multiple atomic commits
206
445
  - `--merge`: preview or execute a merge into the `release` branch based on detected version bumps
207
446
  - `--tag`: preview or create release tags from the same detected version windows
208
- - `release status`: inspect release branch health, missing tags, source-vs-release drift, and the next recommended action
447
+ - `--release [status]`: inspect release branch health, missing tags, source-vs-release drift, and the next recommended action
209
448
  - `--commit`: propose commits for current uncommitted changes
210
449
  - `--log`: print Git log entries for the current repository
211
450
  - `--status`: print Git working tree status for the current repository
212
- - `pipeline` or `--pipeline`: inspect the current repository and generate GitHub Actions CI/CD workflows
451
+ - `--pipeline`: inspect the current repository and generate GitHub Actions CI/CD workflows
213
452
  - `--execute`: apply a proposed split by rewriting history
214
453
  - `--dry-run`: preview the split or commit plan without applying it
215
454
  - `--json`: return structured JSON instead of formatted text
216
455
  - `--markdown`: return Markdown output
217
456
  - `--html`: return HTML output
218
457
 
219
- If no analysis flag is supplied, the CLI asks what kind of explanation you want.
220
-
221
458
  ## Repository Log
222
459
 
223
460
  Print recent log entries from the current repository:
224
461
 
225
462
  ```bash
226
- gitxplain log
227
463
  gitxplain --log
228
464
  ```
229
465
 
230
- Both forms print the repository history in a compact one-line format using the current repository, without calling the LLM.
466
+ This prints the repository history in a compact one-line format using the current repository, without calling the LLM.
231
467
 
232
468
  ## Quick Actions
233
469
 
234
470
  Run a few common Git actions directly through `gitxplain`:
235
471
 
236
472
  ```bash
237
- gitxplain status
473
+ gitxplain --status
238
474
  gitxplain add README.md
239
475
  gitxplain remove README.md
240
476
  gitxplain remove hard
@@ -317,7 +553,6 @@ Warning: `--split --execute` rewrites history. If the commit was already pushed,
317
553
  Preview the release merge plan for the current branch:
318
554
 
319
555
  ```bash
320
- gitxplain merge
321
556
  gitxplain --merge
322
557
  ```
323
558
 
@@ -334,9 +569,7 @@ This command scans commits on your current branch after the branch split point a
334
569
  Preview the release tags for the current branch:
335
570
 
336
571
  ```bash
337
- gitxplain tag
338
572
  gitxplain --tag
339
- gitxplore tag
340
573
  gitxplore --tag
341
574
  ```
342
575
 
@@ -347,14 +580,13 @@ gitxplain --tag --execute
347
580
  gitxplore --tag --execute
348
581
  ```
349
582
 
350
- This command uses the same release-window detection as `merge`. It scans commits on your current branch after the branch split point, detects version bumps from version-file diffs, and maps each unreleased version to the last commit in that release window. By default it creates annotated tags named exactly after the detected version, such as `1.2.3`.
583
+ This command scans the full history of your current branch, detects version bumps from version-file diffs, and maps each untagged detected version to the last commit in that version window. It works independently from the `merge` workflow and does not require a `release` branch. By default it creates annotated tags named exactly after the detected version, such as `1.2.3`.
351
584
 
352
585
  ## Commit Working Tree
353
586
 
354
587
  Preview how the current uncommitted changes should be committed:
355
588
 
356
589
  ```bash
357
- gitxplain commit
358
590
  gitxplain --commit
359
591
  ```
360
592
 
@@ -390,6 +622,15 @@ Example `.gitxplainrc`:
390
622
 
391
623
  CLI flags still override config values for a single command.
392
624
 
625
+ You can also save provider settings permanently with the CLI:
626
+
627
+ ```bash
628
+ gitxplain config set provider openai
629
+ gitxplain config set api-key your_key
630
+ gitxplain config set model gpt-4.1-mini
631
+ gitxplain config list
632
+ ```
633
+
393
634
  ## Clipboard, Streaming, And Hooks
394
635
 
395
636
  Copy the final output to your clipboard:
@@ -412,48 +653,34 @@ gitxplain install-hook
412
653
 
413
654
  ## Provider Setup
414
655
 
415
- OpenAI:
656
+ Recommended persistent setup:
416
657
 
417
658
  ```bash
418
- export LLM_PROVIDER=openai
419
- export OPENAI_API_KEY=your_key
659
+ gitxplain config set provider openai
660
+ gitxplain config set api-key your_key
420
661
  ```
421
662
 
422
- Groq:
663
+ You can also save a default model:
423
664
 
424
665
  ```bash
425
- export LLM_PROVIDER=groq
426
- export GROQ_API_KEY=your_key
666
+ gitxplain config set model gpt-4.1-mini
427
667
  ```
428
668
 
429
- OpenRouter:
669
+ You can switch providers later:
430
670
 
431
671
  ```bash
432
- export LLM_PROVIDER=openrouter
433
- export OPENROUTER_API_KEY=your_key
672
+ gitxplain config set provider groq
673
+ gitxplain config set api-key your_key
434
674
  ```
435
675
 
436
- Gemini:
676
+ If you want to inspect what is saved:
437
677
 
438
678
  ```bash
439
- export LLM_PROVIDER=gemini
440
- export GEMINI_API_KEY=your_key
679
+ gitxplain config list
680
+ gitxplain config get provider
441
681
  ```
442
682
 
443
- Ollama:
444
-
445
- ```bash
446
- export LLM_PROVIDER=ollama
447
- export OLLAMA_MODEL=llama3.2
448
- ```
449
-
450
- Chutes AI:
451
-
452
- ```bash
453
- export LLM_PROVIDER=chutes
454
- export CHUTES_API_KEY=your_key
455
- export CHUTES_MODEL=deepseek-ai/DeepSeek-V3-0324
456
- ```
683
+ Saved user settings live in `~/.gitxplain/config.json` on macOS/Linux, or `%USERPROFILE%\.gitxplain\config.json` on Windows.
457
684
 
458
685
  ## Development
459
686
 
@@ -467,3 +694,5 @@ To make the command globally available during local development:
467
694
  ```bash
468
695
  npm link
469
696
  ```
697
+
698
+ Run this from the repository root. On some systems, you may need an elevated shell depending on where npm installs global links.