### Install and Setup Atuin Source: https://docs.atuin.sh/cli Run this script to install Atuin and set up your shell. After installation, register your account, import your existing history, and sync it across devices. Restart your shell to enable Atuin's features. ```bash bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh) ``` ```bash atuin register -u -e ``` ```bash atuin import auto ``` ```bash atuin sync ``` -------------------------------- ### Start Atuin Server Source: https://docs.atuin.sh/cli/self-hosting/server-setup Once installed, use this command to start the Atuin server. Ensure the server binary is in your PATH. ```bash atuin-server start ``` -------------------------------- ### Install Atuin on Unix-like Systems Source: https://docs.atuin.sh/cli/guide/installation Use this command to install Atuin using the official setup script. It automatically handles dependencies and installs the binary to ~/.atuin/bin. ```bash curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh ``` -------------------------------- ### Install Atuin Server Installer Source: https://docs.atuin.sh/cli/self-hosting/server-setup Use this command to download and run the Atuin server installer script. Ensure you have `curl` installed. ```bash curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/latest/download/atuin-server-installer.sh | sh ``` -------------------------------- ### Install Atuin using Nix Profile Source: https://docs.atuin.sh/cli/guide/installation Install Atuin from its GitHub repository using Nix. ```bash nix profile install "github:atuinsh/atuin" ``` -------------------------------- ### Install Atuin using WinGet Source: https://docs.atuin.sh/cli/guide/installation Install Atuin on Windows using the WinGet package manager. ```bash winget install -e Atuinsh.Atuin ``` -------------------------------- ### Install Atuin using Nix Environment Source: https://docs.atuin.sh/cli/guide/installation Install Atuin from the nixpkgs channel using nix-env. ```bash nix-env -f '' -iA atuin ``` -------------------------------- ### Display Atuin Configuration and Version Info Source: https://docs.atuin.sh/cli/reference/info Use this command to view the locations of your Atuin configuration files, database, and keys, along with environment variable settings and the installed version. This is useful for troubleshooting and understanding your Atuin setup. ```bash atuin info ``` -------------------------------- ### Install Atuin using zinit and GitHub Releases Source: https://docs.atuin.sh/cli/guide/installation Install Atuin using zinit, fetching the binary from GitHub releases and setting up shell initialization and completions. ```bash zinit ice as"command" from"gh-r" bpick"atuin-*.tar.gz" mv"atuin*/atuin -> atuin" \ atclone"./atuin init zsh > init.zsh; ./atuin gen-completions --shell zsh > _atuin" \ atpull"%atclone" src"init.zsh" zinit light atuinsh/atuin ``` -------------------------------- ### Install and Configure Atuin with Sync Source: https://docs.atuin.sh/cli/guide/getting-started Installs Atuin, registers a user, imports existing history, and enables synchronization. Restart your shell after running these commands. ```bash bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh) atuin register -u -e atuin import auto atuin sync ``` -------------------------------- ### Install Atuin using Mise Source: https://docs.atuin.sh/cli/guide/installation Install and manage Atuin using the mise version manager. ```bash mise use -g atuin@latest ``` -------------------------------- ### Example: Setting Multiple Output Variables Source: https://docs.atuin.sh/desktop/blocks/executable/script This example demonstrates setting multiple single-line and multiline variables using `$ATUIN_OUTPUT_VARS`. ```bash # Generate multiple outputs from a single script echo "timestamp=$(date +%s)" >> $ATUIN_OUTPUT_VARS echo "hostname=$(hostname)" >> $ATUIN_OUTPUT_VARS echo "user=$(whoami)" >> $ATUIN_OUTPUT_VARS # Capture multiline command output using heredoc echo "disk_usage<> $ATUIN_OUTPUT_VARS df -h >> $ATUIN_OUTPUT_VARS echo "END" >> $ATUIN_OUTPUT_VARS # Or build multiline content programmatically echo "report<> $ATUIN_OUTPUT_VARS echo "Server: $(hostname)" >> $ATUIN_OUTPUT_VARS echo "Status: Running" >> $ATUIN_OUTPUT_VARS echo "Uptime: $(uptime)" >> $ATUIN_OUTPUT_VARS echo "REPORT" >> $ATUIN_OUTPUT_VARS ``` -------------------------------- ### Initialize pty-proxy with custom Atuin path for Bash Source: https://docs.atuin.sh/cli/reference/pty-proxy Example for a bash user with Atuin installed in a non-standard location. Ensures the Atuin binary is in the PATH before initializing pty-proxy and the shell. ```shell export PATH=$HOME/.atuin/bin:$PATH eval "$(atuin pty-proxy init bash)" # ... other shell configuration ... eval "$(atuin init bash)" ``` -------------------------------- ### Install Atuin using Pacman Source: https://docs.atuin.sh/cli/guide/installation Install Atuin on Arch Linux from the official repositories. ```bash pacman -S atuin ``` -------------------------------- ### Install Atuin using Void Linux xbps Source: https://docs.atuin.sh/cli/guide/installation Install Atuin on Void Linux using the xbps package manager. ```bash sudo xbps-install atuin ``` -------------------------------- ### Install Hooks for AI Agents Source: https://docs.atuin.sh/cli/guide/agent-hooks Install hooks for your AI agent to start capturing its commands in Atuin history. Restart or reload the agent after installation. ```bash # Claude Code atuin hook install claude-code ``` ```bash # Codex atuin hook install codex ``` ```bash # pi atuin hook install pi ``` -------------------------------- ### Start Atuin Services with Docker Compose Source: https://docs.atuin.sh/cli/self-hosting/docker Initializes the configuration directory and starts the services defined in `docker-compose.yml` in detached mode. ```bash mkdir config chown 1000:1000 config docker compose up -d ``` -------------------------------- ### Install Atuin using Cargo Source: https://docs.atuin.sh/cli/guide/installation Use this command to install Atuin if you have Rust and Cargo set up. ```bash cargo install atuin ``` -------------------------------- ### Manually Start Atuin Daemon Source: https://docs.atuin.sh/cli/reference/daemon If autostart is disabled, run this command to manually start the Atuin daemon. ```bash atuin daemon ``` -------------------------------- ### Install Atuin using Termux Source: https://docs.atuin.sh/cli/guide/installation Install Atuin on Android via Termux. ```bash pkg install atuin ``` -------------------------------- ### PostgreSQL Configuration (server.toml) Source: https://docs.atuin.sh/cli/self-hosting/server-setup Example configuration for connecting to a PostgreSQL database using the server.toml file. Adjust host, port, and database credentials as needed. ```toml host = "0.0.0.0" port = 8888 open_registration = true db_uri="postgres://user:password@hostname/database" ``` -------------------------------- ### Directory Path Examples Source: https://docs.atuin.sh/desktop/blocks/executable/directory Demonstrates various ways to specify paths within the Directory block, including absolute, home-relative, workspace-relative, and relative paths. ```shell # Absolute path /Users/username/my-project ``` ```shell # Home-relative path ~/projects/my-app ``` ```shell # Relative to workspace root {{ workspace.root }}/src ``` ```shell # Relative to previous directory ../sibling-directory ``` -------------------------------- ### Install Atuin using Homebrew Source: https://docs.atuin.sh/cli/guide/installation Install Atuin on macOS or Linux using the Homebrew package manager. ```bash brew install atuin ``` -------------------------------- ### Install Atuin on Windows using WinGet and Configure PowerShell Source: https://docs.atuin.sh/cli/guide/installation Install Atuin via WinGet on Windows. It then adds the initialization command to your PowerShell profile and instructs you to restart your shell. ```powershell winget install -e Atuinsh.Atuin if (-not (Test-Path -Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force | Out-Null } Write-Output 'atuin init powershell | Out-String | Invoke-Expression' >> $PROFILE ``` -------------------------------- ### Configure Daemon Autostart Source: https://docs.atuin.sh/cli/configuration/config Set whether the daemon should automatically start when needed. This is not compatible with 'systemd_socket = true'. ```toml autostart = false ``` -------------------------------- ### Example TOML Permission File Source: https://docs.atuin.sh/cli/ai/tools-permissions An example permission file that allows reading and writing markdown files, denies access to .env files, and prompts for other file operations. ```toml [permissions] allow = [ "Write(**/*.md)" ] deny = [ "Read(.env)" ] ``` -------------------------------- ### SQLite Configuration (server.toml) Source: https://docs.atuin.sh/cli/self-hosting/server-setup Example configuration for using an SQLite database with the server.toml file. Ensure the specified path is writable. ```toml db_uri="sqlite:///config/atuin.db" ``` -------------------------------- ### Re-installing AI Agent Hooks Source: https://docs.atuin.sh/cli/guide/agent-hooks Running `atuin hook install` again is safe. If hooks are already installed, the command will skip them and print a message indicating they are already installed. ```bash hooks.PreToolUse: already installed, skipping hooks.PostToolUse: already installed, skipping hooks.PostToolUseFailure: already installed, skipping ``` -------------------------------- ### Verify Agent Hook Installation Source: https://docs.atuin.sh/cli/guide/agent-hooks Check your Atuin history or the agent's configuration files to confirm that the hooks have been successfully installed and registered. ```bash # Show all history including agent commands atuin search --authors '' -- '' ``` ```bash # Show only agent commands atuin search --authors '$all-agent' -- '' ``` ```bash # Claude Code cat ~/.claude/settings.json | grep atuin ``` ```bash # Codex cat ~/.codex/hooks.json | grep atuin ``` ```bash # pi ls ~/.pi/agent/extensions/atuin.ts ``` -------------------------------- ### Reset Sync Account and Start Fresh Source: https://docs.atuin.sh/cli/guide/delete-history To completely start over with sync, delete your existing sync account and register a new one. This removes all server-side data and sync records. ```bash atuin account delete ``` ```bash atuin register ``` ```bash atuin import auto ``` -------------------------------- ### Install Atuin Shell Plugin with Antigen Source: https://docs.atuin.sh/cli/guide/installation Installs the Atuin shell plugin using the Antigen package manager. ```shell antigen bundle atuinsh/atuin@main ``` -------------------------------- ### Install Atuin using MacPorts Source: https://docs.atuin.sh/cli/guide/installation Install Atuin on macOS using the MacPorts package manager. ```bash sudo port install atuin ``` -------------------------------- ### Install Atuin Shell Plugin with Antidote Source: https://docs.atuin.sh/cli/guide/installation Installs the Atuin shell plugin using the Antidote package manager. ```shell antidote install atuinsh/atuin ``` -------------------------------- ### Login to Atuin Sync Server Source: https://docs.atuin.sh/cli/guide/sync After installing Atuin on a new machine, use this command to log in to the sync server. You will be prompted for your password and encryption key. ```bash atuin login -u ``` -------------------------------- ### Example Atuin Doctor Output Source: https://docs.atuin.sh/cli/reference/doctor This is an example of the diagnostic information provided by `atuin doctor`. It includes Atuin version, sync status, shell details, and system information. ```yaml Atuin Doctor Checking for diagnostics Please include the output below with any bug reports or issues atuin: version: 18.1.0 sync: cloud: true records: true auto_sync: true last_sync: 2024-03-05 14:54:48.447677 +00:00:00 shell: name: zsh plugins: - atuin system: os: Darwin arch: arm64 version: 14.4 disks: - name: Macintosh HD filesystem: apfs - name: Macintosh HD filesystem: apfs ``` -------------------------------- ### Manage Atuin Systemd Service Source: https://docs.atuin.sh/cli/self-hosting/docker Commands to enable the Atuin service to start on boot and to check its current status. ```bash systemctl enable --now atuin ``` ```bash systemctl status atuin ``` -------------------------------- ### Install Atuin for Offline Use Source: https://docs.atuin.sh/cli/guide/getting-started Installs Atuin for local use only, without any cloud synchronization. Your shell history will be stored and managed solely on your current machine. ```bash bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh) atuin import auto ``` -------------------------------- ### Reload Systemd and Enable Atuin Server Source: https://docs.atuin.sh/cli/self-hosting/systemd Commands to reload systemd to recognize the new user and then enable and start the Atuin server service. ```bash systemctl restart systemd-sysusers ``` ```bash systemctl enable --now atuin-server ``` ```bash systemctl status atuin-server ``` -------------------------------- ### Enable Sync v2 Source: https://docs.atuin.sh/cli/configuration/config Enable the new, faster, and more efficient version of Atuin sync. This is the default for new installations. ```toml [sync] records = true ``` -------------------------------- ### Allowing Git Commands Source: https://docs.atuin.sh/cli/ai/tools-permissions Configure shell permissions to allow specific git commands. This example allows adding and committing files using git. ```toml [permissions] allow = [ "Shell(git add *)", "Shell(git commit *)" ] ``` -------------------------------- ### Install Atuin Shell Plugin with Zinit Source: https://docs.atuin.sh/cli/guide/installation Loads the Atuin shell plugin using the zinit package manager. ```shell # if you _only_ want to install the shell-plugin, do this; otherwise look above for a "everything via zinit" solution zinit load atuinsh/atuin ``` -------------------------------- ### Read and Deny File Access Rules Source: https://docs.atuin.sh/cli/ai/tools-permissions Example permission rules for the Read tool. Allows reading all markdown files but denies reading from a specific secret directory. ```toml [permissions] allow = ["Read(**/*.md)"] deny = ["Read(.secret/**)"] ``` -------------------------------- ### Emacs Keymap: Accept Past Line Start Behavior (Off by Default) Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Configure the 'left' key to accept when at the start of the input line, otherwise move the cursor left. This binding is off by default. ```toml [keymap.emacs] "left" = [ { when = "cursor-at-start", action = "accept" }, { action = "cursor-left" }, ] ``` -------------------------------- ### Media Key Bindings Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Examples of binding media keys. These are supported on terminals implementing the kitty keyboard protocol with `DISAMBIGUATE_ESCAPE_CODES` enabled. ```toml "play", "pause", "playpause", "stop" "fastforward", "rewind", "tracknext", "trackprevious" "record", "lowervolume", "raisevolume", "mutevolume", "mute" ``` -------------------------------- ### Custom Prefix Bindings Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Customize prefix bindings for two-step shortcuts. This example adds a binding to copy the selected entry and rebinds 'x' to delete while disabling 'd'. ```toml [keymap.prefix] # Add a binding to copy the selected entry "y" = "copy" # Make 'x' delete instead of 'd' "x" = "delete" "d" = "noop" ``` -------------------------------- ### Skill Structure Example Source: https://docs.atuin.sh/cli/ai/skills Defines a 'code-review' skill with metadata and instructions. Use this when the user asks to review code, a PR, or a diff. It includes dynamic content for the current branch. ```markdown --- name: code-review description: Conducts a structured code review. Use when the user asks to review code, a PR, or a diff. --- When reviewing code: 1. **Correctness** — Does the code do what it claims? 2. **Edge cases** — What inputs could break it? 3. **Style** — Does it match the project's conventions? Current branch: !`git branch --show-current` ``` -------------------------------- ### Example Usage of Query Results Source: https://docs.atuin.sh/desktop/blocks/databases Check for query results and iterate through them. Useful for displaying found data or handling empty results. ```jinja {%- set output = doc.named['user_query'].output %} {# Check if we got results #} {% if output.total_rows > 0 %} Found {{ output.total_rows }} users: {% for row in output.rows %} - {{ row.name }} ({{ row.email }}) {% endfor %} {% else %} No users found. {% endif %} ``` -------------------------------- ### Basic Key Formats Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Examples of basic key formats including lowercase letters, digits, and named keys. Aliases like `return` for `enter` and `escape` for `esc` are also supported. ```toml "a", "z", "1", "9" "enter", "esc", "tab", "space", "backspace", "delete" "up", "down", "left", "right" "home", "end", "pageup", "pagedown" "f1", "f2", ... "f12", ... "f24" ``` -------------------------------- ### Example Prometheus Query Usage Source: https://docs.atuin.sh/desktop/blocks/monitoring/prometheus Demonstrates how to access and display details of a Prometheus query, including the executed query, time range, and series information. This is useful for verifying query parameters and understanding the returned data. ```jinja {%- set output = doc.named['cpu_metrics'].output %} {% if output.total_series > 0 %} Query: {{ output.query_executed }} Time range: {{ output.time_range.start }} to {{ output.time_range.end }} {% for series in output.series %} Series: {{ series.name }} Data points: {{ series.data | length }} {% endfor %} {% endif %} ``` -------------------------------- ### Get verbose configuration details Source: https://docs.atuin.sh/cli/reference/config Display both the configuration file value and the resolved value side-by-side for a given key. This helps in debugging and understanding how settings are applied. ```bash $ atuin config get enter_accept --verbose Config file: (not set in config file) Resolved: false ``` -------------------------------- ### Verify Interactive Shell Fix Source: https://docs.atuin.sh/cli/guide/shell-integration After configuring your IDE or wrapper script, run this command in a new terminal to confirm Atuin's hooks are correctly installed. ```bash atuin doctor | grep preexec ``` -------------------------------- ### Conditional Key Binding Example Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Maps the 'left' key to an ordered list of rules. The first rule with a matching condition is executed. A rule without a 'when' condition acts as a fallback. ```toml [keymap.emacs] "left" = [ { when = "cursor-at-start", action = "exit" }, { action = "cursor-left" }, ] ``` -------------------------------- ### Configure VS Code for Interactive Shell Source: https://docs.atuin.sh/cli/guide/shell-integration Add this to your VS Code `settings.json` to ensure the integrated terminal starts an interactive shell, enabling Atuin integration. ```json { "terminal.integrated.profiles.linux": { "bash": { "path": "/bin/bash", "args": ["-i"] } }, "terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "args": ["-i"] } } } ``` -------------------------------- ### List Command History with Custom Format Source: https://docs.atuin.sh/cli/reference/list Use the `--format` flag to customize the output of the history list. This example shows how to display the time, duration, and command text. ```bash atuin history list --format "{time} - {duration} - {command}" ``` -------------------------------- ### Fuzzy Search Syntax Example Source: https://docs.atuin.sh/cli/configuration/config Illustrates Atuin's fuzzy search syntax, including exact matches, prefix/suffix matching, and inverse matching. Note: The bar character operator is not supported in daemon-fuzzy mode. ```toml ^core go$ | rb$ | py$ ``` -------------------------------- ### Download and Initialize bash-preexec Source: https://docs.atuin.sh/cli/guide/installation Downloads the bash-preexec script and sources it in the Bash configuration file. ```shell curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh echo '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc ``` -------------------------------- ### Register with Atuin Sync Server Source: https://docs.atuin.sh/cli/guide/sync Use this command to register a new account with the Atuin sync server. Replace `` and `` with your desired credentials. ```bash atuin register -u -e ``` -------------------------------- ### Initialize pty-proxy for Nushell (Part 2) Source: https://docs.atuin.sh/cli/reference/pty-proxy Source the generated initialization file in your 'config.nu' before the regular 'atuin init' call. Nushell requires a static file path. ```shell source ~/.local/share/atuin/pty-proxy-init.nu ``` -------------------------------- ### Fish: Set up Atuin Key Bindings Source: https://docs.atuin.sh/cli/configuration/key-binding Configure key bindings in the Fish shell by adding commands to `~/.config/fish/config.fish`. Use `bind` for standard key sequences and `_atuin_bind_up` for the Up key. ```fish set -gx ATUIN_NOBIND "true" atuin init fish | source # bind to ctrl-r in normal and insert mode, add any other bindings you want here too bind \cr _atuin_search bind -M insert \cr _atuin_search ``` ```fish bind \e\[1\;5A _atuin_search ``` -------------------------------- ### Initialize pty-proxy for Nushell (Part 1) Source: https://docs.atuin.sh/cli/reference/pty-proxy Create the initialization file for Nushell. This command generates the file that will be sourced later. ```shell mkdir ~/.local/share/atuin/ atuin pty-proxy init nu | save -f ~/.local/share/atuin/pty-proxy-init.nu ``` -------------------------------- ### Update Atuin CLI Source: https://docs.atuin.sh/cli/guide/installation Run this command to update Atuin if you installed it directly. If the command is unavailable, reinstall using the install script. ```bash atuin update ``` -------------------------------- ### Launch Atuin Desktop with Environment Variables (Linux) Source: https://docs.atuin.sh/desktop/troubleshooting Use these environment variables one at a time to resolve launch issues or blank windows on Linux, particularly with Wayland or proprietary Nvidia drivers. Once a working variable is found, add it to your .desktop file or shell configuration. ```bash __NV_DISABLE_EXPLICIT_SYNC=1 atuin-desktop ``` ```bash GDK_BACKEND=x11 atuin-desktop ``` ```bash WEBKIT_DISABLE_DMABUF_RENDERER=1 atuin-desktop ``` ```bash WEBKIT_DISABLE_COMPOSITING_MODE=1 atuin-desktop # Note: increases CPU usage ``` -------------------------------- ### Bash: Set up Atuin Key Bindings Source: https://docs.atuin.sh/cli/configuration/key-binding Use the `atuin-bind` function to easily set up key bindings in Bash. Specify the keymap, key sequence, and the command to execute. Special commands like `atuin-search` are available. ```bash atuin-bind [-m KEYMAP] KEYSEQ COMMAND ``` ```bash export ATUIN_NOBIND="true" eval "$(atuin init bash)" # bind to ctrl-r, add any other bindings you want here too atuin-bind '\C-r' atuin-search # example of CTRL-upkey # atuin-bind '\e[1;5A' atuin-search # bind to the up key, which depends on terminal mode atuin-bind '\e[A' atuin-up-search atuin-bind '\eOA' atuin-up-search ``` -------------------------------- ### Enable Sync V2 Records in Atuin Config Source: https://docs.atuin.sh/cli/guide/dotfiles If sync v2 is not yet set up, include this configuration in `~/.config/atuin/config.toml` alongside the dotfiles configuration. ```toml [sync] records = true ``` -------------------------------- ### Print configuration section Source: https://docs.atuin.sh/cli/reference/config Display a specific section of your configuration file in TOML format. If no key is provided, the entire configuration file is printed. ```bash $ atuin config print daemon [daemon] enabled = true socket_path = "/tmp/atuin_daemon.sock" pidfile_path = "/tmp/atuin_daemon.pid" autostart = false ``` -------------------------------- ### Conditional Pause Example - Requires Approval Source: https://docs.atuin.sh/desktop/blocks/executable/pause This example demonstrates a conditional pause that triggers if the 'requires_approval' variable is truthy. Use this when manual verification is needed before proceeding. ```MiniJinja {{ var.requires_approval }} ``` -------------------------------- ### Terminal Block Examples Source: https://docs.atuin.sh/desktop/blocks Use the Terminal Block for interactive debugging and exploration of system resources. Examples include checking system processes, memory usage, and disk space. ```bash # Check system resources top -n 1 free -h df -h ``` -------------------------------- ### Enable Atuin Daemon Configuration Source: https://docs.atuin.sh/cli/reference/daemon Add this configuration to your Atuin config file to enable the daemon and set it to autostart. ```toml [daemon] enabled = true autostart = true ``` -------------------------------- ### Initialize Atuin for Nushell Source: https://docs.atuin.sh/cli/guide/installation Creates a directory and saves the Atuin Nushell initialization script. ```shell mkdir ~/.local/share/atuin/ atuin init nu | save ~/.local/share/atuin/init.nu ``` -------------------------------- ### Emacs Keymap: Exit Past Line Start Behavior Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Configure the 'left' key to exit when at the start of the input line, otherwise move the cursor left. This reproduces the default exit-past-line-start behavior. ```toml [keymap.emacs] "left" = [ { when = "cursor-at-start", action = "exit" }, { action = "cursor-left" }, ] ``` -------------------------------- ### Run Atuin Server with Docker Source: https://docs.atuin.sh/cli/self-hosting/docker Launches the Atuin server as a Docker container, mounting a local configuration directory. Replace `` with the actual version tag. ```bash CONFIG="$HOME/.config/atuin" mkdir "$CONFIG" chown 1000:1000 "$CONFIG" docker run -d -v "$CONFIG:/config" ghcr.io/atuinsh/atuin: start ``` -------------------------------- ### Non-Interactive Atuin Installation on Unix-like Systems Source: https://docs.atuin.sh/cli/guide/installation Install Atuin without interactive prompts, suitable for CI or Docker environments. The --non-interactive flag ensures the script runs without user input. ```bash curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh -s -- --non-interactive ``` -------------------------------- ### Get object attribute Source: https://docs.atuin.sh/desktop/templating The `attr` filter retrieves the value of a specified attribute from an object. ```jinja {{ user | attr("name") }} ``` -------------------------------- ### Sync Dotfiles with Atuin Source: https://docs.atuin.sh/cli/guide/dotfiles Run this command to back up your Atuin configuration to the server and synchronize it across all your machines. This command assumes sync has been previously set up. ```bash atuin sync ``` -------------------------------- ### Sequence Length Filter Source: https://docs.atuin.sh/desktop/templating Get the length of a sequence or string using the `length` filter. ```jinja {{ [1, 2, 3] | length }} → 3 ``` -------------------------------- ### Enable Dotfiles Sync Source: https://docs.atuin.sh/cli/configuration/config Enable synchronization of shell aliases between hosts. Requires sync v2 to be enabled. ```toml [dotfiles] enabled = true ``` -------------------------------- ### Last Item Filter Source: https://docs.atuin.sh/desktop/templating Get the last item from a sequence using the `last` filter. ```jinja {{ [1, 2, 3] | last }} → 3 ``` -------------------------------- ### Initialize pty-proxy for Fish Source: https://docs.atuin.sh/cli/reference/pty-proxy Add this command to your 'is-interactive' block in '~/.config/fish/config.fish'. ```shell atuin pty-proxy init fish | source ``` -------------------------------- ### First Item Filter Source: https://docs.atuin.sh/desktop/templating Get the first item from a sequence using the `first` filter. ```jinja {{ [1, 2, 3] | first }} → 1 ``` -------------------------------- ### List All Environment Variables with Atuin Source: https://docs.atuin.sh/cli/guide/dotfiles Display all environment variables currently managed by Atuin. ```bash atuin dotfiles var list ``` -------------------------------- ### Absolute Value Filter Source: https://docs.atuin.sh/desktop/templating Get the absolute value of a number using the `abs` filter. ```jinja {{ -42 | abs }} → 42 ``` -------------------------------- ### Enable Dotfiles Sync in Atuin Config Source: https://docs.atuin.sh/cli/guide/dotfiles Add this configuration to `~/.config/atuin/config.toml` to enable dotfiles synchronization. This setting will be enabled by default in future releases. ```toml [dotfiles] enabled = true ``` -------------------------------- ### Uninstall Atuin with Homebrew Source: https://docs.atuin.sh/cli/uninstall Use this command on macOS if you installed Atuin via Homebrew to remove the package. ```bash brew uninstall atuin ``` -------------------------------- ### Using the `length` Function Source: https://docs.atuin.sh/desktop/templating Get the number of items in a list or characters in a string using the `length` function. ```jinja {{ length(users) }} ``` -------------------------------- ### Initialize nvm in Zsh/Bash Source: https://docs.atuin.sh/desktop/shell-environment Source the nvm.sh script to make Node.js versions available in script blocks. Ensure NVM_DIR is correctly set. ```bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" node --version ``` -------------------------------- ### Build Atuin from Source Source: https://docs.atuin.sh/cli/guide/installation Clone the Atuin repository and build the binary from source using Cargo. This method requires Rust and Git. ```bash git clone https://github.com/atuinsh/atuin.git cd atuin/crates/atuin cargo install --path . ``` -------------------------------- ### Initialize pyenv in Zsh/Bash Source: https://docs.atuin.sh/desktop/shell-environment Configure pyenv by setting PYENV_ROOT and adding pyenv to the PATH, then initializing pyenv for shell use. This makes Python versions accessible. ```bash export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" python --version ``` -------------------------------- ### Configure Daemon-Fuzzy Search Mode Source: https://docs.atuin.sh/cli/configuration/config Enable the 'daemon-fuzzy' search mode for faster, customizable searches using an in-memory index. Requires enabling the daemon and setting `autostart`. ```toml search_mode = "daemon-fuzzy" [daemon] enabled = true autostart = true ``` -------------------------------- ### Allow AtuinHistory Tool Source: https://docs.atuin.sh/cli/ai/tools-permissions Example permission rule to automatically allow the AtuinHistory tool. This tool is used for searching command history. ```toml [permissions] allow = ["AtuinHistory"] ``` -------------------------------- ### Access Block Output Data Source: https://docs.atuin.sh/desktop/blocks/executable/kubernetes Access the structured output from a Kubernetes block execution in your templates. This example shows how to iterate over table data. ```jinja {%- set output = doc.named['my_k8s_query'].output %} {# Access table data #} {% for row in output.data %} {{ row[0] }} {# First column value #} {% endfor %} ``` -------------------------------- ### Configure Preview Strategy Source: https://docs.atuin.sh/cli/configuration/config Set the strategy for calculating preview height. 'auto' uses the selected command's length, 'static' uses the longest command in the result set, and 'fixed' uses 'max_preview_height'. ```toml [preview] strategy = [...] ``` -------------------------------- ### Conditional Pause Example - Skip Confirmation Source: https://docs.atuin.sh/desktop/blocks/executable/pause This condition prevents a pause if the 'skip_confirmation' variable is explicitly set to 'true'. Useful for optional confirmation steps. ```MiniJinja {{ var.skip_confirmation != "true" }} ``` -------------------------------- ### Enable Immediate Enter Acceptance Source: https://docs.atuin.sh/cli/configuration/config When true, Atuin executes a command immediately upon pressing Enter, instead of requiring a second Enter press. Tab returns to the shell. ```toml enter_accept = true ``` -------------------------------- ### Configure Atuin Compact UI Mode Source: https://docs.atuin.sh/cli/guide/basic-usage Set `style = "compact"` in your `config.toml` to enable the compact UI mode for Atuin. ```toml style = "compact" ``` -------------------------------- ### Use Templating for Namespace Source: https://docs.atuin.sh/desktop/blocks/executable/kubernetes Input fields support templating, allowing you to dynamically specify parameters like the target namespace in your `kubectl get` commands. ```bash kubectl get pods -n {{var.target_namespace}} ``` -------------------------------- ### Configure Key Bindings Source: https://docs.atuin.sh/cli/configuration/config Set the prefix key for Atuin commands and configure whether scrolling past the last or first entry exits the TUI. ```toml [keys] scroll_exits = true prefix = 'a' ``` -------------------------------- ### Skill with Arguments and Dynamic Content Source: https://docs.atuin.sh/cli/ai/skills A 'deploy' skill that accepts arguments and uses them in dynamic content. The `$ARGUMENTS` placeholder is replaced with the provided argument string before shell substitution. ```markdown --- name: deploy description: Deploy the application disable-model-invocation: true --- Deploy $ARGUMENTS to production. Current status: !`kubectl get deployment $ARGUMENTS` ``` -------------------------------- ### Get a configuration value Source: https://docs.atuin.sh/cli/reference/config Retrieve the value of a specific configuration key from your config file. If the key is not found, it indicates that it's not set in the config file. ```bash $ atuin config get search_mode fuzzy $ atuin config get daemon [daemon] enabled = true socket_path = "/tmp/atuin_daemon.sock" ``` ```bash $ atuin config get enter_accept (not set in config file) ``` -------------------------------- ### Initialize Atuin for Fish Source: https://docs.atuin.sh/cli/guide/installation Sources the Atuin initialization command within the interactive block of the Fish configuration file. ```shell atuin init fish | source ``` -------------------------------- ### Enable Atuin Daemon Source: https://docs.atuin.sh/cli/configuration/config Enable the background daemon for Atuin. Add this section to the bottom of your configuration file. ```toml [daemon] enabled = true ``` -------------------------------- ### Systemd Unit File for Docker Compose Source: https://docs.atuin.sh/cli/self-hosting/docker A systemd service file to manage the Atuin Docker Compose stack, ensuring it starts on boot and restarts on failure. ```ini [Unit] Description=Docker Compose Atuin Service Requires=docker.service After=docker.service [Service] # Where the docker-compose file is located WorkingDirectory=/srv/atuin-server ExecStart=/usr/bin/docker compose up ExecStop=/usr/bin/docker compose down TimeoutStartSec=0 Restart=on-failure StartLimitBurst=3 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Conditional Pause Example - Approval Required Variable Source: https://docs.atuin.sh/desktop/blocks/executable/pause This snippet shows a direct check for the 'approval_required' variable. The workflow will pause if this variable evaluates to a truthy value. ```MiniJinja {{ var.approval_required }} ``` -------------------------------- ### Create a Wrapper Script for Interactive Shell Source: https://docs.atuin.sh/cli/guide/shell-integration Use this script for tools that don't easily support shell arguments, ensuring an interactive shell is launched. Save it and make it executable. ```bash #!/bin/bash # Save as ~/bin/interactive-bash.sh and chmod +x exec /bin/bash -i "$@" ``` -------------------------------- ### List All Shell Aliases with Atuin Source: https://docs.atuin.sh/cli/guide/dotfiles View all currently configured shell aliases managed by Atuin. ```bash atuin dotfiles alias list ``` -------------------------------- ### Emacs Keymap: Scroll Exit Behavior Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Configure the 'down' key to exit when at the start of the list, otherwise select the next item. This reproduces the default scroll-exit behavior. ```toml [keymap.emacs] "down" = [ { when = "list-at-start", action = "exit" }, { action = "select-next" }, ] ``` -------------------------------- ### Conditional Pause Example - Production Environment Source: https://docs.atuin.sh/desktop/blocks/executable/pause This condition pauses the workflow only when the environment variable 'environment' is set to 'production'. Useful for adding a verification step before deploying to production. ```MiniJinja {{ var.environment == "production" }} ``` -------------------------------- ### Error setting table value Source: https://docs.atuin.sh/cli/reference/config Attempting to set a value for a key that is currently a table will result in an error, guiding the user to use a dotted key for nested values. ```bash $ atuin config set logs true Error: 'logs' is a table; use a dotted key like 'logs.key' to set a value within it ``` -------------------------------- ### Enable Current Working Directory Context Source: https://docs.atuin.sh/cli/ai/settings Configure Atuin AI to send your current working directory as context to the LLM. This helps the AI provide more relevant suggestions based on your current location. ```toml [ai.opening] send_cwd = true ``` -------------------------------- ### Emacs Keymap: Accept With Backspace Behavior (Off by Default) Source: https://docs.atuin.sh/cli/configuration/advanced-key-binding Configure the 'backspace' key to accept when the input is empty and the cursor is at the start, otherwise delete the character before the cursor. This binding is off by default. ```toml [keymap.emacs] "backspace" = [ { when = "cursor-at-start", action = "accept" }, { action = "delete-char-before" }, ] ``` -------------------------------- ### Initialize pty-proxy for Bash Source: https://docs.atuin.sh/cli/reference/pty-proxy Place this line in your bash init script before your normal 'atuin init' call. ```shell eval "$(atuin pty-proxy init bash)" ``` -------------------------------- ### Initialize Atuin for Xonsh Source: https://docs.atuin.sh/cli/guide/installation Appends the Atuin initialization command to the Xonsh configuration file. ```shell execx($(atuin init xonsh)) ``` -------------------------------- ### Get resolved configuration value Source: https://docs.atuin.sh/cli/reference/config Print the effective configuration value after merging defaults, the config file, and environment variable overrides. This is useful for understanding the final applied setting. ```bash $ atuin config get enter_accept --resolved false ``` ```bash $ atuin config get logs --resolved logs.ai.file = ai.log logs.daemon.file = daemon.log logs.dir = /home/user/.local/share/atuin/logs logs.enabled = true logs.level = info logs.search.file = search.log ```