Hacker News new | ask | show | jobs
by phiresky 1498 days ago
Alternatives (without judgement):

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 .

4 comments

One thing I’d like these to do (I tried a couple and settled for zsh-histdb with the fzf integration) is to be able to annotate past commands, with a description, tags or, even better, both.

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 Zsh + FZF and am very happy with it. My history is about 30K entries long and it handles like a champ.

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.

perhaps `setopt interactivecomments` and then use comments might work?
If you were a fan of your favorite band before anyone else, you may also find https://github.com/abathur/shell-hag somewhat interesting.

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.

> I'm working on adding a rich SQLite history to nushell

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?

There's also https://github.com/ellie/atuin which offers a way to sync history across systems.