@kaynooo/cli-git 0.5.1 → 0.6.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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # gst and gc
1
+ # gst, gc and gb
2
2
 
3
3
  Git for Claude Code, where a session would otherwise chain `git status --short` and `git log --oneline` to read the state, or `git add <paths> && git status && git commit -m ...` to commit and have the commit bounced over its message.
4
4
 
@@ -22,6 +22,15 @@ Prints one line with the branch, its upstream and how far ahead and behind it is
22
22
  - A path may be a directory or a deleted file. When git refuses the commit (a hook), the paths are unstaged again and git's output is shown.
23
23
  - Exit codes: 0 committed, 1 refused, 2 a usage error.
24
24
 
25
+ ## gb
26
+
27
+ `gb [branch]` picks a git branch with fzf and switches to it: the branches last checked out first (from the reflog), then the other local ones, then the remote ones with no local branch yet. The header says where HEAD stands, each row how its branch stands against its upstream and whether it is merged into the base. Keys: enter switches (a remote branch gets its tracking branch), ctrl-n creates a branch named after the query, ctrl-d deletes the highlighted local branch with `git branch -d`, ctrl-r fetches and prunes. Without fzf or a terminal it lists the branches, as JSON with `--json`.
28
+
29
+ - `gb <branch>` switches without the picker, a bare name finding the remote branch it would create; `gb -` goes back, `gb -c <name>` creates a branch, `gb -d <branch>` deletes a local one.
30
+ - A branch checked out in another worktree needs a `cd`, which a command cannot do for its shell: `gb` prints the worktree's path on stdout and a hint on stderr.
31
+ - Hidden flags for wrappers: `--emit` (with any of the above) prints the command as lines for a shell function to run, `--list` the rows as JSON for term, `--names` the branches with their last commit for shell completions, `--show <branch>` the preview and `--rows`, `--fetch` what ctrl-r reloads.
32
+ - Exit codes: the git command's, 1 when no branch is picked or found, 2 outside a repository.
33
+
25
34
  ## Library
26
35
 
27
36
  `@kaynooo/cli-git/message` exports `commitMessageViolation(message)`, the rule a message breaks as the sentence to show or null, and the rule sentences, for the guard that checks a `git commit` typed by hand.