hist is a fast shell history manager written in Odin.
It captures shell commands with metadata (exit code, duration, timestamp), stores them in a compact local file-based database, and provides an interactive TUI to fuzzy-search through your history.
- Interactive TUI search — fuzzy matching, table display with columns for command, timestamp, and duration
- Configurable table widget — customizable borders (
DEFAULT_BORDERS,ROUNDED_BORDERS,ASCII_BORDERS), optional headers, scrollable rows, flexible/fixed column widths - Zsh integration —
preexec/precmdhooks +Ctrl+RZLE widget - Paginated history loading — navigate large histories with
Ctrl+R(next page) /Ctrl+G(previous page) - Fuzzy search — type to filter; results update instantly
- Local persistence — data stored under
~/.config/hist
- Odin toolchain
make
make buildTargets:
make build— debug build (./hist)make debug— alias for debug buildmake release— optimized release binarymake release-all— build dependencies (SQLite) + release binarymake build-deps— download and compile SQLite dependencymake test— run testsmake run— run with address sanitizer
Place the built hist binary somewhere in your PATH:
cp ./hist /usr/local/bin/histAdd to your ~/.zshrc:
eval "$(hist init zsh)"This sets up:
preexechook — captures command text and start timeprecmdhook — records exit code and durationhist-searchZLE widget bound toCtrl+R
Then reload:
source ~/.zshrchist init zsh
Prints the Zsh shell integration script.
hist add start <cmd>
Creates a history record and prints a record ID.
hist add end <id> <exit_code> <duration_ms>
Completes an existing history record with exit code and duration.
hist search
Launches the interactive TUI search.
| Key | Action |
|---|---|
| Type | Filter commands (fuzzy match) |
Up / Down |
Navigate results |
Enter |
Select and print command |
Esc / Ctrl+C |
Exit |
Ctrl+R |
Load next page of history |
Ctrl+G |
Load previous page of history |
hist version
Prints the application version (currently 0.0.2).
Stored under ~/.config/hist/:
histdb.log— append-only command loghistdb.idx— binary index for fast lookupshist.log— application log