Atuin for Mere Mortals
Your shell keeps a history, and it keeps it badly: a flat text file of commands and nothing else — no record of where you ran each one, whether it worked, or how long it took, with the oldest lines falling off the top as new ones arrive. Atuin replaces that file with a database. It hooks into your shell and records every command with its working directory, its start time, its duration and its exit code, in a SQLite database on your own machine — and then it makes that past searchable: from the command line, in scripts, and with a Ctrl-R window that finds, in two keystrokes, the command you half remember from six weeks ago.
This guide explains how that works: how
to install the tool and connect it to
bash, how to import the history you
already have, what the rows it records
actually contain (opened up with
sqlite3 and read directly), how to
search them by text, by directory, by
session and by exit code, how to count
what you run, and how the configuration
changes the tool's manners. The limits
are stated plainly, including the
standing one: a complete shell history
is a diary, and this guide treats it —
and teaches you to treat it — that way.
The rule that governs everything here is stated in chapter 1: record your own shells, on your own machines, under your own account, and treat the database like the diary it is. The lab obeyed it strictly. Every command in this guide ran in a scratch account on one machine, against a fixture history written for the purpose; nothing was registered, logged in, or synced anywhere.
The lab behind this guide ran the real
thing: Atuin 18.24.2, the official
release binary with its checksum
verified, in an isolated home directory
with sync and update checks switched
off in its configuration. Against it
the lab imported a 22-command fixture
history and read back what an import
can and cannot know; drove a real
interactive bash in a terminal pane and
watched the running get recorded —
exit codes 0, 1 and 2, a two-second
sleep measured at two seconds,
directories tracked per command;
searched the database by query, by
directory, by session, by exit code and
by date, and in each of its three match
modes; opened the interactive search
and cycled its scopes with the very key
that opens it; counted the habit with
atuin stats and caught its "unique"
counter disagreeing with the database;
opened the database file itself with
sqlite3 and read the schema and the
rows; changed the configuration and
watched the same searches change their
answers; and, on a throwaway copy,
deleted a row to learn what deletion
actually does.
What the lab could not do, it did not
fake. Sync — Atuin's headline feature —
involves an account and a server, and
this guide's position is that the local
database is the centre of the tool:
chapter 11 explains sync's design, its
encryption and its key from the
documentation and the un-logged-in
surface, and labels itself
documented-only. The shell integration
was proven in bash; zsh, fish and the
others share the shape and are
described, not demonstrated.
criteria.md keeps the full ledger of
what was run and what was only read.
What this guide covers
- What Atuin is — the flat file's failures, the database that replaces it, and the rule about diaries that is part of the tool, not an afterthought
- The moving parts — the binary, the shell hooks and the session, the database and its neighbours, the configuration, and which part holds what
- Installing Atuin — the ways in, the checksum-verified tarball the lab used, the two-line configuration that keeps it local, and the doctor's first printout
- Your first history — connecting the shell, importing the past and reading honestly what an import knows, then the first live commands with real endings attached
- Searching from the command line —
atuin searchin pipes and scripts, the output shapes, and the three match modes with the fuzzy one caught in the act - The interactive search — the Ctrl-R window driven for real: the list, the scopes key, taking a command home, and the Enter warning
- Filters and context — the six scopes, directories by hand, exit codes for hunting failures, and dates for rebuilding a day
- Statistics — your most-run commands, overall and per day, with one printed number respectfully disbelieved
- Inside the database — the one table, the thirteen columns, the exit-code census, and the small file in the folder that matters most
- Configuration — the catalogue the tool prints itself, one default changed and watched, the keys worth knowing, and the two that live on the init line instead
- Sync and the server — the documented-only chapter: accounts, end-to-end encryption and the key, the hosted service and the self-hosted door, and this guide's position
- Recipes — the archive command's flags, a folder's own cheat-sheet, the failures here, last Tuesday rebuilt, and a new machine's first five minutes
- The neighbours — bash history kept well, fzf's Ctrl-R, McFly, zsh-histdb, and the notebook that still wins on purpose
- Limits — commands are not outcomes, the record starts when the hook does, imports are shadows, what delete means, and the weight of keeping everything
- Troubleshooting —
the silent shell, the
$ATUIN_SESSIONerror, the doubled import, the stolen Ctrl-R, and the scope that hid your command — four of them met in this guide's own lab - Glossary — the terms, collected in one place
What it doesn't cover
Recording anyone else's shell, ever — that is not a harder chapter of this book, it is a different and uglier activity, and chapters 1 and 14 explain the line. Running the sync server is pointed at, not taught (chapter 11 says why). The binary's younger extras — captured command output, the scripts manager, the AI-facing features that offer your history to other programs — are named in chapter 14 and left there: each deserves its own decision, and this guide stays with the history core it verified.
How to use this guide
Read chapter 1 for the model and the
rule, and chapter 2 before installing
anything — knowing which part holds
what turns later confusion into a named
problem. Chapter 4 connects your shell
and imports your past in the same
sitting as the install; do the import
before a week of live recording makes
chapter 15's duplicates your problem.
Chapter 6 is the one you will feel
daily: learn your own Enter setting
while the stakes are a harmless command.
Chapter 9 is not the optional chapter —
open the database once, so that
everything the other chapters claim
about it is something you have seen.
Chapter 11 can wait until the day a
second machine makes it a real question.
The lab's transcripts live in
atuin-lab/transcripts/; its fixture
history and configuration are
atuin-lab/fixtures/ and
atuin-lab/config.toml; its notes are
examples/lab-notes.txt.
Part of the series
This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.
Related guides:
License
The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.