One Tip a Week: Atuin

This week's tip of the week is Atuin. If you read my previous tip about McFly, think of Atuin as McFly's cousin with superpowers.

Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. The search interface is clean and fast.

Atuin in action

You can also search by exit codes, working directory, or even time ranges. Want all successful make commands from yesterday afternoon? Try:

atuin search --exit 0 --after "yesterday 3pm" make

McFly doesn't support multi-line history which was a deal breaker for some developers, but Atuin handles multiline commands no sweat. Those complex Docker compose commands or long curl statements won't get mangled.

Installation is pretty straightforward with curl, or choose one of the other installation options.

curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh

Then import your existing history:

atuin import auto

One thing I don't like at the moment is pressing up arrow goes into Atuin. I've disabled it for now as I like the up arrow for seeing previous commands. All you need to do is add this to your shell: eval "$(atuin init zsh --disable-up-arrow)"

But here's where it gets interesting. Unlike McFly, it provides optional and fully encrypted synchronisation (hosted or self-hosted) of your history between machines.

Like McFly, Atuin is built in Rust for maximum performance and works with bash, zsh, fish, and other popular shells. The key difference? Your command history becomes a searchable database with optional sync across machines and multiline support.

Not sure which one to use? I compare Atuin and McFly recently in my post, I Switched Shell History Tools. Here's Why.

That's it! Short and sweet. Until the next one!