init
atuin init <shell>
Section titled “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 zshatuin 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:
atuin setup --only --shell-history --shells zsh,bash,fish,powershell| 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
Section titled “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 ↑ arrow.
- Widgets for
atuin resume(zsh, bash and fish), unbound unless you ask for them: see Bindingatuin resume.
| Flag | Description |
|---|---|
--disable-up-arrow |
Don’t bind the ↑ arrow key |
--disable-ctrl-r |
Don’t bind Ctrl+R |
--bind-ai-resume |
Bind Ctrl+bracket-right to atuin resume (zsh, bash and fish; off by default) |
For example, to keep Ctrl+R but leave the up arrow alone:
eval "$(atuin init zsh --disable-up-arrow)"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
Section titled “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+bracket-right in the emacs, vi-insert and
vi-command keymaps, pass --bind-ai-resume:
eval "$(atuin init zsh --bind-ai-resume)"