Skip to content

init

atuin init <shell>

Prints the shell plugin for the given shell. Evaluating its output is what installs Atuin's hooks and key bindings into your session, so this command belongs in your shell's startup file rather than being run by hand.

atuin init zsh

See installation for the exact line to add for your shell — the syntax differs between shells.

Supported shells: zsh, bash, fish, nu, xonsh, powershell. See Supported platforms for what each tier means.

What it sets up

  • Hooks that record each command, its exit code, and its duration. See Shell Integration.
  • Key bindings for Ctrl+R and the Up arrow, and ? for Atuin AI.
  • Dotfiles, if enabled — your synced aliases and environment variables are defined here.

Flags

Flag Description
--disable-up-arrow Don't bind the Up arrow key
--disable-ctrl-r Don't bind Ctrl+R
--disable-ai Don't bind ? to Atuin AI

For example, to keep Ctrl+R but leave the up arrow alone:

eval "$(atuin init zsh --disable-up-arrow)"

Environment variables

Variable Effect
ATUIN_NOBIND If set to any value, binds no keys at all. Equivalent to passing every --disable-* flag.
ATUIN_NO_BUILTIN_PREEXEC Bash only. Stops atuin init bash from automatically loading its bundled bash-preexec (Atuin >= 18.18.0).

Binding no keys is useful when you want to choose the bindings yourself:

export ATUIN_NOBIND="true"
eval "$(atuin init zsh)"

bindkey '^r' atuin-search

See Key Binding for the widget and function names each shell exposes, and Advanced Key Binding for customizing the keys inside the TUI.