#!/bin/sh # Autosana CLI installer. # # curl -fsSL https://get.autosana.ai | sh # # Installs uv (a fast, self-contained Python tool manager) if it's missing, # then installs the Autosana CLI as an isolated tool. Re-running upgrades it. set -eu CYAN='\033[1;36m' RED='\033[1;31m' DIM='\033[2m' RESET='\033[0m' info() { printf "${CYAN}==>${RESET} %s\n" "$1"; } fail() { printf "${RED}Error:${RESET} %s\n" "$1" >&2; exit 1; } command -v curl >/dev/null 2>&1 || fail "curl is required but not found." # 1. Ensure uv. Its installer places uv on PATH (~/.local/bin by default). if ! command -v uv >/dev/null 2>&1; then info "Installing uv (Python tool manager)…" curl -LsSf https://astral.sh/uv/install.sh | sh # Make uv visible for the rest of this script without a new shell. export PATH="${XDG_BIN_HOME:-$HOME/.local/bin}:$HOME/.local/bin:$PATH" fi command -v uv >/dev/null 2>&1 || fail "uv install failed — see https://docs.astral.sh/uv/ and re-run." # 2. Install (or upgrade) the CLI as an isolated tool. info "Installing the Autosana CLI…" uv tool install --upgrade autosana # 3. Confirm + guide. if command -v autosana >/dev/null 2>&1; then info "Installed $(autosana --version 2>/dev/null || echo 'the Autosana CLI')." else info "Installed. Add uv's tool directory to your PATH, then restart your shell:" printf " ${CYAN}uv tool update-shell${RESET}\n" fi printf "\n${DIM}Next:${RESET} ${CYAN}autosana doctor${RESET} ${DIM}# check prerequisites${RESET}\n" printf "${DIM}Docs:${RESET} https://docs.autosana.ai/local-testing\n"