Live data from Hacker News

Atuin replaces your existing shell history with a SQLite database

github.com

51–60 of 198 posts

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

#51
I have been using sqlite database since 2017 [1], has over 100,000 items in the database at this point. The database is almost 0.5GB, but I also use Full-Text-Search capabilities of sqlite. 2 years ago I have built a mac application [2], that syncs items via iCloud, and it only works on the macOS.

I would highly recommend anyone who spend a lot of time in terminal to improve their shell history by using atuin or similar tools, cannot tell how many times it actually helped me to find some important information there, about how I did one thing or another.

-

- [1] https://www.outcoldman.com/en/archive/2017/07/19/dbhist/

- [2] https://loshadki.app/shellhistory/

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

#52
post #40

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

You must be getting old because you're unable to see the irony in spending the time and energy to make a comment decrying the quasi-usefulness of how others choose to spend their energy.

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

#56
post #40

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

On the getting old part, there's definitely a point where someone has enough bagage thay most additional tools are solving a problem they already worked around or solved a different way. For someone new to the field, this tool is on the same footing as the rest and could fit them better.

As an aside, the part I like the most about our field is the ability for a single or two devs to build themselves the tools they exactly need, and potentially share it to the community with low friction.

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

#58

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.

While that’s certainly useful to cull trivial commands, it can also behoove the user to remove commands done wrong.

Coming back several months later to be gifted with several, very similar commands of which only one is right can be frustrating. The history records the failed tries as well as the successes.

Mind, the errors give a place to start, but if it’s far enough removed from the original event it may well be ambiguous enough to send you to a search engine anyway, especially if you have the memory of a goldfish like I do.

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

#59

I have been using sqlite database since 2017 [1], has over 100,000 items in the database at this point. The database is almost 0.5GB, but I also use Full-Text-Search capabilities of sqlite. 2 years ago I have built a mac application [2], that syncs items via iCloud, and it only works on the macOS. I would highly recommend anyone who spend a lot of time in terminal to improve their shell history by using atuin or simi…

At 0.5GB that's 5k per entry -- what are you storing for each?

For comparison, my (non-work) history since 2012 (plain text) is 181k entries, and takes 25MB. I store the command along with when and where you ran it. (https://www.jefftk.com/p/logging-shell-history-in-zsh)

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

#60
post #29

This is the feature I've been looking for: "log exit code, cwd, hostname, session, command duration, etc"

you can mostly do that in bash: export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/stuff/logs/bash-history-$(date "+%Y-%m-%d").log; fi' makes files like stuff/logs/bash-history-2023-05-06.log that contain 2023-05-06.11:42:38 /home/dv 3737 2023-05-06 11:42:38 cat .bashrc then you can make some commands to grep through this

Or use the excellent bash-preexec plugin that atuin itself relies on to achieve this in a cleaner way: https://github.com/rcaloras/bash-preexec
Post reply on HN