Home

Awesome

Serie

Crate Status

A rich git commit graph in your terminal, like magic πŸ“š

<img src="./img/demo.gif">

(This demo shows Ratatui repository!)

About

Serie (/zéːriΙ™/) is a TUI application that uses the terminal emulators' image display protocol to render commit graphs like git log --graph --all.

Why?

While some users prefer to use Git via CLI, they often rely on a GUI or feature-rich TUI to view commit logs. Others may find git log --graph sufficient.

Personally, I found the output from git log --graph difficult to read, even with additional options. Learning complex tools just to view logs seemed cumbersome.

Goals

Non-Goals

Requirements

Installation

Cargo

$ cargo install --locked serie

Arch Linux

$ pacman -S serie

Homebrew (macOS)

$ brew install lusingander/tap/serie

NetBSD

$ pkgin install serie

Downloading binary

You can download pre-compiled binaries from releases.

Build from source

If you want to check the latest development version, build from source:

$ git clone https://github.com/lusingander/serie.git
$ cd serie
$ cargo build --release # Unless it's a release build, it's very slow.
$ ./target/release/serie

Usage

Basic

Run serie in the directory where your git repository exists.

$ cd <your git repository>
$ serie

Options

Serie - A rich git commit graph in your terminal, like magic πŸ“š

Usage: serie [OPTIONS]

Options:
  -p, --protocol <TYPE>  Image protocol to render graph [default: auto] [possible values: auto, iterm, kitty]
  -o, --order <TYPE>     Commit ordering algorithm [default: chrono] [possible values: chrono, topo]
      --preload          Preload all graph images
  -h, --help             Print help
  -V, --version          Print version

-p, --protocol <TYPE>

A protocol type for rendering images of commit graphs.

By default auto will guess the best supported protocol for the current terminal. Kitty terminals are detected as kitty via an environment variable, and all others are assumed to support iterm.

Refer to Compatibility for details.

-o, --order <TYPE>

--order chrono will order commits by commit date if possible.

<img src="./img/order-chrono.png" width=500>

--order topo will order commits on the same branch consecutively if possible.

<img src="./img/order-topo.png" width=500>

--preload

By default, graph images are generated and loaded lazily as needed.

If --preload is specified, all graph images will be generated and loaded at startup. This can result in smoother scrolling, as the images are already available, and might reduce memory usage. However, this may lead to slower startup times, especially for large repositories.

Keybindings

You can see the keybindings by pressing the ? key.

The default key bindings can be overridden. Please refer to default-keybind.toml and add it to config file.

<details> <summary>List of all default keybindings</summary>

Common

KeyDescriptionCorresponding keybind
<kbd>Ctrl-c</kbd> <kbd>q</kbd>Quit appforce_quit quit
<kbd>?</kbd>Open helphelp_toggle

Commit List

KeyDescriptionCorresponding keybind
<kbd>Down/Up</kbd> <kbd>j/k</kbd>Move down/upnavigate_down navigate_up
<kbd>g/G</kbd>Go to top/bottomgo_to_top go_to_bottom
<kbd>Ctrl-f/b</kbd>Scroll page down/uppage_down page_up
<kbd>Ctrl-d/u</kbd>Scroll half page down/uphalf_page_down half_page_up
<kbd>H/M/L</kbd>Select top/middle/bottom of the screenselect_top select_middle select_bottom
<kbd>Enter</kbd>Show commit details<br>Apply search (if searching)confirm
<kbd>Tab</kbd>Open refs listref_list_toggle
<kbd>/</kbd>Start searchsearch
<kbd>Esc</kbd>Cancel searchcancel
<kbd>n/N</kbd>Go to next/previous search matchgo_to_next go_to_previous
<kbd>c/C</kbd>Copy commit short/full hashshort_copy full_copy

Commit Detail

KeyDescriptionCorresponding keybind
<kbd>Esc</kbd> <kbd>Backspace</kbd>Close commit detailsclose cancel
<kbd>Down/Up</kbd> <kbd>j/k</kbd>Scroll down/upnavigate_down navigate_up
<kbd>g/G</kbd>Go to top/bottomgo_to_top go_to_bottom
<kbd>c/C</kbd>Copy commit short/full hashshort_copy full_copy

Refs List

KeyDescriptionCorresponding keybind
<kbd>Esc</kbd> <kbd>Backspace</kbd> <kbd>Tab</kbd>Close refs listclose cancel ref_list_toggle
<kbd>Down/Up</kbd> <kbd>j/k</kbd>Move down/upnavigate_down navigate_up
<kbd>g/G</kbd>Go to top/bottomgo_to_top go_to_bottom
<kbd>Right/Left</kbd> <kbd>l/h</kbd>Open/Close nodenavigate_right navigate_left
<kbd>c</kbd>Copy ref nameshort_copy

Help

KeyDescriptionCorresponding keybind
<kbd>Esc</kbd> <kbd>Backspace</kbd> <kbd>?</kbd>Close helpclose cancel help_toggle
<kbd>Down/Up</kbd> <kbd>j/k</kbd>Scroll down/upnavigate_down navigate_up
<kbd>g/G</kbd>Go to top/bottomgo_to_top go_to_bottom
</details>

Config

Config files are loaded in the following order of priority:

If the config file does not exist, the default values will be used for all items. If the config file exists but some items are not set, the default values will be used for those unset items.

Config file format

The values set in this example are the default values.

[ui.list]
# The minimum width of a subject in the commit list.
# type: u16
subject_min_width = 20
# The date format of a author date in the commit list.
# The format must be specified in strftime format.
# https://docs.rs/chrono/latest/chrono/format/strftime/index.html
# type: string
date_format = "%Y-%m-%d"
# The width of a author date in the commit list.
# type: u16
date_width = 10
# Whether to show a author date in the commit list in local timezone.
# type: boolean
date_local = true
# The width of a author name in the commit list.
# type: u16
name_width = 20

[ui.detail]
# The height of a commit detail area.
# type: u16
height = 20
# The date format of a author/committer date in the commit detail.
# The format must be specified in strftime format.
# https://docs.rs/chrono/latest/chrono/format/strftime/index.html
# type: string
date_format = "%Y-%m-%d %H:%M:%S %z"
# Whether to show a author/committer date in the commit list in local timezone.
# type: boolean
date_local = true

[ui.refs]
# The width of a refs list area.
# type: u16
width = 26

[keybind]
# See ./assets/default-keybind.toml for a specific example configuration.
# ...

Compatibility

Supported terminals

These image protocols are supported:

The terminals on which each has been confirmed to work are listed below.

Inline Images Protocol

Terminal emulatorSupportNote
iTerm2β—‹But slower than other terminals
WezTermβ—‹
VSCode integrated terminalβ—‹Requires the terminal.integrated.enableImages setting to be enabled
Hyperβ–³>=v4.0.0, not yet officially released
Tabbyβ–³The graph background is not transparent

Terminal graphics protocol

Terminal emulatorSupportNote
kittyβ—‹

Reporting Compatibility

Please share your experience with other terminal emulators on the Discussions.

Contributing

To get started with contributing, please review CONTRIBUTING.md.

Contributions that do not follow these guidelines may not be accepted.

Screenshots

<img src="./img/list.png" width=600> <img src="./img/detail.png" width=600> <img src="./img/refs.png" width=600> <img src="./img/searching.png" width=600> <img src="./img/applied.png" width=600>

The following repositories are used as these examples:

License

MIT