Skip to content

anddani/magi

Repository files navigation

icon

Magi

A terminal-based Git client.


Status: In development Language: Rust Built with Ratatui License: MIT

Features and goals

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

Welcome to VHS

Installation

# 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
    

Text editing keys

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+Backspace requires a terminal that supports the kitty keyboard protocol (kitty, Ghostty, WezTerm, recent iTerm2). Ctrl+u works everywhere.
  • The Alt (Option) bindings require "Use Option as Meta key" to be enabled in Terminal.app/iTerm2.

Motivation

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

Roadmap

  • 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

License

MIT

About

A keyboard-driven Git TUI inspired by Magit

Resources

License

Stars

5 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages