#!/bin/sh # CogNexus - run it in your boundary. https://cognexuslabs.ai/install # # Thin bootstrap, on purpose: everything real lives in the artzain CLI # (PyPI), which this script installs and hands off to. Read it before you # run it - it is short because there is nothing to hide. # # curl -fsSL https://cognexuslabs.ai/install.sh | sh # # Needs: Python 3.10+ and Docker (the CLI's own preflight checks Docker and # prints a one-line fix for anything missing). set -eu say() { printf '%s\n' "$*"; } fail() { printf 'install.sh: %s\n' "$*" >&2; exit 1; } PY="" for candidate in python3 python; do if command -v "$candidate" >/dev/null 2>&1; then PY="$candidate"; break; fi done [ -n "$PY" ] || fail "Python 3.10+ is required. Install it (python.org or your package manager), then re-run." "$PY" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' \ || fail "Python 3.10+ is required (found: $("$PY" -V 2>&1))." # artzain>=0.6.0 is the first release that carries `artzain local`. Pinning # the floor makes an out-of-date index fail loudly instead of installing a # CLI without the installer in it. if command -v pipx >/dev/null 2>&1; then say "Installing the artzain CLI (pipx)..." pipx install --force 'artzain>=0.6.0' else say "pipx not found - installing artzain for this user with pip..." "$PY" -m pip install --user --upgrade --quiet 'artzain>=0.6.0' fi say "" say "Starting CogNexus (docker compose, images pinned by digest)..." if command -v artzain >/dev/null 2>&1; then exec artzain local up "$@" fi # pip --user installs sometimes land off PATH; the module entry point is the # same code either way. exec "$PY" -c 'import sys; from artzain.cli import main; sys.argv = ["artzain", "local", "up"] + sys.argv[1:]; main()' "$@"