Atuin Shell history, synced

Version 18.23.0 · source

Start here

eval "$(atuin init zsh)"
Hook into your shell
atuin import auto
Bring in old history
Ctrl+R
Search history (TUI)
atuin search <query>
Search from the CLI
atuin history list
List recorded commands
atuin stats
Usage summary
atuin register -u <name> -e <mail>
Create sync account
atuin sync
Sync now

Concepts

  1. Shell hook preexec / precmd
  2. Local DB SQLite
  3. Sync server end-to-end encrypted
  4. Other machines same history

Setup

eval "$(atuin init zsh)"
Enable in zsh (~/.zshrc)
eval "$(atuin init bash)"
Enable in bash (~/.bashrc)
Recent versions load bash-preexec themselves; ble.sh also works.
atuin init fish | source
Enable in fish (config.fish)
atuin init nu | save <file>
Generate nushell init script
atuin import auto
Import history of current shell
atuin import <shell>
Import bash, zsh, fish history
atuin init <shell> --disable-up-arrow
Keep Up arrow untouched
atuin init <shell> --disable-ctrl-r
Keep Ctrl+R untouched
atuin doctor
Diagnose setup problems
atuin info
Show paths and version
atuin gen-completions --shell <shell>
Generate completions

Search UI

Ctrl+R
Open search from the prompt
Up
Open search from the prompt
Enter
Run selected command
Tab
Paste selected command to edit
Esc / Ctrl+G
Cancel, keep original input
Ctrl+R
Cycle filter mode (inside UI)
Ctrl+S
Cycle search mode
Alt+1-9
Pick result by number
Ctrl+N / Ctrl+P
Next / previous result
Ctrl+O
Open inspector
Ctrl+Y
Copy selected command
Ctrl+A d
Delete selected entry
Ctrl+A D
Delete all entries matching it
Ctrl+U
Clear the query line

Search (CLI)

atuin search <query>
Search history, print matches
atuin search -i <query>
Open interactive search
atuin search --cwd <dir> <query>
Only commands run in a directory
atuin search --exit 0 <query>
Only successful commands
atuin search --exclude-exit 0 <query>
Only failed commands
atuin search --after "yesterday 3pm"
Only commands after a time
atuin search --before <time>
Only commands before a time
atuin search --limit <n>
Cap number of results
atuin search --reverse <query>
Oldest first
atuin search --human <query>
Readable times and durations
atuin search --format "{time} {command}"
Custom output format
Placeholders: {command} {directory} {duration} {user} {host} {time} {exit} {relativetime}.
atuin search --delete <query>
Delete matching entries

History and stats

atuin history list
List recorded history
atuin history list --cwd
Only this directory
atuin history list --session
Only this shell session
atuin history list --cmd-only
Commands without metadata
atuin history list --format "{time} - {duration} - {command}"
Custom list layout
atuin history list --print0
NUL-terminated output
atuin stats
Most used commands, all time
atuin stats week
Stats for the last 7 days
atuin stats <date>
Stats for one day
Periods: today, week, month, year, all or a date like 2025-04-01.

Sync

atuin register -u <name> -e <email>
Create an account
atuin login -u <name>
Log in on another machine
atuin key
Show your encryption key
atuin sync
Sync now
atuin sync -f
Force a full sync
atuin logout
Log out of the server

Configuration

~/.config/atuin/config.toml
Config file
filter_mode = "directory"
Default scope of the UI
Values: global, host, session, directory, workspace, session-preload. filter_mode_shell_up_key_binding sets a separate scope for Up.
search_mode = "fuzzy"
How queries match
Values: prefix, fulltext, fuzzy, daemon-fuzzy.
style = "compact"
UI style: auto, full, compact
inline_height = 20
Lines used by the UI; 0 = fullscreen
enter_accept = true
Enter runs the command at once
auto_sync = true
Sync after commands
sync_frequency = "10m"
Sync interval
history_filter = ["^secret"]
Regexes of commands never stored
cwd_filter = ["^/tmp"]
Regexes of directories to skip
keymap_mode = "vim-normal"
Vim keys in the UI
secrets_filter = true
Skip commands that contain secrets
store_failed = false
Do not store failed commands
ATUIN_CONFIG_DIR
Env var to move the config dir

Recipes

Add Atuin to zsh and keep Up arrow native
eval "$(atuin init zsh --disable-up-arrow)"# Ctrl+R opens Atuin, Up still walks plain history
Find what failed in this project
cd ~/src/appatuin search --cwd . --exclude-exit 0 --limit 20
Pipe history into fzf
atuin history list --cmd-only | fzf
Set up a second machine
# machine Aatuin key# machine Batuin login -u <name>atuin sync