| name | atuin |
| description | Shell history management with Atuin. Use when configuring shell history, setting up history sync, searching command history, importing history from other shells, troubleshooting atuin issues, or optimizing history workflows. Covers installation, sync setup, search modes, statistics, and self-hosting. |
Atuin Skill
Magical shell history with encrypted sync across all your machines.
Overview
Atuin replaces your shell history with a SQLite database and provides:
- Full-screen history search UI (Ctrl+R / Up arrow)
- End-to-end encrypted sync across machines
- Context logging (exit code, cwd, hostname, duration)
- Statistics and analytics
- Filter modes (session, directory, global)
- Quick navigation with Alt+number keys
Supported Shells
| Shell | Support Level |
|---|
| Zsh | Full |
| Bash | Full |
| Fish | Full |
| Nushell | Full |
| Xonsh | Full |
Quick Start
Installation
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
brew install atuin
cargo install atuin
pacman -S atuin
Shell Integration
Zsh (~/.zshrc):
eval "$(atuin init zsh)"
Bash (~/.bashrc):
eval "$(atuin init bash)"
Fish (~/.config/fish/config.fish):
atuin init fish | source
Nushell (config.nu):
source ~/.local/share/atuin/init.nu
First-Time Setup
atuin import auto
atuin register -u <USERNAME> -e <EMAIL>
atuin doctor
Search Modes
Interactive Search (Ctrl+R)
| Key | Action |
|---|
Ctrl+R | Open search UI |
Up/Down | Navigate history |
Tab | Select without executing |
Enter | Execute command |
Alt+1-9 | Quick select item |
Ctrl+R (in UI) | Cycle filter modes |
Filter Modes
| Mode | Description |
|---|
global | All history across machines |
host | Current machine only |
session | Current terminal session |
directory | Current working directory |
workspace | Git repository root |
Search Modes
| Mode | Description |
|---|
prefix | Match from start of command |
fulltext | Substring match anywhere |
fuzzy | Fuzzy matching (default) |
skim | Skim-style fuzzy finder |
Command Line Search
atuin search "git push"
atuin search --exit 0 "make"
atuin search --after "yesterday 3pm" "docker"
atuin search --before "2024-01-01" "npm"
atuin search --exit 0 --after "1 week ago" "kubectl"
atuin search --cwd /path/to/project "test"
Sync Setup
Cloud Sync (Atuin Server)
atuin register -u <USERNAME> -e <EMAIL>
atuin login -u <USERNAME>
atuin import auto
atuin sync
atuin status
Self-Hosted Server
docker run -d \
-p 8888:8888 \
-v $HOME/.atuin-server:/data \
ghcr.io/atuinsh/atuin:latest \
server start
atuin config set sync_address "http://localhost:8888"
Sync v2 (Faster)
[sync]
records = true
Configuration
Config File Location
~/.config/atuin/config.toml # Main config
~/.local/share/atuin/history.db # History database
~/.local/share/atuin/key # Encryption key
~/.local/share/atuin/session # Server session
Essential Settings
search_mode = "fuzzy"
filter_mode = "global"
filter_mode_shell_up_key_binding = "session"
style = "compact"
inline_height = 40
show_preview = true
show_help = true
enter_accept = false
auto_sync = true
sync_frequency = "1h"
sync_address = "https://api.atuin.sh"
secrets_filter = true
store_failed = true
Privacy Filters
history_filter = [
"^password",
"^secret",
"^export.*API_KEY",
".*--password.*"
]
cwd_filter = [
"^/tmp",
"^/private"
]
secrets_filter = true
Key Bindings
keymap_mode = "vim-normal"
[keymap_cursor]
emacs = "blink-block"
vim_insert = "blink-bar"
vim_normal = "steady-block"
Commands Reference
Core Commands
atuin history list
atuin history list --cmd-only
atuin history prune
atuin search [query]
atuin search --interactive
atuin sync
atuin sync --force
atuin status
atuin stats
atuin stats --count 20
atuin register
atuin login
atuin logout
atuin account delete
atuin doctor
atuin info
atuin gen-completions
Import Commands
atuin import auto
atuin import zsh
atuin import bash
atuin import fish
atuin import resh
atuin import zsh-hist-db
Daemon Mode
atuin daemon
atuin daemon status
Statistics
View Stats
atuin stats
atuin stats --count 25
Configure Stats
[stats]
common_subcommands = [
"cargo",
"git",
"kubectl",
"docker",
"npm"
]
common_prefix = [
"sudo"
]
Workflows
Daily Development Workflow
atuin sync
atuin search --after "1 week ago" "docker-compose"
atuin stats
Multi-Machine Workflow
atuin register -u myuser -e me@example.com
atuin import auto
atuin sync
atuin login -u myuser
atuin sync
Troubleshooting Workflow
atuin doctor
echo $ATUIN_SESSION
atuin search "test"
atuin status
atuin sync --force
Performance Tips
Optimize Search Speed
search_mode = "prefix"
filter_mode = "session"
max_preview_height = 2
Reduce Sync Traffic
sync_frequency = "4h"
[sync]
records = true
Daemon Mode (v18.3+)
[daemon]
enabled = true
sync_frequency = 300
Migration
From fzf/history
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
atuin import auto
echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
From Other History Tools
mcfly export > history.txt
atuin import auto
Security
Encryption
- All sync data is end-to-end encrypted
- Server cannot read your history
- Key stored locally (
~/.local/share/atuin/key)
Key Backup
cp ~/.local/share/atuin/key ~/atuin-key.backup
cp ~/atuin-key.backup ~/.local/share/atuin/key
Secrets Filtering
secrets_filter = true
history_filter = [
".*password=.*",
".*secret=.*",
"^mysql.*-p.*"
]
Troubleshooting
Common Issues
| Issue | Solution |
|---|
| Ctrl+R not working | Check shell integration in rc file |
| Sync failing | Run atuin doctor, check network |
| Missing history | Run atuin import auto |
| Slow search | Switch to prefix search mode |
| Duplicate history | Check if imported multiple times |
Diagnostic Commands
atuin doctor
atuin info
sqlite3 ~/.local/share/atuin/history.db "SELECT COUNT(*) FROM history"
ATUIN_LOG=debug atuin sync
Reset Everything
atuin logout
rm -rf ~/.local/share/atuin
rm -rf ~/.config/atuin
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
References
External Links
Gotchas
- Sync over captive-portal Wi-Fi:
atuin status reports ok, but inserts buffer locally only. History looks fine until you check on another machine.
- Encryption key is per-machine — losing it locks you out of synced history irrecoverably. Back up
~/.local/share/atuin/key.
- Search mode
fuzzy vs prefix: match counts differ subtly; switching modes confuses muscle memory at 2am.
- Atuin history is NOT shared with shell history file —
~/.zsh_history and atuin's DB drift; history builtin and atuin search return different results.
- Self-hosted server needs PostgreSQL — SQLite is single-user only. The error mentioning "embedded mode" doesn't surface the issue clearly.