Skip to content

Recipes

Outcome: a pocketful of questions the database answers well, each small enough to type from memory. Every ingredient — the flags, the scopes, the modes — was proven in earlier chapters; nothing here introduces new machinery.

The command that built that archive

You remember the shape, not the flags:

atuin search --search-mode prefix tar

or Ctrl-R and start typing tar czf. The preview line (chapter 6) shows the whole command before you commit to it, which is where the excludes and the odd path come back to you.

What do I do in this folder?

cd /path/to/project
atuin search --filter-mode directory

Interactive, for browsing; or the scripted form for a list. Add a query — atuin search --filter-mode directory docker — and it is the project's own cheat-sheet, written by your past self. On a repository, swap directory for workspace and the net widens to the whole tree.

Show me my failures here

atuin search --filter-mode directory --exclude-exit 0

Everything run here that did not end cleanly — in the lab, exactly the two deliberate failures of chapter 4. Remember the imported rows: their exit is −1, which is "not zero", so on a history with imports this list is topped by antiques. Bound it by date (--after 2026-10-01) or accept the archaeology lesson.

Rebuild last Tuesday

atuin search --after 2026-10-20 --before 2026-10-21 --reverse

One day's commands in the order you ran them — the upgrade you are repeating on the other machine, the incident you are writing up, the setup steps that turned into documentation. --reverse matters here: a story reads forward.

The long and the slow

Chapter 5's --format with {duration} and a sort answers which of my builds is the slow one:

atuin search --format "{duration} {command}" make

or open the database as chapter 9 does and let SQL group and average by command. The database does not mind being asked directly; that is rather the point of it being yours.

A new machine's first five minutes

Install (chapter 3), add the init line (chapter 4), then before the new shell writes much of its own:

atuin import auto

The old machine's exported history file — or this machine's pre-existing shell history — becomes the seed. Chapter 15's duplicate warning applies: import once, early, and let live recording take it from there. If chapter 11's day ever comes, the key file makes the same journey by a more careful road.

A command you run every day, shorter

atuin stats --count 5 (chapter 8) shows the regulars. The one at the top that is forty characters long is a shell alias asking to happen. Atuin will not write the alias for you; it will, however, keep proving you need it, five bars at a time.