#!/bin/sh # TravelMaxx CLI installer — https://travelmaxx.app/cli/docs # Installs the "travelmaxx" package from PyPI using whichever Python # package manager is available (uv > pipx > pip). Never uses sudo. set -eu say() { printf '%s\n' "$*"; } have() { command -v "$1" >/dev/null 2>&1; } if have uv; then say "Installing travelmaxx with uv..." uv tool install --upgrade travelmaxx elif have pipx; then say "Installing travelmaxx with pipx..." pipx install --force travelmaxx elif have python3; then # PEP 668: system pip refuses to install on modern Debian/Ubuntu/Fedora, # so install into a private virtualenv and symlink the entry point. VENV_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/travelmaxx/venv" say "Installing travelmaxx into $VENV_DIR..." if ! python3 -m venv "$VENV_DIR" 2>/dev/null; then say "Error: python3 venv module unavailable." say "On Debian/Ubuntu run: sudo apt install python3-venv" say "then re-run this installer." exit 1 fi "$VENV_DIR/bin/pip" install --quiet --upgrade pip travelmaxx mkdir -p "$HOME/.local/bin" ln -sf "$VENV_DIR/bin/travelmaxx" "$HOME/.local/bin/travelmaxx" case ":$PATH:" in *":$HOME/.local/bin:"*) ;; *) say "" say "NOTE: $HOME/.local/bin is not on your PATH." say "Add this to your shell profile, then restart your shell:" say " export PATH=\"\$HOME/.local/bin:\$PATH\"" ;; esac else say "Error: no supported installer found (need uv, pipx, or python3+pip)." say "Install Python 3.10+ and re-run, or see https://travelmaxx.app/cli/docs" exit 1 fi say "" if have travelmaxx; then say "Installed: $(travelmaxx --version)" else say "Installed. Restart your shell, then run: travelmaxx login" fi say "Get started: travelmaxx login"