#!/bin/bash # Join an exe.dev VM to your Atuin sync server: point Claude Code and Codex # at exe.dev's LLM integration, install Atuin, set the server, log in, sync. # Runs as a first-boot setup script (as root) or by hand (as exedev). # Expects, in the environment: # ATUIN_SYNC your server, e.g. https://my-atuin.exe.xyz # ATUIN_USERNAME your Atuin account # ATUIN_PASSWORD its password # ATUIN_ENCRYPTION_KEY the words `atuin key` prints on a machine already logged in # https://exe.dev/deploy/atuin set -euo pipefail : "${ATUIN_SYNC:?}" "${ATUIN_USERNAME:?}" "${ATUIN_PASSWORD:?}" "${ATUIN_ENCRYPTION_KEY:?}" export ATUIN_SYNC ATUIN_USERNAME ATUIN_PASSWORD ATUIN_ENCRYPTION_KEY as_exedev() { if [ "$(id -u)" = 0 ]; then sudo -u exedev -H --preserve-env=ATUIN_SYNC,ATUIN_USERNAME,ATUIN_PASSWORD,ATUIN_ENCRYPTION_KEY "$@" else "$@" fi } as_exedev bash -c ' set -euo pipefail cd ~ # Before Atuin adds its hooks: exeuntu configure leaves an existing config alone. if command -v exeuntu >/dev/null; then exeuntu configure claude || true exeuntu configure codex || true fi curl --proto "=https" --tlsv1.2 -LsSf https://setup.atuin.sh | sh -s -- --sync "$ATUIN_SYNC" ~/.atuin/bin/atuin login -u "$ATUIN_USERNAME" ~/.atuin/bin/atuin sync '