gitbasher 4.0.0 → 5.0.0

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +151 -40
  3. package/dist/gitb +3453 -914
  4. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to gitbasher are generated automatically by [semantic-release](https://github.com/semantic-release/semantic-release) from [Conventional Commits](https://www.conventionalcommits.org/) on `main`. The project follows [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## [5.0.0](https://github.com/maxbolgarin/gitbasher/compare/v4.1.0...v5.0.0) (2026-07-03)
6
+
7
+ ## [4.1.0](https://github.com/maxbolgarin/gitbasher/compare/v4.0.0...v4.1.0) (2026-05-29)
8
+
9
+ ### 🚀 Features
10
+
11
+ * **edit:** add `branch` mode to rename the current branch ([30cfd07](https://github.com/maxbolgarin/gitbasher/commit/30cfd071d49e73761f7853b8ca9643d0db50d9b4))
12
+ * **edit:** add `gitb edit` and retire the commit `last` action ([51d3ca2](https://github.com/maxbolgarin/gitbasher/commit/51d3ca2c6d1e41a7dac506d05723cb7469b7ce41))
13
+ * **edit:** add `pick` mode to reword any recent commit ([175cbd7](https://github.com/maxbolgarin/gitbasher/commit/175cbd73d29cb14c3f436b543b150b4e7cd6fd2d))
14
+ * **site:** add Astro marketing site for GitHub Pages ([df1c1eb](https://github.com/maxbolgarin/gitbasher/commit/df1c1eb3925bd73156abd87150638ac74d73f9df))
15
+ * **clone:** add gitb clone command ([ac377b2](https://github.com/maxbolgarin/gitbasher/commit/ac377b2e76378742289b632e117eca07bb3b09da))
16
+ * **commit:** allow push modifier on revert ([cdb86b4](https://github.com/maxbolgarin/gitbasher/commit/cdb86b4c643db3d4fc2c2a68f2e931670729d04c))
17
+ * **gitb:** allow running outside a git repository for global commands ([8eeeefe](https://github.com/maxbolgarin/gitbasher/commit/8eeeefef3839a43fd009cfa3f57f8ed6628fb259))
18
+ * **commit:** cap atomic split at a configurable number of scopes ([15103d8](https://github.com/maxbolgarin/gitbasher/commit/15103d8234a54d6b329b921b1d412cfa8b4598e3))
19
+ * **push:** retry transient network failures with exponential backoff ([80f8d32](https://github.com/maxbolgarin/gitbasher/commit/80f8d32709aaf5759689f48be6f75979cdf40fe0))
20
+ * **pull:** stream git fetch progress live during gitb pull ([92ed00d](https://github.com/maxbolgarin/gitbasher/commit/92ed00de9b8c4cc9ed954ad0d59a92c83361569c))
21
+
22
+ ### 🐛 Bug Fixes
23
+
24
+ * **gitb:** escape command substitution in macOS upgrade instructions ([f61db10](https://github.com/maxbolgarin/gitbasher/commit/f61db101c97527d101d6787e4b0aca625c8f55e5))
25
+ * **commit:** honor push modifier when amending ([f5d2664](https://github.com/maxbolgarin/gitbasher/commit/f5d26640ab4ded146fcf1231200e99a1ddb91e9a))
26
+ * **commit:** strip leading/trailing separators from auto scopes ([3fee1c8](https://github.com/maxbolgarin/gitbasher/commit/3fee1c8456ae6a171618efbbba87d81dfc5a9c6a))
27
+
5
28
  ## [4.0.0](https://github.com/maxbolgarin/gitbasher/compare/v3.10.2...v4.0.0) (2026-05-04)
6
29
 
7
30
  ### ⚠ BREAKING CHANGES
package/README.md CHANGED
@@ -10,6 +10,13 @@
10
10
  <a href="https://github.com/maxbolgarin/gitbasher/actions"><img src="https://github.com/maxbolgarin/gitbasher/actions/workflows/build.yml/badge.svg" alt="Build Status"></a>
11
11
  </p>
12
12
 
13
+ <p align="center">
14
+ <a href="https://maxbolgarin.github.io/gitbasher/"><strong>Website</strong></a> ·
15
+ <a href="#install-in-10-seconds">Install</a> ·
16
+ <a href="#all-features-at-a-glance">Features</a> ·
17
+ <a href="./FAQ.md">FAQ</a>
18
+ </p>
19
+
13
20
  <p align="center">
14
21
  <img src=".github/commit.gif" width="640" alt="gitb commit demo" />
15
22
  </p>
@@ -104,7 +111,7 @@ Every command has a short alias (`gitb c`, `gitb p`, `gitb pu`, `gitb b`, `gitb
104
111
  - **AI commit messages** — `gitb c ai` writes the message from your diff. OpenRouter (Gemini/Claude/GPT/…), OpenAI direct, or **fully local via Ollama** — no key, no network, no data leaves your machine.
105
112
  - **Safer git** — push/pull detect conflicts up front, `undo` rolls back commit/amend/merge/rebase/stash, `reset` is interactive with a preview.
106
113
  - **Whole workflows, not just commands** — `sync`, `wip`, `branch newd`, `merge to-main`, `squash` chain the steps you'd otherwise do by hand.
107
- - **One file, no deps** — pure bash. Drop the binary anywhere on `PATH` and go. **115+ BATS tests** cover sanitization, git ops, and branch logic.
114
+ - **One file, no deps** — pure bash for every git operation; only the AI features need `jq` and `curl`. Drop the binary anywhere on `PATH` and go. **870+ BATS tests** cover sanitization, git ops, and branch logic.
108
115
 
109
116
  <p align="center">
110
117
  <img src=".github/push.gif" width="640" alt="gitb push demo" />
@@ -116,20 +123,20 @@ Every command has a short alias (`gitb c`, `gitb p`, `gitb pu`, `gitb b`, `gitb
116
123
 
117
124
  | Group | Commands | What you get |
118
125
  |-------|----------|--------------|
119
- | **Commit** | `commit` (`c`) | Interactive conventional commits, fast-mode, AI messages, atomic split, fixup, amend, last-message edit, revert |
120
- | **Sync remote** | `push` (`p`), `pull` (`pu`), `sync` (`sy`) | Safe push (with force/list), smart pull (rebase / merge / ff), one-shot rebase-on-main with optional force-push |
126
+ | **Commit** | `commit` (`c`), `edit` (`ed`) | Interactive conventional commits, fast-mode, AI messages, atomic split, fixup, amend, revert; `gitb edit` reworks the last commit message, picks any commit to reword, or renames the current branch |
127
+ | **Sync remote** | `push` (`p`), `pull` (`pu`), `fetch` (`fe`), `sync` (`sy`) | Safe push (with force/list), smart pull (rebase / merge / ff), fetch-only with prune, one-shot rebase-on-main with optional force-push |
121
128
  | **Branches** | `branch` (`b`), `prev` (`-`) | List / switch / create-from-current / create-from-updated-main / delete (orphaned, merged, gone) / recent / previous / checkout-tag |
122
129
  | **Integration** | `merge` (`m`), `rebase` (`r`), `squash` (`sq`), `cherry` (`ch`) | Merge into current / into main / from remote · rebase onto main / interactive / autosquash / fastautosquash / pull-commits · AI-driven squash of branch commits into changelog-ready history · cherry-pick by hash, range, or interactive |
123
130
  | **Tags & releases** | `tag` (`t`) | Lightweight, annotated, from-commit, push, push-all, delete, delete-all, list, fetch-remote |
124
131
  | **Save & rollback** | `wip` (`up`/`down`), `undo` (`un`), `reset` (`res`), `stash` (`st`) | Save WIP via stash / branch / worktree (auto-detected on restore) · undo last commit/amend/merge/rebase/stash · interactive reset · full stash menu |
125
132
  | **Worktrees** | `worktree` (`wt`) | Add / list / remove / move / lock / prune git worktrees, with new branch from current/main or from existing/remote branches |
126
- | **Inspect** | `status` (`s`), `log` (`l`), `reflog` (`rl`), `last-commit` (`lc`), `last-ref` (`lr`) | Pretty repo status, multi-mode log + search, reflog viewer, quick last-commit / last-ref summary |
133
+ | **Inspect** | `status` (`s`), `diff` (`d`), `log` (`l`), `reflog` (`rl`), `last-commit` (`lc`), `last-ref` (`lr`) | Pretty repo status, overview-first diffs with a file picker + AI summary, multi-mode log + search, reflog viewer, quick last-commit / last-ref summary |
127
134
  | **Hooks** | `hook` (`ho`) | List / create from templates / edit / toggle / remove / test / show — for every git hook |
128
135
  | **Repo setup** | `init` (`i`), `origin` (`or`, `o`, `remote`) | `git init` from gitbasher · add/change/rename/remove the remote origin |
129
136
  | **Config** | `config` (`cfg`) | User, default branch, separator, editor, ticket prefix, scopes, AI provider/key/model, proxy, completion |
130
137
  | **Lifecycle** | `update` (`up`), `uninstall` (`uns`) | Self-update from latest GitHub release · one-shot uninstall (config + binary) |
131
138
 
132
- Total: **24 top-level commands**, **60+ aliases**, **100+ modes**.
139
+ Total: **31 top-level commands**, **60+ aliases**, **100+ modes**.
133
140
 
134
141
  ---
135
142
 
@@ -161,9 +168,9 @@ gitb sync merge # use merge instead of rebase
161
168
  ### Save WIP across machines / branches
162
169
  ```bash
163
170
  gitb wip up # stash changes + push backup to origin/wip/<branch>
164
- # … on another machine …
165
- gitb pull # fetch the wip/<branch>
166
- gitb wip down # pop the wip stash and remove the remote backup
171
+ # … on another machine: fetch the backup branch and restore it manually …
172
+ git fetch origin wip/<branch>
173
+ git merge --squash --no-commit origin/wip/<branch>
167
174
  ```
168
175
 
169
176
  ### Hotfix
@@ -301,8 +308,10 @@ git config gitbasher.ai-base-url http://my-gateway:4000/v1/chat/completions
301
308
  | Command | Aliases | Description |
302
309
  |---------|---------|-------------|
303
310
  | [`commit`](#gitb-commit) | `c` `co` `com` | Create commits (interactive, fast, AI, split, fixup, amend, revert, …) |
311
+ | [`edit`](#gitb-edit) | `ed` `ee` | Rewrite the last commit message, reword an older commit, or rename the current branch |
304
312
  | [`push`](#gitb-push) | `p` `ps` `pus` | Push with conflict handling, force, or list-only |
305
313
  | [`pull`](#gitb-pull) | `pu` `pl` `pul` | Smart pull: rebase / merge / ff / fetch-only / interactive / dry-run |
314
+ | [`fetch`](#gitb-fetch) | `fe` | Fetch without merging: current branch, all remotes, or prune |
306
315
  | [`branch`](#gitb-branch) | `b` `br` `bran` | Switch / list / create / delete / recent / gone / checkout-tag |
307
316
  | [`tag`](#gitb-tag) | `t` `tg` | Create, push, list, delete tags (lightweight & annotated) |
308
317
  | [`merge`](#gitb-merge) | `m` `me` | Merge into current, into main, or from remote |
@@ -318,9 +327,13 @@ git config gitbasher.ai-base-url http://my-gateway:4000/v1/chat/completions
318
327
  | [`hook`](#gitb-hook) | `ho` `hk` | Manage git hooks: list, create, edit, toggle, remove, test, show |
319
328
  | [`origin`](#gitb-origin) | `or` `o` `remote` | Add, change, rename, or remove the remote origin |
320
329
  | [`init`](#gitb-init) | `i` | `git init` + optional origin setup prompt |
330
+ | `clone` | `cl` `clo` | Clone a repository and set up gitbasher in it |
331
+ | `update` | `up` `upd` | Self-update gitb to the latest release |
332
+ | [`uninstall`](#uninstall) | `uns` `uni` | Remove the binary and `gitbasher.*` config keys |
321
333
  | [`config`](#gitb-config) | `cf` `cfg` `conf` | Configure user, branch, AI, scopes, ticket prefix, etc. |
322
- | [`log`](#gitb-log) | `l` `lg` | Pretty log: current, branch, compare, search |
334
+ | [`log`](#gitb-log) | `l` `lg` | Interactive commit browser; also branch, compare, search, and full-dump modes |
323
335
  | [`status`](#info-commands) | `s` | Repo status and changed files |
336
+ | [`diff`](#gitb-diff) | `d` `di` | Overview-first diffs: staged, all, branch, commit, AI summary |
324
337
  | [`reflog`](#info-commands) | `rl` `rlg` | Pretty reflog |
325
338
  | [`last-commit`](#info-commands) | `lc` `lastc` | Show the last commit |
326
339
  | [`last-ref`](#info-commands) | `lr` `lastr` | Show the last reference |
@@ -345,9 +358,9 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
345
358
  | `split` | `sp` `sl` | Split staged changes into one commit per detected scope |
346
359
  | `fixup` | `x` `fix` | Create a `--fixup` commit against an older commit |
347
360
  | `amend` | `a` `am` | Add changes into the last commit (no message edit) |
348
- | `last` | `l` | Rewrite the last commit message |
349
361
  | `revert` | `rev` | Revert a commit (`git revert --no-edit`) |
350
362
  | `ff` | | Ultrafast: `ai + split + fast` with no prompts (use `ffp` to also push) |
363
+ | `sff` | `ffst` | Like `ff` but on already-staged files (no `git add .`); use `sffp` to also push |
351
364
  | `help` | `h` `--help` `-h` | Show inline help |
352
365
 
353
366
  **Modifiers** — stack with an action, any order.
@@ -371,16 +384,47 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
371
384
  | `gitb commit fast` | `git add .` then enter a message |
372
385
  | `gitb commit ai fast push` | AI message + add all + commit + push |
373
386
  | `gitb commit aifp` | Same as above (compact form) |
374
- | `gitb commit ai split push` | AI groups staged files into commits, then push |
387
+ | `gitb commit ai split push` | AI groups staged files into commits by feature, then push |
375
388
  | `gitb commit fixup push` | Pick an older commit, fixup it, then push |
376
389
  | `gitb commit amend fast` | Add all current changes into the last commit |
377
390
  | `gitb commit ff` | Full auto: AI splits and writes everything |
391
+ | `gitb commit sffp` | Full auto on already-staged files: AI splits, writes, pushes |
378
392
 
379
393
  **How modes combine**
380
394
  - Word order doesn't matter: `ai fast push` == `push fast ai` == `aifp`.
381
395
  - Modifiers stack on actions: `ai+fixup`, `fast+amend`, `split+push`, `ai+staged`, …
382
396
  - `fast` and `staged` are mutually exclusive (one stages all, the other uses what's staged).
383
- - `last` and `revert` take no modifiers; `ff` only accepts `push` (as `ffp`).
397
+ - `revert` and `ff` only accept `push` (as `revp` / `ffp`); to rewrite the last commit message use [`gitb edit`](#gitb-edit).
398
+
399
+ ### `gitb edit`
400
+
401
+ Rewrites a **commit message** or the **current branch name** without touching the tree.
402
+
403
+ ```bash
404
+ gitb edit # reword the LAST commit (git commit --amend)
405
+ gitb edit pick # choose any recent commit and reword it via rebase
406
+ gitb edit branch # rename the current branch (interactive)
407
+ gitb edit branch feat/new-name # rename the current branch to feat/new-name
408
+ gitb edit help # show inline help
409
+ ```
410
+
411
+ Modes:
412
+
413
+ | Mode | Aliases | Description |
414
+ |------|---------|-------------|
415
+ | `<empty>` | | Reword the last commit (`git commit --amend`) |
416
+ | `pick` | `p` `c` `choose` | Pick any recent commit, reword via non-interactive rebase |
417
+ | `branch` | `b` `br` `rename` `ren` | Rename the current branch (`git branch -m`); optional remote sync |
418
+ | `help` | `h` `--help` `-h` | Show inline help |
419
+
420
+ Notes:
421
+
422
+ - `pick` requires a clean working tree (the rebase replays subsequent commits).
423
+ - Merge commits and the root commit cannot be reworded this way.
424
+ - If the commit was already pushed, run `gitb push force` afterwards.
425
+ - `branch` offers to push the new name and delete the old one on the remote when an upstream exists.
426
+ - To add staged changes into the last commit, use `gitb commit amend` instead.
427
+ - To undo the change, use `gitb undo amend` (for plain edit) or `gitb undo rebase` (for `pick`).
384
428
 
385
429
  ### `gitb push`
386
430
 
@@ -392,10 +436,12 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
392
436
  | `<empty>` | | Show commits, push with conflict handling |
393
437
  | `yes` | `y` | Push without confirmation |
394
438
  | `force` | `f` | Force push (use after rebase/amend) |
395
- | `list` | `log` `l` | List unpushed commits only |
439
+ | `list` | `log` `l` | List unpushed commits + estimated push size and large-file warnings |
396
440
 
397
441
  </details>
398
442
 
443
+ Quick pushes stay clean — git's live progress bar appears only when a transfer runs long (same for `pull`/`fetch`). gitbasher also estimates the transfer size first, warning you before you push a stray non-code object (e.g. a build artifact or dataset). Tune the threshold with `gitb cfg push-size` (default 50 MB, `0` disables).
444
+
399
445
  ### `gitb pull`
400
446
 
401
447
  <details>
@@ -406,7 +452,7 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
406
452
  | `<empty>` | | Smart pull (strategy picker) |
407
453
  | `fetch` | `fe` | Fetch only |
408
454
  | `all` | `fa` | Fetch all branches |
409
- | `upd` | `u` | Update remote refs / prune |
455
+ | `upd` | `u` | Update remote refs (`git remote update`) |
410
456
  | `ffonly` | `ff` | Fast-forward only |
411
457
  | `merge` | `m` | Always create merge commit |
412
458
  | `rebase` | `r` | Rebase current onto remote |
@@ -415,6 +461,19 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
415
461
 
416
462
  </details>
417
463
 
464
+ ### `gitb fetch`
465
+
466
+ <details>
467
+ <summary>All fetch modes</summary>
468
+
469
+ | Mode | Aliases | Description |
470
+ |------|---------|-------------|
471
+ | `<empty>` | | Fetch the current branch without merging |
472
+ | `all` | `a` `fa` | Fetch every remote branch without merging |
473
+ | `prune` | `p` `pr` | Fetch and drop branches deleted on the remote |
474
+
475
+ </details>
476
+
418
477
  ### `gitb branch`
419
478
 
420
479
  <details>
@@ -427,8 +486,8 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
427
486
  | `remote` | `re` `r` | Fetch and switch to a remote branch |
428
487
  | `main` | `def` `m` | Quick-switch to default branch |
429
488
  | `tag` | `t` | Checkout to a specific tag |
430
- | `new` | `n` `c` | Create branch from current |
431
- | `newd` | `nd` `cd` | Switch to main, pull, branch off |
489
+ | `new` | `n` `c` | Create branch from current (offers to push it to the remote) |
490
+ | `newd` | `nd` `cd` | Switch to main, pull, branch off (offers to push it to the remote) |
432
491
  | `delete` | `del` `d` | Delete branches (orphaned, merged, or selected) |
433
492
  | `prev` | `p` `-` | Switch to previous branch (`cd -`) |
434
493
  | `recent` | `rc` | Pick from recently checked-out branches |
@@ -467,6 +526,7 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
467
526
  | `main` | `master` `m` | Merge default branch into current |
468
527
  | `to-main` | `to-master` `tm` | Switch to main, merge current branch in |
469
528
  | `remote` | `r` | Fetch + select a remote branch to merge |
529
+ | `push` | `p` | Push the branch after a successful merge (combine with any mode) |
470
530
 
471
531
  </details>
472
532
 
@@ -483,6 +543,7 @@ gitb commit <combined> # compact form: ff, aifp, fastsp, ...
483
543
  | `autosquash` | `a` `s` `ia` | Interactive rebase with `--autosquash` |
484
544
  | `fastautosquash` | `fast` `sf` `f` | Autosquash without interaction |
485
545
  | `pull` | `p` | Take commits from selected branch into current |
546
+ | `push` | | Force-push the branch after a successful rebase (combine with any mode) |
486
547
 
487
548
  </details>
488
549
 
@@ -640,7 +701,7 @@ long-running reviews, or comparing branches side-by-side.
640
701
  | `<empty>` | | Show existing worktrees + interactive menu |
641
702
  | `list` | `l` `ls` | List all worktrees with branch and lock state |
642
703
  | `add` | `a` `new` `n` `c` | Create worktree with a new branch from current `HEAD` |
643
- | `addd` | `ad` `nd` `cd` | Fetch, then create worktree with new branch from default branch |
704
+ | `addd` | `ad` `nd` | Fetch, then create worktree with new branch from default branch |
644
705
  | `addb` | `ab` `from` `b` | Create worktree from an existing local branch |
645
706
  | `addr` | `ar` `remote` `r` | Fetch + create worktree tracking a remote branch |
646
707
  | `remove` | `rm` `del` `d` | Pick a worktree to remove (force-prompt on dirty trees) |
@@ -648,7 +709,9 @@ long-running reviews, or comparing branches side-by-side.
648
709
  | `lock` | | Lock a worktree (with optional reason) |
649
710
  | `unlock` | `ul` | Unlock a worktree |
650
711
  | `prune` | `pr` `p` | Clean up stale worktree records (dry-run preview first) |
651
- | `path` | `cd` `switch` `sw` | Print the path to a chosen worktree (use with `cd $(...)`) |
712
+ | `manage` | `m` | Pick a worktree, then move / lock / unlock / delete it |
713
+ | `goto` | `go` `g` `cd` `switch` | Open a subshell inside a chosen worktree |
714
+ | `path` | `sw` | Print the path to a chosen worktree (use with `cd $(...)`) |
652
715
 
653
716
  </details>
654
717
 
@@ -660,8 +723,8 @@ gitb wt remove # interactive removal (with force prompt if dirty)
660
723
  cd "$(gitb wt path)" # cd into a chosen worktree
661
724
  ```
662
725
 
663
- By default new worktrees are created at `../<repo>-<branch>`. Override the
664
- parent directory globally or per-repo:
726
+ By default new worktrees are created at `<repo_root>/.worktree/<branch>` (slashes
727
+ in the branch name become dashes). Override the base directory globally or per-repo:
665
728
 
666
729
  ```bash
667
730
  git config --global gitbasher.worktreebase ~/code/worktrees
@@ -676,9 +739,11 @@ git config --global gitbasher.worktreebase ~/code/worktrees
676
739
  |------|---------|-------------|
677
740
  | `<empty>` | | Interactive action menu |
678
741
  | `list` | `l` | All hooks with status |
742
+ | `select` | `sel` | Browse hook types with descriptions |
679
743
  | `create` | `new` `c` | New hook from templates |
680
744
  | `edit` | `e` | Edit existing hook |
681
- | `toggle` | `t` | Enable/disable hook |
745
+ | `toggle` | `t` | Enable/disable hook (`enable` / `disable` force that state) |
746
+ | `install` | `samples` | Install all available sample hooks |
682
747
  | `remove` | `rm` `r` | Delete hook(s) |
683
748
  | `test` | `run` `check` | Test hook execution |
684
749
  | `show` | `cat` `view` `s` | Display hook contents |
@@ -717,8 +782,8 @@ without a remote, rename the repo on GitHub/GitLab, or move it to a new host.
717
782
 
718
783
  </details>
719
784
 
720
- Each mutating mode accepts an optional URL/name as a second argument to skip
721
- the interactive prompt:
785
+ The `set`, `change`, and `rename` modes accept an optional URL/name as a second
786
+ argument to skip the interactive prompt:
722
787
 
723
788
  ```bash
724
789
  gitb origin # show remotes
@@ -738,7 +803,7 @@ gitb origin remove # delete the remote
738
803
  | `<empty>` | | Show current configuration |
739
804
  | `user` | `u` `name` `email` | Set name and email |
740
805
  | `default` | `def` `d` `b` `main` | Set default branch |
741
- | `separator` | `sep` `s` | Branch-name separator |
806
+ | `separator` | `sep` | Branch-name separator |
742
807
  | `editor` | `ed` `e` | Commit-message editor |
743
808
  | `ticket` | `ti` `t` `jira` | Ticket prefix for commits/branches |
744
809
  | `scopes` | `sc` `s` | Common scopes |
@@ -746,6 +811,9 @@ gitb origin remove # delete the remote
746
811
  | `provider` | `prov` | AI provider (openrouter, openai, ollama) |
747
812
  | `model` | `m` | Default AI model |
748
813
  | `proxy` | `prx` `p` | HTTP proxy for AI calls |
814
+ | `history` | `hist` | How many recent commits to include in AI prompts |
815
+ | `diff` | `payload` | AI diff payload size (line and character caps) |
816
+ | `push-size` | `ps` `pushsize` | Warn before pushing more than N MB (0 disables) |
749
817
  | `completion` | `comp` | Install / uninstall bash & zsh tab completion |
750
818
  | `delete` | `unset` `del` | Remove global config |
751
819
 
@@ -753,20 +821,50 @@ gitb origin remove # delete the remote
753
821
 
754
822
  ### `gitb log`
755
823
 
756
- <details>
757
- <summary>All log modes</summary>
824
+ An interactive commit browser instead of a wall of text. Bare `gitb log` shows a paginated, numbered commit list (with branch/tag decorations and `↑` on unpushed commits) — pick a number to open the commit and act on it: view the diff or stat, copy the hash, revert, cherry-pick, fix up staged changes into it, or restore a single file from it.
758
825
 
759
826
  | Mode | Aliases | Description |
760
827
  |------|---------|-------------|
761
- | `<empty>` | | Pretty log for current branch |
828
+ | _(none)_ | | Interactive commit browser for the current branch |
829
+ | `all` | `dump` | Classic full log dump through the pager |
762
830
  | `branch` | `b` | Pick a branch to log |
763
831
  | `compare` | `comp` `c` | Compare two branches |
764
832
  | `search` | `s` | Search commits |
833
+ | `ai` | | Summarize a commit range in plain English (needs `gitb cfg ai`) |
834
+ | `help` | `h` | Show inline help |
835
+
836
+ Anything else after `gitb log` is resolved automatically:
837
+
838
+ ```bash
839
+ gitb log 20 # browse the last 20 commits
840
+ gitb log scripts/gitb.sh # browse one file's history (follows renames)
841
+ gitb log main..feature # browse a range (plain refs work too)
842
+ gitb log broken teapot # search commit messages for the phrase
843
+ ```
844
+
845
+ `gitb log ai` summarizes what happened since the last tag; `gitb log ai 30`, `gitb log ai unpushed` and `gitb log ai main..feature` narrow the range. Page size is configurable: `git config gitbasher.log-count 30`.
846
+
847
+ <details>
848
+ <summary>Search sub-modes</summary>
765
849
 
766
850
  **Search sub-modes:** `message`/`msg`/`m`, `author`/`a`, `file`/`f`, `content`/`pickaxe`/`p`, `date`/`d`, `hash`/`commit`/`h`.
767
851
 
768
852
  </details>
769
853
 
854
+ ### `gitb diff`
855
+
856
+ Overview-first diffs built for the gitbasher workflow — no flag memorization. Bare `gitb diff` shows a colorized stat of your uncommitted changes, then lets you pick a file to view its full patch.
857
+
858
+ | Mode | Aliases | Description |
859
+ |------|---------|-------------|
860
+ | _(none)_ | | Stat overview of uncommitted changes, then pick a file to view its full patch |
861
+ | `staged` | `s` `cached` | Show staged changes (`git diff --cached`) |
862
+ | `all` | `a` | Show all uncommitted changes — staged **and** unstaged (`git diff HEAD`) |
863
+ | `branch` | `b` | Compare the current branch against another, chosen interactively |
864
+ | `commit` | `c` | Show a chosen commit's diff, chosen interactively |
865
+ | `ai` | | Summarize uncommitted changes in plain English (needs `gitb cfg ai`) |
866
+ | `help` | `h` | Show inline help |
867
+
770
868
  ### Info commands
771
869
 
772
870
  | Command | Aliases | Description |
@@ -787,15 +885,26 @@ gitb origin remove # delete the remote
787
885
  | `user.name` / `user.email` | `gitb cfg user` | Your identity |
788
886
  | `gitbasher.branch` | `gitb cfg default` | Default branch (`main`, `master`, …) |
789
887
  | `gitbasher.sep` | `gitb cfg separator` | Branch-name separator (`/`, `-`, …) |
790
- | `gitbasher.editor` | `gitb cfg editor` | Editor for messages |
888
+ | `core.editor` | `gitb cfg editor` | Editor for messages |
791
889
  | `gitbasher.ticket` | `gitb cfg ticket` | Ticket prefix (`PROJ-`) |
792
890
  | `gitbasher.scopes` | `gitb cfg scopes` | Suggested commit scopes |
793
- | `gitbasher.ai-api-key` | `gitb cfg ai` | AI provider API key (or `GITB_AI_API_KEY` env) |
891
+ | `gitbasher.ai-api-key-<provider>` | `gitb cfg ai` | Per-provider AI API key (or `GITB_AI_API_KEY_<PROVIDER>` env); legacy `gitbasher.ai-api-key` is read as a fallback |
794
892
  | `gitbasher.ai-provider` | `gitb cfg provider` | `openrouter` (default), `openai`, or `ollama` |
795
893
  | `gitbasher.ai-base-url` | `git config` | Custom OpenAI-compatible endpoint (LiteLLM, vLLM, remote Ollama) |
796
894
  | `gitbasher.ai-model[-task]` | `gitb cfg model` | AI model overrides (per provider) |
797
- | `gitbasher.proxy` | `gitb cfg proxy` | HTTP proxy for AI calls |
798
- | `gitbasher.worktreebase` | `git config gitbasher.worktreebase <dir>` | Parent directory for new worktrees (defaults to `..`) |
895
+ | `gitbasher.ai-proxy` | `gitb cfg proxy` | HTTP proxy for AI calls |
896
+ | `gitbasher.ai-ollama-host` | `git config gitbasher.ai-ollama-host <url>` | Ollama server URL (default `http://localhost:11434`) |
897
+ | `gitbasher.ai-timeout` | `git config gitbasher.ai-timeout <seconds>` | AI request timeout in seconds (default `60`, `300` for ollama) |
898
+ | `gitbasher.ai-diff-limit` | `gitb cfg diff` | Diff lines sent to AI (default `300`) |
899
+ | `gitbasher.ai-diff-max-chars` | `gitb cfg diff` | Character cap on the diff sent to AI (default `20000`) |
900
+ | `gitbasher.ai-commit-history-limit` | `gitb cfg history` | Recent commits included in AI prompts (default `10`) |
901
+ | `gitbasher.push-warn-size` | `gitb cfg push-size` | Warn before pushing more than N MB (default `50`, `0` disables) |
902
+ | `gitbasher.worktreebase` | `git config gitbasher.worktreebase <dir>` | Base directory for new worktrees (default `.worktree` under the repo root) |
903
+ | `gitbasher.commit-auto-split` | `git config gitbasher.commit-auto-split <ask\|always\|never>` | Offer to split a commit per scope (default `ask`) |
904
+ | `gitbasher.commit-max-split-groups` | `git config gitbasher.commit-max-split-groups <2..20>` | Cap on split commits per run (default `7`) |
905
+ | `gitbasher.commit-split-order` | `git config gitbasher.commit-split-order <auto\|alpha>` | Order split commits by dependency (`auto`, default) or alphabetically (`alpha`) |
906
+ | `gitbasher.commit-ai-grouping` | `git config gitbasher.commit-ai-grouping <never\|auto\|always>` | AI feature grouping for commit splits (default `auto`) |
907
+ | `gitbasher.log-count` | `git config gitbasher.log-count <n>` | Commits per page in the `gitb log` browser (default `20`) |
799
908
 
800
909
  **Clear gitbasher config** (per-repo settings live with the repo and disappear with it):
801
910
  ```bash
@@ -831,7 +940,7 @@ GITB_DIR=/opt/bin curl -fsSL https://raw.githubusercontent.com/maxbolgarin/gitba
831
940
 
832
941
  ### Pin a release
833
942
  ```bash
834
- GITB_VERSION=v3.10.2 curl -fsSL https://raw.githubusercontent.com/maxbolgarin/gitbasher/main/install.sh | bash
943
+ GITB_VERSION=v5.0.0 curl -fsSL https://raw.githubusercontent.com/maxbolgarin/gitbasher/main/install.sh | bash
835
944
  ```
836
945
 
837
946
  ## Uninstall
@@ -888,9 +997,10 @@ gitb cfg proxy # in restricted regions
888
997
 
889
998
  If `gitb commit ai` hangs, returns `connection refused`, or times out:
890
999
 
1000
+ - **jq missing** — all AI features require `jq` (check with `command -v jq`; install via `brew install jq` / `apt install jq`). Without it every AI command aborts with an install hint.
891
1001
  - **Network reachability** — test the provider directly: `curl -fsSL https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"` (or the equivalent for OpenRouter/Ollama). If that fails, gitbasher will too.
892
1002
  - **Corporate proxy / restricted region** — `gitb cfg proxy` accepts `host:port` or `protocol://host:port`. Verify with `curl -x "$proxy" https://api.openai.com`.
893
- - **Local Ollama** — confirm the daemon is running (`curl http://localhost:11434/api/tags`). The default model must be pulled first (`ollama pull llama3`).
1003
+ - **Local Ollama** — confirm the daemon is running (`curl http://localhost:11434/api/tags`). The default model must be pulled first (`ollama pull qwen3:8b`).
894
1004
  - **Stale or rotated key** — `gitb cfg ai` re-prompts; prefer the env-var path (`export GITB_AI_API_KEY_OPENAI=...`) over `git config` so a leaked repo doesn't carry the secret.
895
1005
  </details>
896
1006
 
@@ -912,9 +1022,9 @@ Per-repo settings live in `.git/config` and need write access to that file (`chm
912
1022
  <details>
913
1023
  <summary><b>"Bad substitution" or bash errors</b></summary>
914
1024
 
915
- `bash --version` must be 4.0+.
1025
+ `bash --version` must be 3.2+ — the version macOS ships as `/bin/bash` — so this is rare.
916
1026
 
917
- - macOS: `brew install bash` (and optionally make it default: `sudo sh -c 'echo /opt/homebrew/bin/bash >> /etc/shells' && chsh -s /opt/homebrew/bin/bash`)
1027
+ - macOS: already ships bash 3.2; gitbasher runs on it natively (a newer bash via `brew install bash` only improves in-place line editing of prefilled prompts)
918
1028
  - Ubuntu/Debian: `sudo apt update && sudo apt install --only-upgrade bash`
919
1029
  </details>
920
1030
 
@@ -923,9 +1033,11 @@ Per-repo settings live in `.git/config` and need write access to that file (`chm
923
1033
 
924
1034
  | OS | Bash | Git | Install |
925
1035
  |----|------|-----|---------|
926
- | Linux | 4.0+ | 2.23+ | `apt install bash git` |
927
- | macOS | 4.0+ | 2.23+ | `brew install bash git` |
1036
+ | Linux | 3.2+ | 2.23+ | `apt install bash git` |
1037
+ | macOS | 3.2+ (system) | 2.23+ | `brew install git` |
928
1038
  | Windows | WSL | WSL | `wsl --install` then Linux steps |
1039
+
1040
+ AI features additionally require `jq` (`brew install jq` / `apt install jq`); core git commands don't.
929
1041
  </details>
930
1042
 
931
1043
  <details>
@@ -942,7 +1054,7 @@ Per-repo settings live in `.git/config` and need write access to that file (`chm
942
1054
  | `Another git process seems to be running ... index.lock` | gitbasher detects this at startup and prompts to remove the stale lock |
943
1055
  | `error: pathspec '<branch>' did not match any file(s) known to git` | `gitb pull` to fetch, or `gitb b new <branch>` to create a fresh branch with a conventional name |
944
1056
  | `fatal: detached HEAD` after checkout | gitbasher warns before destructive ops in detached HEAD; use `gitb b` to switch to a real branch first |
945
- | `gpg: signing failed` on commit | export `GPG_TTY=$(tty)` or run `gitb config` to disable signing per-repo |
1057
+ | `gpg: signing failed` on commit | export `GPG_TTY=$(tty)` or run `git config commit.gpgsign false` to disable signing per-repo |
946
1058
 
947
1059
  If you hit a confusing git error not listed here, run the same flow with `git` directly first — gitbasher passes git's stderr through unchanged, so the underlying message is the source of truth.
948
1060
  </details>
@@ -954,7 +1066,6 @@ If you hit a confusing git error not listed here, run the same flow with `git` d
954
1066
  npm uninstall -g gitbasher # if installed via npm
955
1067
  sudo rm /usr/local/bin/gitb # if installed system-wide
956
1068
  rm -f ~/.local/bin/gitb # if installed per-user
957
- rm -rf ~/.gitbasher # remove config (optional)
958
1069
  ```
959
1070
  </details>
960
1071
 
@@ -968,7 +1079,7 @@ PRs welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for the dev setup, BATS te
968
1079
 
969
1080
  ```bash
970
1081
  make build # rebuild dist/gitb
971
- make test # run all 115+ tests
1082
+ make test # run all 870+ tests
972
1083
  make test-file FILE=test_sanitization.bats
973
1084
  ```
974
1085