install.sh
AArch64 (ARM64) architecture stringReferences curl flags and HTTP URL
SHA-2560e911b9d8d1ad41d49dd58fbcdf03d5b129b4e84744a7e5574527b31054295a0
Evidence
1#!/usr/bin/env bash
2# Multica installer — installs the CLI and optionally provisions a self-host server.
3#
4# Install / upgrade CLI only:
5# curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
6#
7# Install CLI + provision self-host server:
8# curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/ …
16:25… -----------------------------------------------------
17REPO_URL="https://github.com/multica-ai/multica.git"
18REPO_WEB_URL="https://github.com/multica-ai/multica" # without .git, for GitHub web APIs
19INSTALL_DIR="${MULTICA_INSTALL_DIR:-$HOME/.multica/server}"
20BREW_PACKAGE="multica-ai/tap/multica"
21
22# Host ports Compose reported after `up -d`; set by setup_server and reused by
23# …
45:12… rintf "${BOLD}${RED}✗ %s${RESET}\n" "$*" >&2; exit 1; }
46
47command_exists() { command -v "$1" >/dev/null 2>&1; }
48
49running_in_ssh_session() {
50 [ -n "${SSH_CONNECTION:-}" ] || [ -n "${SSH_CLIENT:-}" ] || [ -n "${SSH_TTY:-}" ]
51}
52
⋯5 lines
68:5… st port Docker Compose actually published for a service.
69#
70# This is the only authority. Compose's interpolation gives the calling process
71# environment precedence over .env, so an ambient PORT / BACKEND_PORT / API_PORT
72# / SERVER_PORT / FRONTEND_PORT moves the published port without touching the
73# f …
73:43… ne made the installer probe and print
74# a port the stack was never published on (#6145). Must be called from the
75# installation directory, after `up -d`.
76compose_published_port() {
77 local service=$1 container_port=$2 published
78
79 published="$(docker compose -f docker-compose.selfhost.yml port "$service" "$container_port" 2>/dev/null | tail -n 1)"
80 published="${published##*:}"
81 published="${published%$'\r'}"
82
83 case "$published" in
84 "" | *[!0-9]*) return 1 ;;
85 esac
86
87 printf "%s" "$published"
88}
89
90detect_os() {
91 case "$(uname -s)" in
92 Darwin) OS="darwin" ;;
93 Linux) OS="linux" ;;
94 MINGW*|MSYS*|CYGWIN*)
95 fail "This script does not support Windows. Use the PowerShell installer instead:
96 irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex" ;;
97 *) fail "Unsupported operating system: $(uname -s). Multica supports macOS, Linux, and Windows." ;;
98 esac
99
100 ARCH="$(uname -m)"
101 case "$ARCH" in
102 x86_64) ARCH="amd64" ;;
103 aarch64) ARCH="arm64" ;;
104 arm64) ARCH="arm64" ;;
105 *) fail "Unsupported architecture: $ARCH" ;;
106 esac
107}
108
109# ----------------------------------------- …