Skip to content

Atuin

Magical shell history manager with SQLite storage, encrypted sync, and full-text search across machines and sessions.

CommandDescription
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | shInstall via official script
brew install atuinInstall on macOS with Homebrew
cargo install atuinInstall from crates.io
pacman -S atuinInstall on Arch Linux
apt install atuinInstall on Debian/Ubuntu (if available)
dnf install atuinInstall on Fedora
nix-env -i atuinInstall on NixOS
scoop install atuinInstall on Windows with Scoop
atuin --versionShow installed version
CommandDescription
atuin init bash >> ~/.bashrcInitialize for Bash
atuin init zsh >> ~/.zshrcInitialize for Zsh
atuin init fish >> ~/.config/fish/config.fishInitialize for Fish
atuin init nushellShow Nushell init commands
# Bash — add to ~/.bashrc
eval "$(atuin init bash)"

# Zsh — add to ~/.zshrc
eval "$(atuin init zsh)"

# Fish — add to ~/.config/fish/config.fish
atuin init fish | source

# Zsh with disable-up-arrow (use Ctrl+R only)
eval "$(atuin init zsh --disable-up-arrow)"
CommandDescription
Ctrl + ROpen interactive history search
Type search query after Ctrl + RFilter history interactively
EnterExecute selected command
TabInsert command without executing
Ctrl + R againCycle through search modes
↑ / ↓Navigate search results
EscapeCancel search
Ctrl + DDelete selected entry from history
Alt + 1-4Switch filter mode (global/host/session/dir)
CommandDescription
atuin history listShow recent command history
atuin history list --cmd-onlyShow commands only (no metadata)
atuin history list --format "{time} {command}"Custom output format
atuin history list --reverseShow oldest first
atuin history list -n 50Show last 50 commands
atuin history countShow total history count
atuin history lastShow most recent command
Atuin cycles through 4 search modes with Ctrl+R:

1. Fuzzy    — Matches characters in any order (like fzf)
2. Prefix   — Matches from the start of the command
3. Fulltext — Matches exact substrings anywhere
4. Skim     — Skim-style fuzzy matching

Switch modes during search with Ctrl+R, or set a default
in the config file.
CommandDescription
atuin search querySearch history from command line
atuin search "git commit"Search for specific command
atuin search --cwdSearch history for current directory only
atuin search --sessionSearch history for current session only
atuin search --globalSearch all history across machines
atuin search --interactiveOpen interactive UI
CommandDescription
atuin search --after "2024-01-01"Search after specific date
atuin search --before "yesterday"Search before specific time
atuin search --after "1 hour ago"Search within last hour
atuin search --after "3 days ago"Search within last 3 days
atuin search --after "last week"Search within last week
atuin search --before "2024-06-01" --after "2024-01-01"Date range
CommandDescription
atuin search --exit 0Search only successful commands
atuin search --exit 1Search only failed commands
atuin search --exit 127Search “command not found” errors
atuin search --limit 50Limit number of results
CommandDescription
atuin search --cwd /path/to/dirFilter by specific working directory
atuin search --hostname myserverFilter by hostname
atuin search --session SESSION_IDFilter by session ID
atuin search --duration ">5s"Filter by execution duration
atuin search --duration "<100ms"Find fast commands
CommandDescription
atuin search --format "{time} {command}"Show time and command
atuin search --format "{duration} {command}"Show duration and command
atuin search --format "{host} {command}"Show hostname and command
atuin search --format "{user} {directory} {command}"Full context
# Find all docker commands that failed
atuin search docker --exit 1

# Find git operations from last week
atuin search git --after "1 week ago"

# Find long-running commands (>30 seconds)
atuin search --duration ">30s"

# Find commands run in a specific project
atuin search --cwd ~/projects/myapp

# Find commands from your work laptop
atuin search --hostname work-mbp
CommandDescription
atuin register -u username -e email -p passwordCreate sync account
atuin login -u username -p passwordLogin to sync account
atuin login -u username -p password -k KEYLogin with encryption key
atuin logoutLogout from sync account
atuin accountShow account status
atuin account deleteDelete sync account
atuin keyShow encryption key (save this!)
atuin statusShow sync status
CommandDescription
atuin syncSync history with server
atuin sync -fForce full sync
atuin sync --forceForce re-upload all history
All data is end-to-end encryptedServer never sees plaintext history
# First-time setup on machine 1
atuin register -u myname -e me@example.com -p mypassword
atuin key  # SAVE THIS KEY — you'll need it for other machines
atuin sync

# Setup on machine 2
atuin login -u myname -p mypassword -k YOUR_ENCRYPTION_KEY
atuin sync

# Your encryption key looks like:
# abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890

# Without the key, the server cannot decrypt your history.
# If you lose the key, your synced history is unrecoverable.
# Run your own Atuin sync server
docker run -d \
  --name atuin-server \
  -p 8888:8888 \
  -v atuin-data:/config \
  ghcr.io/atuinsh/atuin:latest \
  server start

# Point your client to the self-hosted server
# In ~/.config/atuin/config.toml:
# sync_address = "http://your-server:8888"
CommandDescription
atuin import autoAuto-detect and import shell history
atuin import bashImport from Bash history
atuin import zshImport from Zsh history
atuin import zsh-hist-dbImport from Zsh hist-db plugin
atuin import fishImport from Fish history
atuin import reshImport from RESH history
atuin import nuImport from Nushell history
atuin import nu-hist-dbImport from Nushell SQLite history
# Auto-detect your shell and import
atuin import auto

# Import Zsh history specifically
atuin import zsh

# Check how many entries were imported
atuin history count

