Magi is inspired by Magit, the legendary Emacs Git interface. The goal of this project is to create an as faithful Magit experience as possible for the terminal, removing the need for Emacs.
- Keyboard-Centric Interface
- Faithful emulation of Magit
- Vi(m) bindings first class citizen
- No Emacs Required
# Homebrew
brew tap anddani/homebrew-magi
brew install magi
# Nix flake
inputs = {
magi.url = "github:anddani/magi";
}
...
packages = [
magi.packages.${SYSTEM}.default;
]
# Arch Linux (AUR)
yay -S magi
All text inputs (branch names, search, filters, credentials) support readline-style editing:
| Keys | Action |
|---|---|
Left/Right, Ctrl+b/Ctrl+f |
Move by character |
Alt+Left/Alt+Right, Alt+b/Alt+f |
Move by word |
Home/End, Ctrl+a/Ctrl+e |
Start/end of line |
Backspace, Ctrl+h |
Delete character backward |
Delete, Ctrl+d |
Delete character forward |
Alt+Backspace, Ctrl+w, Ctrl+Backspace |
Delete word backward |
Alt+d |
Delete word forward |
Cmd+Backspace, Ctrl+u |
Delete to start of line |
Ctrl+k |
Delete to end of line |
Notes for macOS users:
Cmd+Backspacerequires a terminal that supports the kitty keyboard protocol (kitty, Ghostty, WezTerm, recent iTerm2).Ctrl+uworks everywhere.- The
Alt(Option) bindings require "Use Option as Meta key" to be enabled in Terminal.app/iTerm2.
There are many Git TUIs out there. Here are a couple:
They are all great but what they lack is the "editor like" experience you get with Magit. This project aims to allow Magit users to use this application with low friction. Here are a few features that the aforementioned applications lack:
- Search through buffer: By pressing '/', you can search through the information in the visible buffer
- Visual select: Entering visual select using 'V' will allow you to stage a range of lines in a hunk, select a few files to stage, or a few stashes to drop
- Faithful keybindings: Magi will preserve the default keybindings in Magit+Evil (and potentially Emacs bindings) in order to make onboarding easier
- Legible commit graph: Easy navigation and overview of the commit graph
- Contextual commands: All commands are available at any time, using the highlighted or selected line(s) as context to automatically figure out intent
- Repository status view (HEAD, push ref, tags)
- Untracked files display
- Staged/unstaged changes with inline diffs
- Stage and unstage files
- Expand/Collapse sections
- Keyboard navigation
- Move up/down
- Scroll viewport
- Visual select
- User dismissable popup
- Toast
- Configurable color themes
- Commands
- Apply
- Branch
- Bisect
- Commit
- Clone
- Fetch
- Pull
- Help
- Log
- Local
- Other
- Related
- Local branches
- All branches
- All references
- Current reflog
- Other reflog
- HEAD reflog
- Shortlog
- Merge
- Remote
- Submodule
- Subtree
- Push
- Rebase
- Tag
- Note
- Revert
- Apply patches
- Format patches
- Reset
- Show refs
- Stash
- Worktree
- Applying changes
- Apply
- Reverse
- Discard
- Stage
- Unstage
- Stage all
- Unstage all
