gitbasher 5.0.1 β†’ 5.2.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 +42 -0
  2. package/README.md +30 -38
  3. package/dist/gitb +732 -276
  4. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
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.2.0](https://github.com/maxbolgarin/gitbasher/compare/v5.1.0...v5.2.0) (2026-07-07)
6
+
7
+ ### πŸš€ Features
8
+
9
+ * **ai:** one model per provider with live pickers, reasoning control, and setup safety checks ([a9c6935](https://github.com/maxbolgarin/gitbasher/commit/a9c6935297e84b777c8428203dae7003ef93aa38))
10
+
11
+ ### πŸ› Bug Fixes
12
+
13
+ * **ai:** extract bare scope from full type(scope) prefixes ([18da7e4](https://github.com/maxbolgarin/gitbasher/commit/18da7e4648a0dda2aec2453305bcdf95110feea7))
14
+ * **config:** move values to global scope instead of shadowing them locally ([648ef37](https://github.com/maxbolgarin/gitbasher/commit/648ef3735dfd6c1aa248369d51bdb57ad42c3353))
15
+
16
+ ### πŸ“š Documentation
17
+
18
+ * describe per-provider AI models, live model menus, and reasoning behavior ([dab3cef](https://github.com/maxbolgarin/gitbasher/commit/dab3cef479d619e59e69b6d4f3a75514e7b6d00d))
19
+
20
+ ### 🚨 Tests
21
+
22
+ * keep [@test](https://github.com/test) descriptions ASCII for bats under bash 3.2 ([1e3fb50](https://github.com/maxbolgarin/gitbasher/commit/1e3fb50071d927b8475178ffdae68afcf7ebc19a))
23
+
24
+ ## [5.1.0](https://github.com/maxbolgarin/gitbasher/compare/v5.0.1...v5.1.0) (2026-07-03)
25
+
26
+ ### πŸš€ Features
27
+
28
+ * **ai:** add local Claude Code CLI (claude -p) provider ([bc3e663](https://github.com/maxbolgarin/gitbasher/commit/bc3e66341903c1ed93f7191dc6ee6840173bf13b))
29
+ * **config:** keep or replace an existing AI key with one keystroke ([95ba4a6](https://github.com/maxbolgarin/gitbasher/commit/95ba4a649d8ab9288cb5e73760076effce2b8ddc))
30
+ * **commit:** offer manual fallback when AI message generation fails ([39ac769](https://github.com/maxbolgarin/gitbasher/commit/39ac7697d6ca5063c09aa8b661c1263581e2adc3))
31
+ * **config:** turn gitb cfg ai into a provider/key/model setup wizard ([22795fe](https://github.com/maxbolgarin/gitbasher/commit/22795fe90980b2a6e848529eff6aa3a2939f89f5))
32
+
33
+ ### πŸ› Bug Fixes
34
+
35
+ * **ai:** move OpenRouter default models to the current generations ([82a26a0](https://github.com/maxbolgarin/gitbasher/commit/82a26a0797aafe11e71ff4e8e737830fe567b4c2))
36
+ * **ai:** pick default models by measured latency, speed first ([29d48b8](https://github.com/maxbolgarin/gitbasher/commit/29d48b8d21ac04bd639dee723770a2bcdae38328))
37
+
38
+ ### πŸ“š Documentation
39
+
40
+ * **site:** mention the claude CLI provider and the cfg ai wizard ([23c9087](https://github.com/maxbolgarin/gitbasher/commit/23c9087783b805f8ed651735304305a1163a47c3))
41
+ * refresh test count, document the AI fallback, mention claude on the site FAQ ([af6527d](https://github.com/maxbolgarin/gitbasher/commit/af6527d08aceb20bf75ab7a3c0fe745fe1cef16f))
42
+
43
+ ### πŸ’Ž Styles
44
+
45
+ * capitalize the Enter default in every y/n prompt ([37349a0](https://github.com/maxbolgarin/gitbasher/commit/37349a0d166b235b9b7c33dc2767e5b2093ec004))
46
+
5
47
  ## [5.0.1](https://github.com/maxbolgarin/gitbasher/compare/v5.0.0...v5.0.1) (2026-07-03)
6
48
 
7
49
  ### πŸ› Bug Fixes
package/README.md CHANGED
@@ -77,7 +77,7 @@ npm install -g gitbasher
77
77
  cd your-project
78
78
  gitb # see all commands
79
79
  gitb cfg user # set your name/email once
80
- gitb cfg ai # (optional) plug in an AI key for smart commits
80
+ gitb cfg ai # (optional) set up AI for smart commits (provider, key, model)
81
81
 
82
82
  gitb status # what's changed?
83
83
  gitb commit # interactive conventional commit
@@ -111,7 +111,7 @@ Every command has a short alias (`gitb c`, `gitb p`, `gitb pu`, `gitb b`, `gitb
111
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.
112
112
  - **Safer git** β€” push/pull detect conflicts up front, `undo` rolls back commit/amend/merge/rebase/stash, `reset` is interactive with a preview.
113
113
  - **Whole workflows, not just commands** β€” `sync`, `wip`, `branch newd`, `merge to-main`, `squash` chain the steps you'd otherwise do by hand.
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.
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. **940+ BATS tests** cover sanitization, git ops, and branch logic.
115
115
 
116
116
  <p align="center">
117
117
  <img src=".github/push.gif" width="640" alt="gitb push demo" />
@@ -216,19 +216,20 @@ Drop in an API key once (or run a local model with no key at all), then let an L
216
216
 
217
217
  ### Providers
218
218
 
219
- gitbasher supports three providers behind the same OpenAI-style chat-completions API. Default is `openrouter` β€” existing setups keep working unchanged.
219
+ gitbasher supports four providers. Default is `openrouter` β€” existing setups keep working unchanged.
220
220
 
221
221
  | Provider | Best for | Needs key? |
222
222
  |----------|----------|-----------|
223
223
  | `openrouter` (default) | Trying many models behind one key (Gemini, Claude, GPT, DeepSeek…) | Yes β€” [openrouter.ai/keys](https://openrouter.ai/keys) |
224
224
  | `openai` | Direct access to GPT-5.4 family at OpenAI's own pricing | Yes β€” [platform.openai.com/api-keys](https://platform.openai.com/api-keys) |
225
225
  | `ollama` | **Fully local, fully private** β€” no key, no network, runs on your machine | No |
226
+ | `claude` | You already use [Claude Code](https://claude.com/claude-code) β€” reuses the local `claude` CLI and its login, billed to your Claude account | No |
226
227
 
227
228
  ### Setup
228
229
 
229
230
  ```bash
230
231
  # 1. Pick a provider (skip to use the OpenRouter default)
231
- gitb cfg provider # interactive β€” choose openrouter, openai, or ollama
232
+ gitb cfg provider # interactive β€” choose openrouter, openai, ollama, or claude
232
233
 
233
234
  # 2. For openrouter / openai: paste your key (local repo or global)
234
235
  gitb cfg ai
@@ -237,6 +238,9 @@ gitb cfg ai
237
238
  ollama serve &
238
239
  ollama pull qwen3:8b
239
240
 
241
+ # For claude: just have the Claude Code CLI installed and signed in
242
+ npm install -g @anthropic-ai/claude-code
243
+
240
244
  # 3. Optional: HTTP proxy (for restricted regions, openrouter/openai only)
241
245
  gitb cfg proxy
242
246
  ```
@@ -249,41 +253,26 @@ export GITB_AI_API_KEY='sk-...'
249
253
  <details>
250
254
  <summary><b>Default models per provider</b> (click to expand)</summary>
251
255
 
252
- Each task uses a model tuned for speed/cost/quality, picked per provider. Defaults (May 2026):
253
-
254
- **OpenRouter** (default provider)
255
-
256
- | Task | Default model | Why |
257
- |------|---------------|-----|
258
- | `simple` (one-line message) | `google/gemini-3.1-flash-lite-preview` | Cheapest fast tier |
259
- | `subject` (after manual type/scope) | `google/gemini-3.1-flash-lite-preview` | Short structured output |
260
- | `full` (header + body) | `google/gemini-3-flash-preview` | Better prose |
261
- | `grouping` (atomic-split mapping) | `anthropic/claude-haiku-4.5` | Strict instruction following |
256
+ One model per provider, used for every task (message generation, subjects, feature grouping). Defaults (July 2026), picked speed-first:
262
257
 
263
- **OpenAI** β€” GPT-5.4 family (released March 2026)
258
+ | Provider | Default model | Why |
259
+ |----------|---------------|-----|
260
+ | `openrouter` | `google/gemini-3.5-flash` | Current flash generation, ~0.8s median on a commit-sized prompt, good prose |
261
+ | `openai` | `gpt-5.4-mini` | As fast as nano (~0.8s) with strictly better quality, ~$0.75 / $4.50 per M |
262
+ | `ollama` | `qwen3:8b` | Best small instruction-follower; most stable structured output; ~5 GB on disk |
263
+ | `claude` | `haiku` | CLI startup dominates latency, so the fastest model wins; alias tracks the current generation |
264
264
 
265
- | Task | Default model | Why |
266
- |------|---------------|-----|
267
- | `simple` / `subject` | `gpt-5.4-nano` | Built for classification/short well-defined output, ~$0.20 / $1.25 per M tokens |
268
- | `full` | `gpt-5.4-mini` | Stronger multi-condition instruction following for header + body, ~$0.75 / $4.50 per M |
269
- | `grouping` | `gpt-5.4-mini` | Holds the strict TSV format under validation, far cheaper than the flagship |
265
+ Other good picks: `gpt-5.4-nano` (budget, high volume), `llama3.3:8b` / `qwen2.5-coder:7b` (local), `sonnet` (better prose on the claude provider, noticeably slower).
270
266
 
271
- **Ollama** β€” fully local
267
+ The cloud defaults are hybrid reasoning models that think at "medium" effort out of the box β€” pure latency for a one-line commit message. gitbasher controls this per request: message generation runs at the provider's reasoning floor (`minimal` on OpenRouter, `none` on OpenAI β€” measured ~2Γ— faster with identical output), while feature grouping and squash planning run at `low` effort, where a bit of real thinking helps multi-file structure decisions. No configuration needed.
272
268
 
273
- | Task | Default model | Why |
274
- |------|---------------|-----|
275
- | All tasks | `qwen3:8b` | Best small instruction-follower among 7/8B models; most stable structured output (rarely drops fields in TSV); ~5 GB on disk, ~25 tok/s on a consumer laptop with GPU |
269
+ `gitb cfg model` shows a **live menu**: the week's most-used and newest text models on OpenRouter (public API, server-side ranking), or the newest chat models visible to your OpenAI key. A typed id is validated against the live catalog (typos die at config time, with an override for brand-new models), and the chosen model is test-driven with one live request before the step completes β€” a model that can't complete a request never reaches your commits.
276
270
 
277
- Other strong local picks: `llama3.3:8b` (general-purpose), `qwen2.5-coder:7b` (code-heavy diffs).
271
+ The model is remembered **per provider** β€” switching providers never carries a model across (an OpenRouter slug means nothing to the claude CLI), and switching back restores your previous choice, same as API keys:
278
272
 
279
- Override per task or globally:
280
273
  ```bash
281
- gitb cfg model # interactive
282
- git config gitbasher.ai-model <model_id> # global
283
- git config gitbasher.ai-model-simple <model_id> # per-task
284
- git config gitbasher.ai-model-subject <model_id>
285
- git config gitbasher.ai-model-full <model_id>
286
- git config gitbasher.ai-model-grouping <model_id>
274
+ gitb cfg model # interactive, stores for the active provider
275
+ git config gitbasher.ai-model-<provider> <model_id> # direct, e.g. gitbasher.ai-model-claude sonnet
287
276
  ```
288
277
 
289
278
  </details>
@@ -807,8 +796,9 @@ gitb origin remove # delete the remote
807
796
  | `editor` | `ed` `e` | Commit-message editor |
808
797
  | `ticket` | `ti` `t` `jira` | Ticket prefix for commits/branches |
809
798
  | `scopes` | `sc` `s` | Common scopes |
810
- | `ai` | `llm` `key` | AI API key |
811
- | `provider` | `prov` | AI provider (openrouter, openai, ollama) |
799
+ | `ai` | `llm` | AI setup wizard: provider, API key, model |
800
+ | `key` | | AI API key only |
801
+ | `provider` | `prov` | AI provider (openrouter, openai, ollama, claude) |
812
802
  | `model` | `m` | Default AI model |
813
803
  | `proxy` | `prx` `p` | HTTP proxy for AI calls |
814
804
  | `history` | `hist` | How many recent commits to include in AI prompts |
@@ -889,12 +879,12 @@ Overview-first diffs built for the gitbasher workflow β€” no flag memorization.
889
879
  | `gitbasher.ticket` | `gitb cfg ticket` | Ticket prefix (`PROJ-`) |
890
880
  | `gitbasher.scopes` | `gitb cfg scopes` | Suggested commit scopes |
891
881
  | `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 |
892
- | `gitbasher.ai-provider` | `gitb cfg provider` | `openrouter` (default), `openai`, or `ollama` |
882
+ | `gitbasher.ai-provider` | `gitb cfg provider` | `openrouter` (default), `openai`, `ollama`, or `claude` |
893
883
  | `gitbasher.ai-base-url` | `git config` | Custom OpenAI-compatible endpoint (LiteLLM, vLLM, remote Ollama) |
894
- | `gitbasher.ai-model[-task]` | `gitb cfg model` | AI model overrides (per provider) |
884
+ | `gitbasher.ai-model-<provider>` | `gitb cfg model` | Model for that provider (one model for all tasks); legacy `gitbasher.ai-model` is read as a fallback |
895
885
  | `gitbasher.ai-proxy` | `gitb cfg proxy` | HTTP proxy for AI calls |
896
886
  | `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) |
887
+ | `gitbasher.ai-timeout` | `git config gitbasher.ai-timeout <seconds>` | AI request timeout in seconds (default `60`, `300` for ollama/claude) |
898
888
  | `gitbasher.ai-diff-limit` | `gitb cfg diff` | Diff lines sent to AI (default `300`) |
899
889
  | `gitbasher.ai-diff-max-chars` | `gitb cfg diff` | Character cap on the diff sent to AI (default `20000`) |
900
890
  | `gitbasher.ai-commit-history-limit` | `gitb cfg history` | Recent commits included in AI prompts (default `10`) |
@@ -998,9 +988,11 @@ gitb cfg proxy # in restricted regions
998
988
  If `gitb commit ai` hangs, returns `connection refused`, or times out:
999
989
 
1000
990
  - **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.
991
+ - **Generation failed mid-commit?** gitbasher offers to continue with a manual commit message (staging is preserved) β€” press Enter to accept and write it yourself, or `n` to abort.
1001
992
  - **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.
1002
993
  - **Corporate proxy / restricted region** β€” `gitb cfg proxy` accepts `host:port` or `protocol://host:port`. Verify with `curl -x "$proxy" https://api.openai.com`.
1003
994
  - **Local Ollama** β€” confirm the daemon is running (`curl http://localhost:11434/api/tags`). The default model must be pulled first (`ollama pull qwen3:8b`).
995
+ - **Claude Code CLI** β€” confirm it responds (`echo hi | claude -p`); you may need to sign in first. Install with `npm install -g @anthropic-ai/claude-code`.
1004
996
  - **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.
1005
997
  </details>
1006
998
 
@@ -1079,7 +1071,7 @@ PRs welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for the dev setup, BATS te
1079
1071
 
1080
1072
  ```bash
1081
1073
  make build # rebuild dist/gitb
1082
- make test # run all 870+ tests
1074
+ make test # run all 940+ tests
1083
1075
  make test-file FILE=test_sanitization.bats
1084
1076
  ```
1085
1077