Skip to content

myersm0/recall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

recall

Search and act on shell command history with optional context (timestamps, working directories) and regex filtering.

Rust CLI and a shell wrapper.

Install

curl -fsSL https://raw.githubusercontent.com/myersm0/recall/main/install.sh | sh

Then add to your shell profile (.bashrc, .zshrc, etc.):

source "$HOME/.local/share/recall/recall.sh"

Usage

recall [pattern] [flags]

Displays a numbered menu of matching commands from your history. Type a number to yank that command to clipboard.

Examples

recall                     # browse recent history
recall git                 # commands matching "git"
recall -p                  # commands run under the current directory tree
recall -d myproject        # commands run in directories matching "myproject"
recall "my pattern" -n 25  # show up to 25 results matching regex "my pattern"
recall -v                  # verbose mode -- include timestamps and directories
recall -H 5000             # recall with a history context size of 5000 (how deep in history to read)

Flags

Flag Description
-r <regex> Filter by command pattern (same as positional arg)
-p Restrict to current directory tree
-d <regex> Filter by directory pattern
-n <number> Max results (default 15)
-v Show timestamps and directories

How it works

The shell wrapper installs a PROMPT_COMMAND hook that logs each command to ~/.bash_history_extended as CSV with base64-encoded fields.

The binary reads from the tail of this file, so performance stays constant as the file grows. By default the most recent 1000 items of history will be considered. Use option -H $n to expand/reduce this to read $n lines instead.

Config

Optional. Place at ~/.config/recall/config.toml:

history_path = "~/.bash_history_extended"

About

A Unix shell utility to maintain, retrieve, and analyze your shell command history

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors