Live data from Hacker News

Atuin replaces your existing shell history with a SQLite database

github.com

41–50 of 198 posts

Re: Atuin replaces your existing shell history with a SQLite database

#41
There's also McFly which does the same thing.

https://github.com/cantino/mcfly

I've only used McFly and found it to be pretty great. My only complaint is the default search mode is SQL strings, so you have to use `%` for wildcards. I wish it was a more forgiving, less exact search.

Has anyone used both and could compare them?

Re: Atuin replaces your existing shell history with a SQLite database

#42

No one ever addresses the most important problem: how to separate commands that one would like to retain (preferably indefinitely) vs garbage commands (like cd, ls, cat, etc.) that should better be wiped in a few days.

With bash's HISTIGNORE, I can consciously prefix my command with a space to prevent it being added to history.

ls I usually don't care about, but there are directories I regularly cd to, so it would be nice to have those in history.

I can think of a neat heuristic, which is that I often cd to an absolute or home directory, so if the path starts with / or ~ I'll possibly want to cd there again in the future. Changing to a relative path on the other hand, I tend to do more rarely and while doing more ephemeral work.

Re: Atuin replaces your existing shell history with a SQLite database

#43
post #40

either I'm getting old, or there is a lot of energy being spent on quasi-useless "improvements" these days

It's always fair to be critical of these things. However the energy we spend on this is our concern.

At the end of the day, Ellie and I work on this because these features actually improve our workflows. The directory search feature is probably my favourite, and the sync feature is the key feature Ellie wanted to begin with.

Re: Atuin replaces your existing shell history with a SQLite database

#45
cool tool. i think improvement in this area for non-shell-specific solutions is always good.

one thing i haven't seen yet (correct me if i'm wrong...) is an easy way to get all this stuff to magically appear on a new machine you've ssh'd into for the first time. i've hacked up my own in the past but that's got issues with tunneling and multi-hops. anyone know a solution to this? maybe a feature request?

Re: Atuin replaces your existing shell history with a SQLite database

#47

cool tool. i think improvement in this area for non-shell-specific solutions is always good. one thing i haven't seen yet (correct me if i'm wrong...) is an easy way to get all this stuff to magically appear on a new machine you've ssh'd into for the first time. i've hacked up my own in the past but that's got issues with tunneling and multi-hops. anyone know a solution to this? maybe a feature request?

Not 100% sure how that could work, but definitely very interested in making it happen! I don’t think there’s an issue for it yet, so feel free to open

Re: Atuin replaces your existing shell history with a SQLite database

#48
post #8

Earlier quoted context omitted.

there's this little gotcha you might want to be aware of: https://github.com/ellie/atuin/issues/752#issuecomment-14518...

It sounds serious, but there's not much info in that issue of what's going wrong, why it's going wrong, etc. (?)

it's not serious for most people I guess, but if you rely on bash's HISTIGNORE and don't disable bash's built-in history mechanism when you adopt Atuin, then this is as serious as you are paranoid

Re: Atuin replaces your existing shell history with a SQLite database

#49
post #40

either I'm getting old, or there is a lot of energy being spent on quasi-useless "improvements" these days

Have you considered that you might not be the target audience? Atuin’s ability to sync across computers while being able to separate the context the command was used in has been incredibly useful to my team.

Re: Atuin replaces your existing shell history with a SQLite database

#50

No one ever addresses the most important problem: how to separate commands that one would like to retain (preferably indefinitely) vs garbage commands (like cd, ls, cat, etc.) that should better be wiped in a few days.

With bash's HISTIGNORE, I can consciously prefix my command with a space to prevent it being added to history. ls I usually don't care about, but there are directories I regularly cd to, so it would be nice to have those in history. I can think of a neat heuristic, which is that I often cd to an absolute or home directory, so if the path starts with / or ~ I'll possibly want to cd there again in the future. Changing…

* HISTCONTROL=ignoreboth

* prefix with space the commands you don't want to keep

* edit your existing .bash_history by prefixing all commands with space (then reload with history -r)

* after session exit or on next login, edit the new commands at the end (vi ~/.bash_history && history -r)

* use comments on the commands to make it easy to search (use keywords)

* group command lines by category (e.g. package manager, git, ssh, backup, find, dev)

Post reply on HN