11 releases
Uses new Rust 2024
| new 0.4.4 | Feb 18, 2026 |
|---|---|
| 0.4.3 | Feb 18, 2026 |
| 0.3.9 | Feb 14, 2026 |
#475 in Testing
230KB
6K
SLoC
git-cli
Overview
git-cli is a Rust CLI that groups Git workflow helpers behind a dispatcher. It provides six command groups: utils, reset, commit, branch, ci, and open.
Usage
Usage:
git-cli <group> <command> [args]
Groups:
utils zip | copy-staged | root | commit-hash
reset soft | mixed | hard | undo | back-head | back-checkout | remote
commit context | context-json | to-stash
branch cleanup
ci pick
open repo | branch | default-branch | commit | compare | pr | pulls | issues | actions | releases | tags | commits | file | blame
Help:
git-cli help
git-cli <group> help
Commands
utils
zip: Createbackup-<short-sha>.zipfromHEADusinggit archive.copy-staged(copy): Copy staged diff to the clipboard. Use--stdoutto print,--bothto print and copy.root: Print the repository root. Use--shellto outputcd -- <path>foreval.commit-hash(hash): Resolve a ref to a commit SHA.
reset
soft|mixed|hard [N]: RewindHEADby N commits (default: 1) with confirmations and summaries.undo: MoveHEADback to the previous reflog entry with safety checks.back-head: CheckoutHEAD@{1}(previous position).back-checkout: Checkout the previously checked-out branch (requires non-detachedHEAD).remote: Reset the current branch to a remote-tracking ref. Options:--ref <remote/branch>,--remote <name>,--branch <name>,--no-fetch,--prune,--set-upstream,--clean,-y/--yes.
commit
context: Build a Markdown commit context from staged changes. Options:--stdout,--both,--no-color(orNO_COLOR),--include <path/glob>(repeatable).context-json: Writecommit-context.jsonandstaged.patch(default:<git-dir>/commit-context). Options:--stdout,--both,--pretty,--bundle,--out-dir <path>.to-stash: Create a stash from a commit and optionally rewrite history via prompts.
branch
cleanup(delete-merged): Delete merged local branches. Options:-b/--base <ref>,-s/--squash.
ci
pick: Create and push aci/<target>/<name>branch with cherry-picked commits. Options:-r/--remote <name>,--no-fetch,-f/--force,--stay.
open
repo [remote]: Open repository homepage.branch [ref]: Open tree page for a ref (default: upstream branch).default-branch [remote](default): Open default branch tree page.commit [ref]: Open commit page (default:HEAD).compare [base] [head]: Open compare page.pr [number]: Open PR/MR page or create/view current-branch PR.pulls [number]: Open PR/MR list or specific PR/MR.issues [number]: Open issue list or specific issue.actions [workflow]: Open GitHub Actions page (GitHub only).releases [tag]: Open releases list or specific release tag.tags [tag]: Open tags list or specific release tag.commits [ref]: Open commits history page.file <path> [ref]: Open file blob page.blame <path> [ref]: Open blame page.GIT_OPEN_COLLAB_REMOTEcan override the remote used for collaboration pages (pr/pulls/issues/actions/releases/tags).
Shell aliases (optional)
- Zsh aliases live in
completions/zsh/aliases.zsh. - Bash aliases live in
completions/bash/aliases.bash. gxurshould be implemented via:eval "$(git-cli utils root --shell)".
Exit codes
0: Success and help output.1: Operational errors or aborted confirmations.2: Usage/parse errors.
Dependencies
gitis required for all commands.git-scopeis required forcommit context.- Clipboard tools are optional:
pbcopy,wl-copy,xclip, orxsel. Missing clipboard tools emit a warning and continue.
Docs
Dependencies
~2–3MB
~62K SLoC