Terminal GuideTerminal Guide
atuin icon

Atuin

Modern CLI
macOSLinux
Rust

Magical shell history with sync and search.

Official Website

Features

Cloud SyncSQLite BackendEncryptionStatistics
Replaces
history

Installation

Homebrew
brew install atuin
Pacman (Arch)
pacman -S atuin
Cargo (Rust)
cargo install atuin

Why use Atuin?

Atuin is a magical shell history replacement that goes beyond simple search. It syncs your command history across devices, encrypts sensitive data, stores everything in a SQLite database, and provides advanced statistics about your command usage patterns.

Cloud Sync

Sync your shell history across multiple machines securely. Access your command history everywhere you work.

End-to-End Encryption

All synced data is encrypted with keys only you possess. Your command history stays private and secure.

SQLite Database

Store history in a structured database for powerful querying and filtering capabilities.

Advanced Statistics

Analyze your command patterns with detailed statistics and insights about your shell usage.

Installation

Using Homebrew (macOS/Linux)

Installation
brew install atuin

Using Cargo (Rust)

Installation
cargo install atuin

Shell Integration Setup

Shell Setup
# For Bash, add to ~/.bashrc:
eval "$(atuin init bash)"

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

# For Fish, add to ~/.config/fish/config.fish:
atuin init fish | source

# Then restart your shell
exec $SHELL  # or: source ~/.bashrc

Verify Installation

Verification
atuin --version

# Check shell integration
echo $ATUIN_SESSION  # Should display session UUID

# View current configuration
atuin account status

Basic Usage

Interactive Search

Basic Search
# Open Atuin history search (replaces Ctrl+R)
Ctrl+R

# Fuzzy search for a command
Ctrl+R
docker build
# Shows all docker build commands from your history

# Navigate results and execute
↑/↓                 # Navigate through results
Enter               # Execute selected command
Esc                 # Cancel search

# Advanced search features
?                   # Show search help in interface

Command Line History Operations

CLI Operations
# View your command history
atuin history

# Search history from command line
atuin search "git commit"

# List recent commands
atuin history last 20

# Show history statistics
atuin stats

Cloud Sync Setup (Optional)

Cloud Sync
# Register for cloud sync account
atuin register

# Login to your account
atuin login

# Logout if needed
atuin logout

# Enable sync (auto-enabled after login)
# Your history will sync automatically

# View sync status
atuin account status

Common Commands and Options

CommandDescriptionExample
atuin historyList command historyatuin history list
atuin searchSearch historyatuin search "docker"
atuin statsShow statisticsatuin stats
atuin registerCreate sync accountatuin register
atuin loginLogin to syncatuin login
atuin importImport historyatuin import auto
atuin accountManage accountatuin account status

Practical Examples

Syncing Across Machines

Multi-Machine Setup
# On machine 1 (Setup):
atuin register
# Enter email and password
atuin login

# On machine 2 (Setup):
atuin login
# Use same credentials

# Now both machines sync automatically!
# Commands run on machine 1 appear on machine 2
# All encrypted end-to-end

# Check sync status
atuin account status

Searching and Filtering History

Advanced Search
# Search all kubernetes commands
atuin search "kubectl"

# Find commands from specific directory
atuin history list --directory ~/projects

# Get commands with specific exit status
atuin history list --exit-status 0  # Successful
atuin history list --exit-status 1  # Failed

# Filter by date range
atuin history list --after "2024-01-01" --before "2024-01-31"

Analyzing Your Habits

Statistics
# View overall statistics
atuin stats

# Most common commands
atuin stats | head

# Statistics output includes:
# - Most run commands
# - Total command count
# - Unique commands
# - Success rate
# - Average command length

# This helps identify patterns and optimization opportunities

Importing Existing History

History Import
# Auto-import from default shell history
atuin import auto

# Import from specific sources
atuin import bash      # From ~/.bash_history
atuin import zsh       # From ~/.zsh_history
atuin import fish      # From Fish history

# After import, your entire history is available in Atuin
# And can be synced across devices

Configuration and Customization

Configuration File

~/.config/atuin/settings.toml
# Atuin configuration is located at:
# ~/.config/atuin/settings.toml  (Linux/macOS)
# %APPDATA%\atuin\settings.toml (Windows)

# Example configuration:
[settings]
# Locally store history
local_history = true

# Enable sync
sync = true

# Search behavior
search_mode = "fuzzy"  # or "prefix"

# History filtering
history_filter = [
  "^password ",
  "^ssh ",
]

Filtering Sensitive Commands

Sensitive Data Filtering
# ~/.config/atuin/settings.toml

[settings]
history_filter = [
  # Don't record password commands
  "^password ",
  "^passwd ",

  # Don't record SSH keys
  "ssh-keygen",
  "ssh-add",

  # Don't record database passwords
  "mysql -p",
  "psql.*password",

  # Don't record AWS secret operations
  ".*aws_secret.*",

  # Regex patterns are supported
]

Shell-Specific Settings

UI Configuration
# ~/.config/atuin/settings.toml

[settings]
# Search mode
search_mode = "fuzzy"  # "fuzzy" or "prefix"

# Inline search display
invert = false         # Show results in natural order

# Enable key binding hints
show_help = true

# Adjust UI colors/theme
# Atuin respects shell color schemes

# Advanced: Custom keybindings per shell
# These are shell-specific and configured separately

Atuin vs Other History Tools

FeatureDefault ShellMcFlyAtuin
Cloud syncNoNoYes
End-to-end encryptionNoNoYes
Database storageText fileCustomSQLite
StatisticsNoneLimitedAdvanced
Learning/AI rankingNoneNeural networkRelevance-based
Setup complexityNoneSimpleModerate (optional sync)
Multi-machine supportManualNoBuilt-in

Tips

  • Cloud sync is optional - you can use Atuin without syncing for local history management only
  • Use the history_filter setting to prevent sensitive commands (passwords, keys) from being stored
  • The SQLite database can be queried directly for custom analysis of your command history
  • Atuin shows exit status for each command, helping you identify which commands succeeded and which failed
  • For multi-machine setup, all machines should use the same account for full history sync
  • The search interface allows filtering by time, directory, exit code, and hostname
  • Consider using Atuin with other shell enhancements like zsh-autosuggestions for a complete workflow
  • The database location can be customized via environment variables if needed for specific setups

Getting Started Checklist

  1. Install Atuin using Homebrew or Cargo
  2. Initialize shell integration (add eval statement to config)
  3. Restart your shell and verify with Ctrl+R
  4. Import existing shell history with atuin import auto
  5. Optional: Register and login for cloud sync across devices
  6. Configure history_filter for sensitive commands
  7. Explore statistics with atuin stats
  8. Try searching with Ctrl+R - enjoy the improved experience!
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More