# Verify import worked
atuin search --limit 5
CommandDescription
atuin statsShow history statistics
atuin stats --count 20Show top 20 most-used commands
atuin stats --period dayStats for today
atuin stats --period weekStats for this week
atuin stats --period monthStats for this month
atuin stats --period allAll-time statistics
atuin history countTotal history entries
$ atuin stats --count 10
┌─────────┬─────────────────┬───────┐
│ Rank    │ Command         │ Count │
├─────────┼─────────────────┼───────┤
│ 1       │ git status      │  1847 │
│ 2       │ ls              │  1523 │
│ 3       │ cd              │  1201 │
│ 4       │ git diff        │   987 │
│ 5       │ vim             │   842 │
│ 6       │ git add         │   756 │
│ 7       │ docker ps       │   689 │
│ 8       │ npm run         │   534 │
│ 9       │ git commit      │   498 │
│ 10      │ make            │   423 │
└─────────┴─────────────────┴───────┘

Total commands:   45,231
Unique commands:   8,432
CommandDescription
~/.config/atuin/config.tomlMain configuration file
atuin default-configPrint default config
CommandDescription
search_mode = "fuzzy"Set fuzzy search mode
search_mode = "prefix"Set prefix search mode
search_mode = "fulltext"Set full-text search mode
search_mode = "skim"Set skim fuzzy search mode
filter_mode = "global"Search all history by default
filter_mode = "host"Search current host by default
filter_mode = "session"Search current session by default
filter_mode = "directory"Search current directory by default
filter_mode_shell_up_key_binding = "session"Up arrow searches current session
CommandDescription
style = "compact"Use compact UI style
style = "full"Use full UI style
style = "auto"Auto-detect based on terminal
inline_height = 40Set inline search height
show_preview = trueShow command preview panel
show_help = trueShow keybinding help
show_tabs = trueShow filter mode tabs
max_preview_height = 4Max lines for preview
# ~/.config/atuin/config.toml

## Database Settings
db_path = "~/.local/share/atuin/history.db"

## Search Settings
search_mode = "fuzzy"
filter_mode = "global"
filter_mode_shell_up_key_binding = "host"

## UI Settings
style = "auto"
inline_height = 40
show_preview = true
show_help = true
show_tabs = true
max_preview_height = 4
invert = false

## History Settings
update_check = true
sync_frequency = "5m"
sync_address = "https://api.atuin.sh"

## Key bindings (default)
# Ctrl+R = search
# Up arrow = search (unless disabled)
# Tab = accept without running
# Enter = accept and run

## Secrets filter — don't record commands with secrets
history_filter = [
  "^export.*TOKEN",
  "^export.*SECRET",
  "^export.*PASSWORD",
  "^export.*KEY",
  ".*AWS_SECRET.*",
]

## Ignore specific commands
history_filter = [
  "^ls$",
  "^cd$",
  "^pwd$",
  "^exit$",
  "^clear$",
]

## Sync settings
sync_frequency = "5m"
# sync_address = "https://api.atuin.sh"  # Default server
# sync_address = "http://localhost:8888"  # Self-hosted
KeyDescription
Ctrl + ROpen search / cycle search mode
↑ / ↓Navigate results
EnterExecute selected command
TabInsert command without executing
EscapeCancel search
Ctrl + DDelete selected history entry
Alt + 1Switch to global filter
Alt + 2Switch to host filter
Alt + 3Switch to session filter
Alt + 4Switch to directory filter
Ctrl + UClear search query
Ctrl + WDelete word backward
CommandDescription
~/.local/share/atuin/history.dbDefault database location
Database uses SQLite formatCan query with any SQLite tool
sqlite3 ~/.local/share/atuin/history.db ".tables"List database tables
# Open the database directly with SQLite
sqlite3 ~/.local/share/atuin/history.db

# Count total entries
sqlite3 ~/.local/share/atuin/history.db \
  "SELECT COUNT(*) FROM history;"

# Find longest-running commands
sqlite3 ~/.local/share/atuin/history.db \
  "SELECT command, duration FROM history
   ORDER BY duration DESC LIMIT 10;"

# Commands by directory
sqlite3 ~/.local/share/atuin/history.db \
  "SELECT cwd, COUNT(*) as cnt FROM history
   GROUP BY cwd ORDER BY cnt DESC LIMIT 10;"
  1. Import your existing history first — Run atuin import auto immediately after installation to start with a rich history database rather than from scratch.

  2. Use fuzzy search mode — Set search_mode = "fuzzy" for the most flexible matching. You can always cycle to other modes with Ctrl+R during a search.

  3. Filter secrets from history — Add patterns to history_filter in config to prevent recording commands containing tokens, passwords, and API keys.

  4. Save your encryption key — Run atuin key and store the key in a password manager. If you lose it, synced history from other machines is permanently unrecoverable.

  5. Set up sync between machines — Encrypted sync is Atuin’s killer feature. Register an account and configure all your machines to have unified history everywhere.

  6. Use directory-scoped search — Press Alt+4 during search to filter to commands you ran in the current directory — perfect for project-specific workflows.

  7. Customize the up-arrow — Set filter_mode_shell_up_key_binding = "host" to make the up arrow show only commands from the current machine, while Ctrl+R searches globally.

  8. Set up the self-hosted server — If you handle sensitive data, run your own Atuin server with Docker for complete control over your synced history.

  9. Review stats regularly — Run atuin stats periodically to understand your patterns and identify commands you could alias for efficiency.

  10. Use compact style for small terminals — Set style = "compact" if you work in split-pane terminals with limited vertical space.