____ ___ ____ ___ _____ | _ \_ _/ ___|_ _|_ _| | |_) | | | _ | | | | | __/| | |_| || | | | |_| |___\____|___| |_|
A terminal UI for Git — short commands and multi-repo management.
Quick Start
$ pip install -U pigit
$ pigit # launch the TUI
$ pigit cmd -l # list short commands
$ pigit repo add ~/dev/foo ~/dev/bar
$ pigit repo ll # summary across repos
$ pigit open # open remote in browser
Installation
Source
git clone https://github.com/zlj-zz/pigit.git --depth=1
cd pigit
make install
# or on Windows
python setup.py install
Development (editable install)
pip install -e ".[dev]"
TUI Mode
Pigit's primary interface is a terminal UI. Simply run pigit with no arguments to enter it.
| panel | what you can do |
|---|---|
| Status | stage / unstage / discard / ignore files; inline diff; copy path (Y); stash list; file preview on wide terminals |
| Diff | stage individual hunks; browse file history (v, p/n) |
| Commit | inline subject/body editor with lint feedback |
| History | undo the last action, browse and reverse multiple steps |
| Branch | checkout, create, rename, delete branches; scope to a sub-directory (R) |
Key bindings
| key | action | panel |
|---|---|---|
j / k, ↑ / ↓ |
navigate lists | all |
Enter |
select / open | all |
q / Esc |
back / quit | all |
? |
help | all |
a / d / i |
stage / discard / ignore | Status |
c |
inline commit editor | Status |
H |
toggle hunk staging | Diff |
u / U |
undo / undo stack | all |
z / Z |
stash push / pop | Status |
Press ? for the full per-panel list. Every key is remappable via [keybindings] — see Keybindings.
For operations that are cumbersome on the command line—such as staging individual hunks, browsing commit history with inline graphs, or resolving merge conflicts—the TUI is the recommended workflow.
[!NOTE] The TUI runs on macOS / Linux and requires an interactive terminal (both stdin and stdout must be TTYs). It will not launch in CI pipelines, scripts, or when piped. On Windows, only the CLI sub-commands are available.
CLI Usage
For scripting, CI, or quick tasks, Pigit exposes sub-commands and flags.
usage: pigit [-h] [-i] [-f] [-r] [-v] [-c [PATH]] [--create-ignore TYPE]
[--init [SHELL]] [--create-config] [--with-keybindings]
{cmd,repo,open} ...
Pigit TUI is called automatically if no parameters are followed.
cmd
Short aliases for common git operations.
Discovery
pigit cmd -l— list all short commands with help text and underlyinggitlines.pigit cmd -s <query>/--search <query>— filter by keyword.pigit cmd -t <category>— filter by category (branch, commit, index, etc.).pigit cmd -p/--pick— interactive picker (TTY only):j/kto move,Enterto run,/to filter,qto quit.
Example output from pigit cmd -l:
These are short commands that can replace git operations:
b lists, creates, renames, and deletes branches.
git branch
bc creates a new branch.
git checkout -b
bl lists branches and their commits.
git branch -vv
bd delete a local branch by name.
git branch -d
......
repo
Manage multiple repositories at once.
pigit repo add <path>— add repo(s) to the managed list.pigit repo rm <name>— remove repo(s).pigit repo ll— display summary of all repos.pigit repo cd <name>— print the path of a managed repo.pigit repo cd -p— open the interactive picker to choose a repo.pigit repo cd --output-file <path>— write the selected path to a file instead (for scripts/CI).pigit repo fetch|pull|push [<name>...]— run git operations across repos in parallel.
open
Open the current repository's remote URL in a web browser.
pigit open # open current branch
pigit open <branch> # open specific branch
pigit open -c # open at current commit
pigit open -i <number> # open a specific issue
pigit open -p # print URL instead of opening
Other flags
| flag | description |
|---|---|
-i, --information |
show repository info |
-f, --config |
display local git config |
-r, --report |
show pigit description |
-c [PATH], --count [PATH] |
code statistics (table or simple format) |
--create-ignore TYPE |
generate a .gitignore template |
--create-config |
create a config file at ~/.config/pigit/pigit.toml |
--with-keybindings |
with --create-config, dump commented keybinding defaults into the config |
Shell Integration
pigit --init generates shell completion scripts and a pigit wrapper function.
[!TIP] Run
--initonce: it sets up both tab-completion and therepo cdauto-cdwrapper. You do not need a separate completion-only step.
Add it to your shell configuration:
# ~/.bashrc or ~/.zshrc
eval "$(pigit --init)"
Supports bash, zsh, and fish. If no shell is specified, it auto-detects from $SHELL.
Auto cd with repo cd
After sourcing the init script, pigit repo cd -p automatically changes your shell's working directory when you pick a repo. The wrapper intercepts pigit repo cd, runs the picker, and cds into the selected path.
For scripts and CI, use --output-file <path> to write the selected directory to a file instead.
Configuration
Create a template config with pigit --create-config. The config lives at:
- Linux/macOS:
~/.config/pigit/pigit.toml - Windows:
%USERPROFILE%\pigit\pigit.toml
See examples/pigit.toml for a full template.
| section | key | type | default | description |
|---|---|---|---|---|
[cmd] |
display |
bool | True |
show original git command |
[cmd] |
recommend |
bool | True |
suggest corrections for wrong commands |
[counter] |
use_gitignore |
bool | True |
respect .gitignore when counting |
[counter] |
show_invalid |
bool | False |
show files that cannot be counted |
[counter] |
show_icon |
bool | True |
show file icons (requires Nerd Font) |
[counter] |
format |
str | table |
output format: table or simple |
[info] |
git_config_format |
str | table |
git config display: table or normal |
[info] |
repo_include |
list | ["remote", "branch", "log"] |
sections to show in repo info |
[repo] |
auto_append |
bool | True |
auto-add current repo to managed list |
[log] |
debug |
bool | False |
debug mode |
[log] |
output |
bool | False |
print logs to terminal |
[tui] |
auto_refresh_interval |
float | 10.0 |
auto-refresh interval in seconds (0 disables) |
[tui] |
word_diff |
bool | True |
enable word-diff in the diff viewer |
[tui] |
status_view |
str | tree |
status panel default view: flat or tree |
[tui] |
diff_preview_default |
bool | True |
show Status/Stash side diff preview on large screens (Ctrl+p on Status/Stash) |
[tui] |
log_graph_default |
bool | True |
show Branch log-graph preview on large screens (Ctrl+p on Branch) |
[tui] |
show_footer |
bool | True |
show the footer key-hint bar |
Keybindings
Remap TUI actions with a [keybindings] section. Keys are semantic strings
("c", "down", "ctrl c", " " for space); use an array for multiple keys.
To list every configurable action with its default key, regenerate the config with:
pigit --create-config --with-keybindings
This appends a commented [keybindings] block to the generated file (existing
overrides are preserved as active lines). For example:
[keybindings.branch]
checkout = "C" # default: "c"
# next = ["j", "down"] # Navigate branch list
Actions are scoped by namespace: universal, status, diff, rebase,
branch, commit, stash, recent.
Custom Commands
Define aliases and scripts in pigit.cmds.toml inside the pigit home directory.
Aliases
[cmd_new.aliases]
mybl = "bl"
mylog = "log --oneline --graph"
Scripts
[cmd_new.scripts.myscript]
steps = ["status", "log --oneline"]
help = "Show status then log"
category = "script"
# concise form for simple step lists
[cmd_new.scripts]
quick-check = ["status", "diff --cached"]
User-defined entries appear in pigit cmd -l, search, and --pick with [alias] or [script] prefixes.
Features
TUI
- Session history / undo — one-key reversal (
u) and a browsable undo stack (U). - Hunk staging — stage or unstage individual hunks directly in the diff viewer (
H). - Inline commit editor — subject/body fields with lint bar inside the TUI.
- Stash management — push, pop, and drop stashes from the status panel.
- Auto refresh — periodic background refresh of the active panel while the TUI is idle.
- Syntax highlighting — diff and file-history views tokenize source code by language.
- Adaptive layout — side-by-side preview panel on large terminals.
CLI
- Short commands — aliases like
pigit cmd stforgit status --short. - Command correction — suggests the right command when you typo.
- Code statistics — count lines/files by type with table or simple output.
.gitignoretemplates — generate from common types.- Quick open remote — open repo/commit/issue in browser.
Multi-repo & shell
- Multi-repo management —
reposub-commands for bulk operations across projects. - Shell completion — bash/zsh/fish with
pigit --init. - Auto
cd— shell wrapper enablespigit repo cd -pto change directory after picking.
Customization
- Custom keybindings — remap any TUI action via
[keybindings]; dump defaults with--create-config --with-keybindings.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pigit-1.11.2.tar.gz.
File metadata
- Download URL: pigit-1.11.2.tar.gz
- Upload date:
- Size: 394.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4317040eb30f39aceb61affe14d064ebdbed1d622528afb8744ea0d16cf4d18
|
|
| MD5 |
7b89fb9d82de2854a504433dce3188b5
|
|
| BLAKE2b-256 |
301a13276083a0edb8bd7a7639f9679ffbe29f010c033f2ce9417e3da4021a11
|
Provenance
The following attestation bundles were made for pigit-1.11.2.tar.gz:
Publisher:
ci.yaml on zlj-zz/pigit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pigit-1.11.2.tar.gz -
Subject digest:
d4317040eb30f39aceb61affe14d064ebdbed1d622528afb8744ea0d16cf4d18 - Sigstore transparency entry: 2503428759
- Sigstore integration time:
-
Permalink:
zlj-zz/pigit@e028d025e85127d2fd2e19421221cc44be44e973 -
Branch / Tag:
refs/tags/v1.11.2 - Owner: https://github.com/zlj-zz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@e028d025e85127d2fd2e19421221cc44be44e973 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pigit-1.11.2-py3-none-any.whl.
File metadata
- Download URL: pigit-1.11.2-py3-none-any.whl
- Upload date:
- Size: 499.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
598a427258a537415bbc16c96f1cc6c3f7ed27aa1faed317e5396404469c55cb
|
|
| MD5 |
ada742b8d9566a830e3a4914d2f0cc9d
|
|
| BLAKE2b-256 |
c614b2a955151fc16d974b64cafdef114121b39aa229f0ff822dc60518bfbe27
|
Provenance
The following attestation bundles were made for pigit-1.11.2-py3-none-any.whl:
Publisher:
ci.yaml on zlj-zz/pigit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pigit-1.11.2-py3-none-any.whl -
Subject digest:
598a427258a537415bbc16c96f1cc6c3f7ed27aa1faed317e5396404469c55cb - Sigstore transparency entry: 2503428821
- Sigstore integration time:
-
Permalink:
zlj-zz/pigit@e028d025e85127d2fd2e19421221cc44be44e973 -
Branch / Tag:
refs/tags/v1.11.2 - Owner: https://github.com/zlj-zz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yaml@e028d025e85127d2fd2e19421221cc44be44e973 -
Trigger Event:
push
-
Statement type: