#!/usr/bin/env bash # claudebox — trust-less, isolated Incus VMs with Claude Code, creds-free. # The help text lives in usage()/help_cmd(), not in this comment. set -euo pipefail root="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.." && pwd)" remote=""; mode="auto"; name=""; from=""; force=0; json=0; want_help=0 die() { echo "claudebox: $*" >&2; exit 1; } # 1 = it went wrong usage_error() { echo "claudebox: $*" >&2; echo "try 'claudebox help'." >&2; exit 2; } # 2 = you asked wrong version() { echo "claudebox $(cat "$root/VERSION" 2>/dev/null || echo unknown) ($root)"; } COMMANDS="new list info shell exec snapshot restore down start rm status help" is_command() { case " $COMMANDS " in *" $1 "*) return 0 ;; *) return 1 ;; esac; } synopsis_of() { case "$1" in new) echo "claudebox new --name [--from [/]] [--vm|--container]" ;; list) echo "claudebox list [--json]" ;; info) echo "claudebox info [--json]" ;; shell) echo "claudebox shell " ;; exec) echo "claudebox exec -- " ;; snapshot) echo "claudebox snapshot [