@profullstack/g1tz
v0.2.2
Published
A git TUI that shows you the repository, not a menu of git commands.
Readme
g1tz
A git TUI that shows you the repository, not a menu of git commands.
bunx @profullstack/g1tz # the repository you are standing in
bunx @profullstack/g1tz ~/proj # somewhere else
npm i -g @profullstack/g1tz # then just g1tzThe package is scoped because npm refuses the bare name ("too similar to got, gts"); the command it installs is still g1tz.
g1tz main origin/main ↓1 ~/hqtui Tab panes Space stage q quit
╭─ Files (3) ───────────────────────────╮ ╭─ Diff ─────────────────────────────────────────────────────────╮
│ M src/a.ts │ │ @@ -0,0 +1,8 @@ │
│ M src/b.ts │ │ +export interface Span { │
│ ?? new.ts │ │ + text: string; │
╰───────────────────────────────────────╯ │ +} │
╭─ Branches (39) ───────────────────────╮ │ const style: Style = { fg: options.fg }; │
│ * main ↓1 │ │ │
│ spans-richtext │ │ │
╰───────────────────────────────────────╯ │ │
╭─ Log (78) ────────────────────────────╮ │ │
│ e28fec7 Finish widget parity 2h │ │ │
╰───────────────────────────────────────╯ ╰────────────────────────────────────────────────────────────────╯
Tab files Space Stage ↑↓ Move r Reload q QuitFiles, branches and log down the left. The diff on the right follows whatever you have selected — a file's changes, or a commit's patch.
Keys
| Key | Does |
|---|---|
| Tab | Cycle files → branches → log |
| ↑ ↓ PgUp PgDn | Move the selection |
| Space | Stage the selected file, or unstage it if it is fully staged |
| ← → | Scroll the diff |
| r | Re-read the repository |
| p | Pulse: what moved over a period (below) |
| q | Quit |
Pulse
p flips to Pulse: what moved in this repository over a period, the way GitHub's Insights > Pulse tab shows it, but for the repository you are standing in and without leaving the terminal.
bunx @profullstack/g1tz pulse # start on the Pulse screen, last week
bunx @profullstack/g1tz pulse --range month # day, week, month, quarter, year, allThree sources, each optional beyond the first:
- git, always, offline: commits and authors on the branch and across every branch (merges counted separately, as GitHub does), the net change to the tree since the period began (
git difffrom the first parent of the oldest commit in range, with-Mso a rename is a rename), commits per hour, day, week or month, the branches that saw commits and the tags that were created. - GitHub, when
originis on github.com andghis logged in: pull requests opened, merged and closed, issues opened and closed, releases, and new stars for the period. Pages are walked newest first under a small budget; when the budget runs out the counts are floors and the status bar says so. Nothing here sees a token;ghholds the login. - Traffic, when a gh-pulse report exists on the machine (
~/.local/share/gh-pulse, orGH_PULSE_DATA): views and clones for the last fourteen days, referrers and popular paths. GitHub only serves those through its traffic API and only for fourteen days; gh-pulse keeps them.
| Key | Does |
|---|---|
| d w m q y a | Pick the range: day, week, month, quarter, year, all time. The range buttons are clickable too. |
| ↑ ↓ PgUp PgDn | Scroll the files |
| r | Read it again |
| p Esc | Back to the repository, where q quits |
| Ctrl+C | Quit |
How it reads git
By shelling out, using porcelain formats only, with -z wherever a path could contain a newline. Parsing output meant for humans is how a TUI ends up corrupting someone's working tree.
git runs with GIT_PAGER=cat, GIT_EDITOR=true and GIT_OPTIONAL_LOCKS=0, so nothing it invokes can take the terminal away from the interface or fight the editor you already have open.
Untracked files are listed with --untracked-files=all. The default collapses a new directory to a single ? sub/ entry, and you cannot stage or diff a directory.
Status
Early, and deliberately read-mostly. It reads the repository and stages files. It does not yet commit, push, pull, branch, rebase, stash, or discard — the destructive half is the half worth getting right slowly.
Known rough edges:
- The diff is coloured a line at a time, one
text()call per line, because per-line styling is all the library offers today. Styled spans land in@profullstack/hqtui0.3.0 (hqtui#60) and will make word-level diff highlighting possible. - No hunk staging. That wants an interactive diff pane.
Built with
hqtui — the terminal UI library. g1tz exists partly to keep hqtui honest: a real application finds the gaps a widget gallery does not.
Licence
MIT
