bck-i was always a bit obtuse to me and I honestly never grokked it until I had Atuin wired into my workflow (hard) and ran into bck-i instead when SSH'd.
Anytime a peer views my screenshare, they ask "what's the funny thing that makes you so fast". I then proceed to share, first and foremost, Atuin.
Thanks Atuin team! Would love to contribute someday with more time.
I'm really intrigued by the upcoming Runbooks - they seem like they could be an absolute game changer. Any updates/teases on that front?
Nothing syncs without you registering an account or logging in
It's always been opt-in, or "opt-out by default".
Unfortunately history shows the expanded form of what's happened, so I can't go reference that I used the third word of history item 773 as an argument, I only see the resolved argument.
Alas I haven't found any hooks in zsh that show promise here. I'd really love the pure history.
One technique I've used in the past is making a quick command in vim, that takes the selection or current line, and sends it to a given terminal. And perhaps starts a new line too. Basically using vim to author commands, to build the history log. Also I get to use vim, yay.
https://github.com/tylersaunders/raven
Raven has no sync component, stores your history in a sqlite, and never tries to move data off the device. It has a similar / large overlap in features with Atuin.
Sharing here in case anyone else could benefit from it, it only supports zsh for the moment since that's what I use.
Atuin is great though!
if that's not enough, you can disable all network features via a feature flag at compile time
if you don't care for sync, there are a bunch of other projects doing this (and supporting several shells), eg:
- mcfly: https://github.com/cantino/mcfly
- resh: https://github.com/curusarn/resh
Shell history sync
Sync your shell history to all of your machines, wherever they are
In any case, thanks for building a great tool!Are there network features other than sync?
if you have someone outright cloning your entire project just to skip this opted-in privacy gap feature, it's a good indicator it's an issue to be mindful of!
Opt-in means that the user needs to actively decide to use the feature, it's OFF by default. That's currently the case for atuin (happy user without sync here).
Opt-out would mean the feature would be ON by default and users would need to actively decide NOT to use it.
Otherwise it’s offline, by default, right after install
Has anyone used fish + autuin? What are your thoughts? I'm curious to know if it is worth the extra tool, maybe I should just try it :)
Otherwise consistency is nice if you use a few setups
--
0: https://docs.atuin.sh/known-issues/
1: https://github.com/atuinsh/atuin/issues/952
When I compared Atuin with zsh-histdb again, the performance difference was stark. Zsh-histdb is just instantaneous, whereas Atuin has noticeable lag.
Atuin's ranking algorithms are also quite deficient, and I've tried all of them. I did a quality comparison before going back to zsh-hidden and found a good example: If I autocomplete on "curl cat", the first match is something like "curl http://localhost/v1/chat" that I did earlier today. If I autocomplete on "curl chat", the first match is something like "curl http://localhost/_cat".
From what I can tell, the ranking doesn't seem to consider contiguous substring matches as having higher relevance than random letters in different order. Clearly "cat" should match "cat" higher than "chat", even if they both have "h" somewhere.
(If anyone from Atuin is reading here, I'd be happy to show a screen recording of the problem.)
The fact that Atuin cannot delete old history is also a problem, especially since it gets markedly slower the more history you have. I initially imported all my history (about 100MB?) and it was dog slow. But there was no way to prune older entries, so I had to wipe it clean and then import a subset. Even then, as I said, it's clearly slower than zsh-histdb.
Zsh-histdb has other issues, and hasn't been updated in years, but it works better for me. Atuin's syncing is nice, but it's something I can live without.
We wrote some more about it here: https://blog.atuin.sh/new-encryption/
It is a very easy thing to do.
You can use atuin without syncing it between multiple machines.
I have my shell environments divided up into different distrobox containers. Some of them sync between multiple machines. Some of them don't. Depends what the shell is for.
insert_atuin_with_fzf () {
local result
result=$(atuin history list --reverse --format "{command}" | \
awk '!seen[$0]++ && length($0) > 2 && !/^j /' | \
fzf +s)
[[ -n $result ]] && LBUFFER+="$result"
}
# Bind the widget to Ctrl-Q
zle -N insert_atuin_with_fzf
bindkey -M emacs '^q' insert_atuin_with_fzf
bindkey -M emacs '^x^q' atuin-search
`workspaces = true`
in your config, to limit your history to the current git repo.
Thank you very much atuin team. Can't work without atuin installed.
Also has functions for filtering command search by directory
Being backed by SQLite tends to mean your history is more durable + is properly saved across shells too
I don't use the sync feature, but I will say that "my workflows are very machine specific" is one of the reasons I use Atuin. When working in containers, I sometimes share an Atuin database volume between them, to save history relevant to those containers.
On MacOS the main reason I reach for Atuin is that I have never been able to get ZSH to store history properly. Atuin saves history to SQLite, which so far has been much more reliable. It also enables some nice features like being able to search commands run from the same directory.
I'm interested in this as well. I currently use fzf and I'm happy with what I've got (except for me syncing would probably be a nice feature to have).
Also: I gave atuin a quick try and found the TUI to be worse than fzf. Why do I need a fullscreen ctrl-r interface? I found that distracting. But maybe that is configurable. I didn't look much further.
And also the default is now to use 40 lines, not the alt screen (has its own drawbacks)
You can set “inline_height”
As long as you're here, do you know if the column showing the amount of time the command took can be removed? I know you can remove it from "atuin history list" with history_format, but I don't see a way to remove it from the inline window.
I'm using fish + fzf atm but this looks better tbh.
By default, the user's shell history is synced to a remote server
Unless they configure and run their own localhost server
Localhost server could be but is not the default when user enters
atuin register
Instead remote server is pre-configured, asks for email, etc.Interesting design choice
I have used SQLite to store and search history instead of Postgres
Works with Bourne shell (sh), no need for Bourne-Again shell (bash) or other larger shells
What does "magical" mean in this context
As an aside, most of my usage of history is to use the last few commands I used, and so seeing the entire history each time seems like an overkill.
> bindkey '^[[A^[[A' atuin-up-search
Works much better now!
I tried to contact Atuin authors to see if I could also integrate ShellHistory with their servers, but at that time it seemed like they did not support third-party clients, and the API was not documented.
I highly recommend using tools like Atuin and ShellHistory, at this point I have 136,000 records since 2017. My shell history is the best documentation for me. If I need to do a `kubectl --raw` API call, and don't remember exactly how to write it, I just search for `kubectl raw` and get some results from the history, don't remember some advanced `git rebase`, just search the history for it.
—-
- [1] https://www.outcoldman.com/en/archive/2017/07/19/dbhist/
- [2] https://loshadki.app/shellhistory/
- [3] https://support.apple.com/en-us/108756
Edit: fixed formatting