Live data from Hacker News

Atuin replaces your existing shell history with a SQLite database

github.com

31–40 of 198 posts

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

#31
post #19

Earlier quoted context omitted.

With atuin, it's available immediately on other local session (panes, windows, tabs etc). There's also remote sync, so after some configurable amount of time, it's even available on other devices.

+ if you don’t like this, you can have it filter by session by default!

Thank you for this awesome tool!

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

#32

Earlier quoted context omitted.

With the server, is it primarily a gateway to the hosted SQLite databases? eg receives incoming shell history to store in the backend, and maybe do some searches/retrievals of shell history to pass back? eg for shell completion, etc If that's the case, then I'm wondering if it could work in with online data stores (eg https://api.dbhub.io <-- my project) that do remote SQLite storage, remote querying, etc.

We currently use postgres. The server is very dumb, verifies user authentication and allows paging through the encrypted entries. There's a PoC that allows it to work with SQLite too for single user setups - and we are thinking of switching to a distributed object store for our public server since we don't need any relational behaviour.

Interesting. Yeah, we use PostgreSQL as our main data store too. The SQLite databases are just objects that get stored / opened / updated / queried (etc) as their own individual things. :)

One of our developer members mentioned they're learning Rust. I'll point them at your project and see if they want to have a go at trying to integrate stuff.

At the very least, it might result in a Rust based library for our API getting created. :D

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

#33

Earlier quoted context omitted.

One such cost could be database size. I currently have 45k history entries in my database and it sits at roughly 15MB in size due to database indices along with the additional data we store

But it's a cost shared by all open shells, right? Well, even if it was 15MB per shell session, it should still be worth it if the startup and searching is faster. For comparison: I use extended ZSH history format, which records a timestamp and duration of the call (and nothing else), and I have ~65k entries there, with history file size, as mentioned, 3.8MB. It could be an order of magnitude larger and I still wouldn…

Yes, this is 15MB on disk size for your whole machine. We agree that the trade off is worth it for the utility and speed improvements

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

#34
post #23

I think Magical shell history is a better title.

While sqlite is pretty cool technology, it doesn't quite deserve the title of "magic".

The joke was because of the Terry Pratchett reference.

https://discworld.fandom.com/wiki/Great_A%27Tuin

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

#35
post #13

Earlier quoted context omitted.

I believe it’s a setting. You can choose to save history and either merge history on session exit or immediately. At least it is a setting for zsh

You’d think this would be even more robust with a sqlish storage backend than the usual text files used for history.

Appending to files should be atomic, so I don't think you'll run into any corruption issues just by appending.

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

#38

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.

During search, we do remove duplicates. It's not a bad idea though and I'll see how we can support it

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

#39
post #36

Has anybody seen any huge performance regressions using atuin? I installed it and simple commands take noticeably longer. Is there any way to make it faster?

We've heard some users using hard drives or networked FS and having performance issues. sqlite relies on mmap and random access of pages, which can suffer on higher latency drives
Post reply on HN