Live data from Hacker News

Atuin replaces your existing shell history with a SQLite database

github.com

141–150 of 198 posts

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

#141

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…

Isn't that like... ultra slow?

It's usually ~two seconds or so for the first line to come out of OpenAI. You can see the example video in the github, though I think that was little slow.

If you have big atuin file though, creating indexes for session and cwd are good ideas so we can get the request out quickly..

edit: but much faster than searching or asking LLM for command line parameters instead

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

#142

Earlier quoted context omitted.

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.

For me one of the most common issues is when I write a regex but I have some of the escapes the wrong way around etc. So I’m giving a valid regex, but it’s not matching what I tried to match. And then I have to change it around a couple of times before it works. One reason for this is that different programs have different rules for what should be escaped when, when you write a regex. For example, I think grep is a b…

Hm... Now that I think about it, regex tools on the command line haven't been a goto recently. I used sed, awk, perl -e, et. al. constantly from the late 90s until maybe 2015 but since then I'm more likely to pop open a ipython repl or whatever and avoid those weird inconsistencies altogether. Also, developing on the old scp->LAMP stack setup required more shell script glue than the more automated contemporary setups I've been using.

I'd probably suck at it. No matter how frequently I use regex in :ex commands, I always screw up the escapes, substitutions, etc.

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

#143
post #48

Earlier quoted context omitted.

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

er, s/HISTIGNORE/HISTCONTROL/ above

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

#144

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…

That sounds awesome! We've been meaning to set up a "community showcase" section. I'd love to feature this! If you ever publish it, post a discussion!

Thanks! I'll do that after I've had more time to finish some features and clean the code up in few days. But I've released a crude version at https://github.com/TIAcode/LLMShellAutoComplete

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

#145

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…

> "...then feeds it into GPT..." explain this please

It feeds the information from atuin database as a prompt for OpenAI, like: "Latest calls for the same executable:\ncmd1\ncmd2" (I should work on my prompts, doesn't actually look that optimal, oh well). Then at the end gives the current command line and asks for few options how to finish / replace the line, with some extra requests for GPT (like don't write anything else except the command line etc).

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

#146
post #63

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.

Why put effort into removing them? They use a trivial amount of disk space.

To improve the signal to noise ratio.

Maybe 3 in every 1k of my command lines is noise. Finding anything useful in there takes effort, so I rarely use anything older than a few days.

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

#147

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.

It doesn't, I think it should but not sure how to add it to the prompt yet - I have a feeling that if I'll just add them after or before the command line, GPT will at least occasionally add hallucinated return codes to the autocompletion. Maybe I'll just add the unsuccessful codes or something, but it needs some testing.

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

#148

Earlier quoted context omitted.

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.

It doesn't, I think it should but not sure how to add it to the prompt yet - I have a feeling that if I'll just add them after or before the command line, GPT will at least occasionally add hallucinated return codes to the autocompletion. Maybe I'll just add the unsuccessful codes or something, but it needs some testing.

Cool. Neat tool idea.

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

#149
post #75

Earlier quoted context omitted.

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.

*cough* compressed row data *cough*

*cough* log rotate and gzip *cough* :D

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

#150

The problem I see is that if I ssh into 5 different remote hosts in a day, most of the commands are not executed on my host and thus not part of the local (or shared, distributed) history. I suppose this could be solved with either: - Some kind of modified ssh that sends back the commands to my host - Some kind of smart terminal that can analyze commands to build up the history Any ideas on how to practically solve t…

Every terminal has text input, but keylogger might be the simplest solution.

A keylogger doesn't see the results of tab completion.
Post reply on HN