#!/bin/sh # Joxo's official installer, from https://joxo.ai; https://joxo.ai/setup.sh is the script it runs. # It runs on a computer, from a coding agent or a terminal. In a chat app with no terminal (Claude.ai, # ChatGPT), Joxo is added as a connector instead: URL https://joxo.ai/api/mcp, steps at https://joxo.ai/setup#connect # # Joxo, from a terminal, for the folder you are in: # # curl -fsSL https://joxo.ai/install | sh # # It runs https://joxo.ai/setup.sh (the script every Joxo setup line runs; read it first if you like) # with --yes: Node.js if this computer has none (for Joxo alone, checked against nodejs.org), the # connector (checked against the SHA-256 in https://joxo.ai/setup-manifest.json), the joxo command, and # then joxo connect --yes, which opens your browser to sign in once and connects this folder. # It never uses sudo and never stops to ask anything here. Pass a setup or invitation link after # "sh -s --" to use one. set -eu joxo_origin="${JOXO_URL:-https://joxo.ai}" # Only an HTTPS origin (HTTP only for localhost): what it answers runs here. joxo_o=${joxo_origin%/} joxo_bad= case "$joxo_o" in *[!][A-Za-z0-9:/._-]*|*://*/*) joxo_bad=1 ;; https://?*|http://localhost|http://localhost:*|http://127.0.0.1|http://127.0.0.1:*|'http://[::1]'|'http://[::1]:'*) ;; *) joxo_bad=1 ;; esac case "$joxo_o" in http://*:*:*) ;; http://*:*) case "${joxo_o##*:}" in ''|*[!0-9]*) joxo_bad=1 ;; esac ;; esac if [ -n "$joxo_bad" ]; then printf 'Joxo: JOXO_URL must be an HTTPS origin such as https://joxo.ai (HTTP only for localhost).\n' >&2; exit 1; fi joxo_setup= if command -v curl >/dev/null 2>&1; then joxo_setup=$(curl -fsSL "$joxo_origin/setup.sh") || joxo_setup= elif command -v wget >/dev/null 2>&1; then joxo_setup=$(wget -qO- "$joxo_origin/setup.sh") || joxo_setup= else printf 'Joxo: install curl or wget, then run this again.\n' >&2; exit 1 fi case "$joxo_setup" in '#!/bin/sh'*) ;; *) printf 'Joxo: %s/setup.sh did not answer with the setup script. Try again in a minute.\n' "$joxo_origin" >&2; exit 1 ;; esac if [ "$joxo_origin" != "https://joxo.ai" ]; then JOXO_URL="$joxo_origin"; export JOXO_URL; fi exec sh -c "$joxo_setup" joxo-setup --yes "$@"