Command line history manager for bash.
History manager provides an alternative command line history storage with the ability to select a subset of commands and load it into the current Bash session so the Ctrlr search is performed on the selected subset. It has an SQLite database under the hood and, besides the executed command line, stores time, working directory, returned code and a unique terminal session identifier. All additional information may be used as a selection criterion.
There are two main usage scenarios:
It is a quite common issue when you need to repeat some actions with a previously developed project but don't remember exact commands you have used for it. History manager provides a way to recover command history related to the specific directory, particular session or both.
The recovery of a history can be assumed as synchronization between previously existed session and the current one. But it may be also useful to synchronize histories of several simultaneously opened terminal sessions so any executed command can be easily shared. History manager solves this by using the same command selection mechanism as for the history recovery case.
History manager is available as a python package:
pip install history-manager
For other installation options please follow the link
At the configuration step the history manager generates configuration file with:
hm-init
To enable hm
in the current session execute:
. ~/.hm/configuration
And modify ~/.bashrc
to enable hm
by default in future sessions:
echo ". ~/.hm/configuration" >> ~/.bashrc
More details are here.
Recovering command history related to the specific directory is performed with:
hm /path/of/interest
or for the current working directory:
hm .
To set a terminal session name and to recover the command history related to this name run the following:
hm -s "Session Name"
To synchronize history with the database using the previously given name:
hm -s
More usage examples are here.
History manager utilizes the following thirdparty projects: