Skip to content
C.W.K.
Stream
Lesson 07 of 08 · published

Atuin: Shell History on Steroids

~10 min · atuin, history, sync

Level 0Window Tourist
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

Beyond the flat history file

Default zsh history is a text file. atuin upgrades it to a SQLite-backed store with: timestamped entries, exit code, directory, hostname, optional encrypted sync across machines, and a fuzzy interactive search.

Install

brew install atuin
atuin import auto             # imports your existing zsh history
echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
exec zsh

The init line replaces Ctrl+R with atuin's UI. Your old zsh history stays — atuin reads it once on import.

What you get

  • Filter by directory: "only commands run in this project."
  • Filter by host: "only commands run on the office Mac."
  • Filter by exit code: skip every command that failed.
  • Time-of-day stats: most-used commands by hour.
  • Optional sync: end-to-end encrypted, hosted by you or by the Atuin team.

Sync

atuin register -u me -e me@example.com
atuin login -u me
atuin sync                       # push + pull
atuin sync -f                    # force full sync

Encrypted with a passphrase you set; the server never sees plaintext history. Self-host if you prefer — the server is also open source.

History is sensitive data

Command history can contain paths, hostnames, arguments, and accidentally pasted secrets. Review filters, retention, encryption-key recovery, and sync policy before importing or uploading it. Also decide whether fzf, Atuin, or the shell owns Ctrl+R so integrations do not silently replace one another.

Define exclusions before synchronization

Decide how tokens, passwords, and one-time authorization URLs are kept out before sharing history across machines. Prefer stdin or a credential store over secret command-line arguments.

Better search expands the retained record

Directory and host metadata improve recall while recording project names, server names, and work times. Set retention, deletion, and backup policy for this productivity data.

Ctrl+R needs one owner

fzf and Atuin can both bind history search. Choose an owner explicitly and inspect initialization order when the wrong interface appears.

Code

Quick atuin tour·bash
brew install atuin
atuin import auto
echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
exec zsh
# Press Ctrl+R
# Filter by dir / host / exit code from inside the picker

External links

Exercise

Install atuin. Run atuin import auto. Add the eval line. Open a new terminal, press Ctrl+R, and filter by directory using the toggle keys shown in the help. Spot how much cleaner the history feels.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.