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 setup adds the atuin init line to the startup files of zsh, bash, fish and PowerShell. To add it without the setup screen, pass --only and name the shells with --shells:
| Shell | Startup file that setup writes to |
|---|---|
| zsh | $ZDOTDIR/.zshrc, or ~/.zshrc when ZDOTDIR isn't set |
| bash | ~/.bashrc |
| fish | ~/.config/fish/config.fish, inside an if status is-interactive block |
| PowerShell | ~/.config/powershell/Microsoft.PowerShell_profile.ps1, or on Windows, the profiles of both PowerShell 7 and Windows PowerShell |
Setup leaves a startup file that already runs atuin init as it is. atuin setup --only --no-shell-history takes out the lines that setup wrote.
For Nushell and xonsh, add the line to your startup file yourself. 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.
- Widgets for
atuin resume(zsh, bash and fish), unbound unless you ask for them: see Bindingatuin resume.
Flags
| Flag | Description |
|---|---|
--disable-up-arrow | Don't bind the Up arrow key |
--disable-ctrl-r | Don't bind Ctrl+R |
--bind-ai-resume | Bind Ctrl+] to atuin resume (zsh, bash and fish; off by default) |
For example, to keep Ctrl+R but leave the up arrow alone:
atuin setup --only --no-up-arrow and atuin setup --only --no-ctrl-r turn the same keys off through the bind_up_arrow and bind_ctrl_r settings, and leave the atuin init line as it is.
Binding atuin resume
atuin init defines widgets that open the atuin resume picker at the prompt and put the command it picks into your shell, but binds no key to them by default. To bind Ctrl+] in the emacs, vi-insert and vi-command keymaps, pass --bind-ai-resume:
Ctrl+] replaces a shell binding
Ctrl+] is zsh's vi-find-next-char (emacs keymap) and bash's character-search: jump to the next occurrence of the character you type next. --bind-ai-resume replaces it. To keep it, bind the widget to another key yourself.
To bind a key of your choice instead, add it after the atuin init line:
eval "$(atuin init bash)"
atuin-bind -m emacs '\C-x\C-r' atuin-ai-resume-emacs
atuin-bind -m vi-insert '\C-x\C-r' atuin-ai-resume-viins
atuin-bind -m vi-command '\C-x\C-r' atuin-ai-resume-vicmd
atuin-bind is the helper atuin init bash defines (see Key Binding); it also works under ble.sh.
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:
See Key Binding for the widget and function names each shell exposes, and Advanced Key Binding for customizing the keys inside the TUI.