# atuin — magical shell history
Replaces the default `Ctrl-R`. Every command you run is stored in a local
SQLite db (searchable, with exit code, duration, directory, timestamp).
## Use it
- **`Ctrl-R`** — open the search UI. Just start typing.
- In the UI:
- Type to fuzzy-filter; matches update live.
- **↑ / ↓** or **Ctrl-P / Ctrl-N** — move through results.
- **Enter** — run the selected command.
- **Tab** — put it on the command line to edit first (don't run).
- **Ctrl-R** (again) — cycle filter scope: global → host → session → **directory**.
(directory = only commands you ran *in this folder*. Very powerful.)
- **Esc** — cancel.
## First-time setup
```sh
atuin import auto # pull your existing ~/.zsh_history into atuin
```
## Handy commands
```sh
atuin stats # your most-used commands, totals
atuin search docker # search from the command line (non-interactive)
atuin search --cwd . # only this directory's history
```
## Why it beats default history
Survives across sessions instantly, ranks by frequency+recency, and the
per-directory filter means "what was that build command I used *here*?" is
two keystrokes away. Up-arrow still does your old substring search.