I decided to implement this using bash. I have a working prototype running on one machine. If anyone wants to help me refine it, let me know and I'll post what I've done on GitHub.

Please do post. I'd love to have a smaller bash alternative to this tool.

- Save a copy of your current .bash_history file. You can import its contents into the sqlite "commands" table later.

- Add both files in this gist to $BASH_HOME.

https://gist.github.com/chmaynard/dbcaed11534dc54bdc90856d18...

- Install .bash-preexec.sh in $HOME (see https://github.com/rcaloras/bash-preexec).

- Append this command to your shell startup file (e.g. $BASH_HOME/.bashrc):

    source $BASH_HOME/bash_history.sh
- Open a new bash window. You should see the message "bash-preexec is loaded."

Enjoy! Please share your feedback in the gist comments section.

(Memo to self: Package this up in a repo with a proper README.)