https://github.com/cantino/mcfly
https://github.com/jcsalterego/historian
https://github.com/larkery/zsh-histdb + https://github.com/m42e/zsh-histdb-fzf
https://github.com/ellie/atuin
All of these except the OP (I think) use SQLite databases.
Personally I use zsh-histdb, which is great but only for ZSH. I'm working on adding a rich SQLite history to nushell so I can finally try nu: https://github.com/nushell/reedline/pull/401 .
The use case I have in mind is when I end up crafting some complicated and inscrutable incantation and being able to “earmark” it for future reference with a little bit of context that FutureMe might have forgotten by the time he thinks to reach out for the history.
Put another way, I do tend to use my shell history as a scrapbook of sorts, and I wish I was able to easily write on the margins.
Please, let me know if this is already a feature of any of these tools that I’ve completely missed.
I use a poor mans version of the tagging you speak of. I use hashtags at the end of long commands I would like to reuse.
$ <long winded shell command> #restart #remote
FZF history search finds them easily.
I found it sad that there's so much overlapping effort (here, but in profile plug-ins broadly) so I also abstracted its foundational shell glue out into its own module, https://github.com/abathur/shellswain.
I am slow-cooking them, for better and worse.
You may then be interested in my solution for bash, where Ctrl-R gives you fzy history for the given directory and Ctrl-T for all directories: https://github.com/csdvrx/bash-timestamping-sqlite
Everything goes into SQLite, which is helpful for stats - like, when do I make the most mistakes?
- Session ID: assign session IDs so multiple shells don't get mixed up. Make customizable so it's easy to integrate with screen or tmux etc. On reboot, if session IDs are restored, the history can be recovered.
- Instant write: command typed in one shell should be available to search in a different shell right away
- Search order: reverse search should return commands for the current session first, but also make other sessions available
Its great but it could be even better. For example if there is ambiguity the possible choices are shown but not as a menu.
https://github.com/curusarn/resh/issues
more expected issues from relying on a big JSON file:
The amount of saved context is currently excessive. When I started the project I didn't know exactly what I would need so I included a lot of things that were never used.
I do plan to reduce the history records to about 16 fields which should more than halve the space requirements. I haven't done this yet because I need to safely convert the existing history records people already have to the new reduced version during update which is tricky.
I tried McFly for a bit (Was interested in optimized search based on the current folder). But the whole UI was wonky and jumping around. So I came back to FZF.