Live data from Hacker News

Atuin replaces your existing shell history with a SQLite database

github.com

71–80 of 198 posts

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

#71
post #69

> English | 简体中文 > You may use either the server I host Right. And isn't this what home dirs are for?

Yeah you could totally sync your shell history if you’re using a NFS share or something, but that’s going to affect way more than just your .bash_history

Why is our localisation relevant/quoted?

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

#72
post #66

Are there ways to migrate existing shell histories with timestamps into atuin?

yep they have docs on importing https://atuin.sh/docs/commands/import

Yep! We support a whole bunch more too (fish, resh, zsh-histdb, etc), need to update the docs

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

#74

I made a script that uses atuin to get previous commands related to your current command line - latest commands ran in the same session, in the same directory, in other sessions, latest commands for the same executable etc. then feeds it into GPT and streams the replies to fzf so you can choose the best autocompletion (or it can fix problems in the line you've written already as well). On Wezterm and Kitty it can als…

I’ve been using atuin for a while and have been thinking about something like this. Please do post to GitHub!

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

#75
post #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 )

Not defending the idea of a db history but no db schema is going to beat plain text's 1 byte 0x0A per line delimiter.

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

#76
post #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 )

Ah, a fellow packrat! I have every command I ever typed into a shell since around 2005, and my history weighs in at 1 CD or 650MB (as of a couple of years ago)

I'm probably being wasteful of space because I store each session in a separate file. I used to do a lot of data analysis at the shell back in the day, and found it useful to audit sequences of commands afterwards for mistakes, or to turn them into scripts.

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

#77
post #72

Earlier quoted context omitted.

yep they have docs on importing https://atuin.sh/docs/commands/import

Yep! We support a whole bunch more too (fish, resh, zsh-histdb, etc), need to update the docs

https://github.com/ellie/atuin/blob/main/atuin-client/src/im...

> // we can skip past things like invalid utf8

No, you can't! Thanks to some bizarre escaping that happens when ZSH (and BASH, I think) dumps commands to the history file, any command with non-latin1 characters will break here and won't be read, moreover - silently! The other possibility is that you'll import wrong characters.

Grep the ZSH source for "unmetafy", you'll see; I have it extracted here: https://github.com/piotrklibert/zsh-merge-hist/blob/master/u...

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

#78

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.

> we are thinking of switching to a distributed object store for our public server

As a data point, we're using Minio (https://github.com/minio/minio) for the object store on our backend. It's been very reliable, though we're not at a point where we're pushing things very hard. :)

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

#79

I made a script that uses atuin to get previous commands related to your current command line - latest commands ran in the same session, in the same directory, in other sessions, latest commands for the same executable etc. then feeds it into GPT and streams the replies to fzf so you can choose the best autocompletion (or it can fix problems in the line you've written already as well). On Wezterm and Kitty it can als…

Does it incorporate the return code of the commands to get an approximate good/bad rating? I wonder what percentage of the CLI mistakes I make return zero anyway because it's a valid command that I simply misused.
Post reply on HN