git-custom-cli
gct is a fast, keyboard-driven terminal UI for creating Git commits with a custom date, branch, and multiline message.
It is written in Rust and uses crossterm for a responsive Windows, macOS, and Linux terminal interface.
Install
Install the published crate with Cargo:
Then run it inside an existing Git repository:
The executable is named gct, while the package is named git-custom-cli.
Requirements
- Rust and Cargo 1.74 or newer
- Git 2.x available on
PATH - A terminal that supports raw keyboard input
Modern Windows Terminal, PowerShell, Command Prompt, macOS Terminal, and common Linux terminals are supported.
What It Does
gct provides a menu-driven commit workflow:
- Shows the current branch and working-tree status.
- Lets you edit the commit date with a keyboard-controlled date mask.
- Lets you edit the commit time with a keyboard-controlled time mask.
- Lets you choose the branch to push.
- Provides an inline multiline message editor.
- Provides an external editor option using
VISUAL,EDITOR, Notepad on Windows, orvion Unix-like systems. - Shows a final summary before any Git operation runs.
- Stages all files and creates a normal or amended commit.
- Saves successful values for the next run.
- Optionally pushes to
originafter the commit.
Menu Controls
| Key | Action |
|---|---|
| Up / Down | Move through the menu |
w / s |
Move through the menu |
| Enter / Space | Select an item |
Escape / q |
Cancel the current menu |
| Ctrl+C | Cancel and exit |
The interface uses a centered panel that adapts to the terminal size. The active menu item is highlighted, and the status header shows the current branch and working-tree state.
Date and Time Editing
Date format:
YYYY-MM-DD
Time format:
HH:MM:SS
The highlighted slot is the current keyboard cursor. Use digits to fill it, then move automatically to the next slot. Left and Right move between slots; Home and End jump to the first and last slot; Backspace and Delete clear values.
Invalid calendar dates and out-of-range times are rejected before continuing.
Commit Modes
Normal commit
Runs:
git add .
git commit -m "message"
The selected date is passed through both GIT_AUTHOR_DATE and GIT_COMMITTER_DATE.
Amend
Amend mode runs:
git add .
git commit --amend -m "message"
If you push an amended commit, gct uses --force-with-lease.
Dry run
Dry run validates the values and displays the commands without staging, committing, saving preferences, or pushing.
Saved Preferences
After a successful commit, gct stores the last date, branch, and message in a JSON configuration file.
Typical location:
Windows: %USERPROFILE%\\.config\\git-commit-tui\\config.json
macOS/Linux: ~/.config/git-commit-tui/config.json
Clear saved values with:
External Editor
Editor selection uses this order:
VISUALEDITORnotepadon Windowsvion macOS/Linux
Example:
$env:EDITOR = "code --wait"
gct
Error Behavior
Errors are returned cleanly and the terminal is restored before the message is printed. Common errors include:
- Running outside a Git repository
- Invalid dates or times
- Empty branch or commit message
- Git identity not configured
- Git commit or push failures
- External editor startup or exit failures
Build From Source
The optimized executable is created at:
target/release/gct
Run checks locally:
Project Layout
src/main.rs CLI entry point and application workflow
src/input.rs Menu, editors, date/time input, confirmations
src/terminal.rs Centered terminal UI and redraw handling
src/git.rs Git subprocess operations
src/config.rs Saved preference storage
src/model.rs State and validation helpers
License
Licensed under the MIT License. See LICENSE.