Skip to content

MarcosAlves90/gitrex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitrex

Rust CLI TUI Git workflow

A terminal-first git manager written in Rust.
Fast CLI commands when you want precision. A TUI when you want the workflow in one place.

Features · Quick Start · Commands · Development


Overview

gitrex brings common git workflows into a focused terminal experience.

  • Defaults to a TUI in interactive terminals
  • Falls back to CLI behavior for scripts and pipes
  • Uses an embedded libgit2 backend, so it does not depend on the git binary being installed
  • Covers core repository operations: status, branch inspection, log review, checkout, switch, branch creation, clone, pull, and push
  • TUI includes a branch panel plus a wide Git Graph panel with tree lines, commit navigation, and commit actions

Features

Workflow What you get
Repository status Branch, upstream, divergence, and working tree changes
Branch management List branches, checkout, switch, and create branches from another ref
Commit history Compact log output with configurable limits
Git graph Full commit tree, commit selection, rotating selected subject text, and commit actions
Remote operations Clone, pull, and push from the same CLI
TUI mode A terminal UI for working inside the repo without leaving the keyboard

Quick Start

Build locally

cargo build --release

Run the TUI

cargo run -- tui

TUI navigation

  • 1/2/3 switch between status, branches, and graph
  • j/k or arrow keys move within the active panel
  • In Branches, Enter opens branch actions
  • In Git Graph, Enter opens commit actions for the hovered commit
  • The selected commit subject scrolls when it does not fit, while date and hash stay aligned

Run a command directly

gitrex status
gitrex branch
gitrex log --limit 20

Commands

Command Description
gitrex Launches the TUI in interactive terminals
gitrex status Prints the current branch, upstream, divergence, and working tree state
gitrex branch Lists local branches and upstream tracking refs
gitrex log --limit <n> Shows recent commits, defaulting to 20
gitrex checkout <target> Checks out an existing branch or ref
gitrex switch <target> Switches to a branch
gitrex create-branch <name> --from <target> Creates a new branch, optionally from another ref
gitrex clone <repository> [directory] Clones a repository to an optional destination
gitrex pull [remote] [branch] Pulls updates from a remote and branch
gitrex push [remote] [branch] Pushes commits to a remote and branch
gitrex tui Opens the TUI explicitly

Example Output

branch: main
upstream: origin/main
working tree: clean
* main -> origin/main
  feature/login
  release

How It Fits Together

flowchart TD
  A[User opens gitrex] --> B{Interactive terminal?}
  B -- yes --> C[TUI]
  B -- no --> D[CLI command]
  C --> E[Status / Branch / Log / Remote actions]
  D --> E
Loading

Development

Build

cargo build

Test

cargo test

Project context

Tech Stack

  • Rust 2021
  • clap for CLI parsing
  • crossterm for terminal control
  • git2 for the embedded Git backend
  • chrono for date formatting
  • ratatui for the TUI
  • anyhow and thiserror for error handling

License

No license file is present in this repository yet.

About

A terminal-first git manager written in Rust.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages