aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2026-03-03 17:10:55 +0100
committerGitHub <noreply@github.com>2026-03-03 17:10:55 +0100
commit10ea7c3a65c39b5a37d46a270b08b8da149f83dc (patch)
tree42b4ed487e34c802b667c73eb5d617985e47779b
parentchore: update changelog (diff)
downloadatuin-10ea7c3a65c39b5a37d46a270b08b8da149f83dc.zip
feat: update script for smoother setup (#3230)
Many users do not seem to read the docs. So, make the install script handle most of the things that we include in the docs quickstart. Ensures that the install script still functions as expected in non-interactive environments - setup scripts, ci, etc. Offers a flag just in case this check fails, to force non-interactive setup. <!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
-rw-r--r--docs/docs/guide/installation.md11
-rwxr-xr-xinstall.sh91
2 files changed, 95 insertions, 7 deletions
diff --git a/docs/docs/guide/installation.md b/docs/docs/guide/installation.md
index aeb33518..193b9ffa 100644
--- a/docs/docs/guide/installation.md
+++ b/docs/docs/guide/installation.md
@@ -16,6 +16,17 @@ then the manual steps below offer much more flexibility.
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
```
+The install script will walk you through importing your shell history and setting
+up a sync account. To skip these interactive prompts (e.g. in CI or
+Dockerfiles), pass `--non-interactive`:
+
+```shell
+curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh -s -- --non-interactive
+```
+
+The script also automatically detects non-interactive environments (piped input,
+no TTY) and skips the prompts in those cases.
+
[**Set up sync** - Move on to the next step, or read on to manually install Atuin instead.](sync.md)
### On Windows
diff --git a/install.sh b/install.sh
index 2372d23f..7962f2b5 100755
--- a/install.sh
+++ b/install.sh
@@ -1,6 +1,23 @@
#! /bin/sh
set -eu
+ATUIN_NON_INTERACTIVE="no"
+
+for arg in "$@"; do
+ case "$arg" in
+ --non-interactive) ATUIN_NON_INTERACTIVE="yes" ;;
+ *) ;;
+ esac
+done
+
+if [ "$ATUIN_NON_INTERACTIVE" != "yes" ]; then
+ if [ -t 0 ] || [ -c /dev/tty ]; then
+ ATUIN_NON_INTERACTIVE="no"
+ else
+ ATUIN_NON_INTERACTIVE="yes"
+ fi
+fi
+
cat << EOF
_______ _______ __ __ ___ __ _
| _ || || | | || | | | | |
@@ -48,7 +65,7 @@ fi
# shellcheck disable=SC2016
if ! grep -q "atuin init bash" ~/.bashrc; then
- curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
+ curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
printf '\n[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh\n' >> ~/.bashrc
echo 'eval "$(atuin init bash)"' >> ~/.bashrc
fi
@@ -69,9 +86,71 @@ end/' "$HOME/.config/fish/config.fish"
fi
fi
-cat << EOF
+ATUIN_BIN="$HOME/.atuin/bin/atuin"
+
+echo ""
+echo "Atuin installed successfully!"
+echo ""
+
+if [ "$ATUIN_NON_INTERACTIVE" != "yes" ]; then
+
+ printf "Would you like to import your existing shell history into Atuin? [Y/n] "
+ read -r import_answer </dev/tty || import_answer="n"
+ import_answer="${import_answer:-y}"
+
+ case "$import_answer" in
+ [yY]*)
+ echo ""
+ if ! "$ATUIN_BIN" import auto; then
+ echo ""
+ echo "History import failed. You can retry later with 'atuin import auto'."
+ fi
+ echo ""
+ ;;
+ *)
+ echo "Skipping history import. You can always run 'atuin import auto' later."
+ echo ""
+ ;;
+ esac
+
+ cat << EOF
+Sync your history across all your machines with Atuin Cloud:
+
+ - End-to-end encrypted — only you can read your data
+ - Access your history from any device
+ - Never lose your history, even if you wipe a machine
+EOF
+
+ printf "Sign up for a sync account? [Y/n] "
+ read -r sync_answer </dev/tty || sync_answer="n"
+ sync_answer="${sync_answer:-y}"
+
+ case "$sync_answer" in
+ [yY]*)
+ echo ""
+ if ! "$ATUIN_BIN" register </dev/tty; then
+ echo ""
+ echo "Registration did not complete. You can run 'atuin register' any time to try again."
+ fi
+ ;;
+ *)
+ echo ""
+ printf "Already have an account? Log in with 'atuin login'.\n"
+ echo "You can also run 'atuin register' any time to create one."
+ ;;
+ esac
+else
+ echo "Non-interactive environment detected — skipping setup prompts."
+ echo "You can run the following commands manually after installation:"
+ echo ""
+ echo " atuin import auto Import your existing shell history"
+ echo " atuin register Sign up for a sync account"
+ echo " atuin login Log in to an existing sync account"
+fi
+
+cat << EOF
_______ __ __ _______ __ _ ___ _ __ __ _______ __ __
| || | | || _ || | | || | | | | | | || || | | |
@@ -81,17 +160,15 @@ cat << EOF
| | | _ || _ || | | || _ | | | | || |
|___| |__| |__||__| |__||_| |__||___| |_| |___| |_______||_______|
-
-
Thanks for installing Atuin! I really hope you like it.
If you have any issues, please open an issue on GitHub or visit our forum (https://forum.atuin.sh)!
If you love Atuin, please give us a star on GitHub! It really helps ⭐️ https://github.com/atuinsh/atuin
-Please run "atuin register" to set up sync, or "atuin login" if you already have an account
+===============================================================================
-Check out Atuin Desktop to build executable runbooks from your shell history - https://github.com/atuinsh/desktop
+ ⚠️ Please restart your shell or open a new terminal for Atuin to take effect!
+===============================================================================
EOF
-