Revision: 1 Last modified: 2026-12-04T17:48:16Z
A ~90-line forwarder, not an installer in its own right. It exists for one reason: many tools are installed
with curl -fsSL .../install.sh | bash, and that convention must keep working while scripts/setup.sh stays the
single implementation of the install (docs/guides/setup_script.md).
Run it when:
- you want the one-line
curl … | bashinstall, or - you already have a checkout and want to reach bootstrap mode by its published entry-point name.
Do not look for install logic here. Everything it does is locate setup.sh, then run
that setup.sh with HELIX_SETUP_INTERNAL_MODE=bootstrap in its environment.
bash(usesBASH_SOURCE, arrays,trap).curlorwget— required only on the download path (nosetup.shbeside the script). Neither present → exit66.gitand whateversetup.shitself needs; this script adds no requirements of its own.- Env vars (NAMES only):
HELIX_SETUP_BASE_URL— directory URL servingsetup.sh. Defaulthttps://raw.githubusercontent.com/HelixDevelopment/HelixConstitution/main/scripts.file://URLs work, which is how the tests and mirrors drive it.HELIX_INSTALL_NO_RUN=1— load the file (functions defined, traps set) and execute nothing. This is the test seam; it is checked at the last line, before the forwarder is called.HELIX_SETUP_INTERNAL_MODE— set by this script tobootstrap, not by you.
# Conventional one-liner (downloads setup.sh from HELIX_SETUP_BASE_URL, then runs it)
curl -fsSL https://raw.githubusercontent.com/HelixDevelopment/HelixConstitution/main/scripts/install.sh | bash
# Same, forwarding flags to setup.sh
curl -fsSL https://raw.githubusercontent.com/HelixDevelopment/HelixConstitution/main/scripts/install.sh \
| bash -s -- --dry-run
# From a checkout: uses the setup.sh sitting next to this file — no download at all
bash scripts/install.sh --dry-run
# Point at a mirror or a local directory instead of GitHub raw
HELIX_SETUP_BASE_URL=file:///srv/mirror/scripts bash scripts/install.sh --dry-runWhat you should see: whatever setup.sh prints. This script adds no banner, no progress line and no summary. On
the download path it prints nothing itself on success — the first output you see comes from setup.sh.
There is no --help: flags are passed through verbatim to setup.sh. bash scripts/setup.sh --help is the
place to read them (docs/scripts/setup.md).
Pass-through plus its own three:
| Code | Meaning |
|---|---|
0 |
setup.sh succeeded |
1 |
setup.sh failed |
2 |
setup.sh usage error |
3 |
setup.sh blocked on a precondition |
5 |
setup.sh verification failed (including a failing hook installer) |
64 |
The entry sentinel is missing — a truncated download of install.sh itself. Nothing was run. |
66 |
Neither curl nor wget is available, and no local setup.sh was found |
67 |
The setup.sh download failed, is empty, is incomplete, or does not parse |
130 / 143 |
INT / TERM reached this script and was forwarded to the child |
The 0/1/2/3/5 rows are setup.sh's own contract (docs/scripts/setup.md); this script returns the child's
status unmodified.
- Truncated
install.sh. Everything lives in functions and the last line calls the entry point with a sentinel argument (__HELIX_INSTALL_RUN__). A cut file either fails to parse or never reaches the call, so a partial download executes nothing and exits64if it does reachhi_forward_mainwithout the sentinel. - No
setup.shbeside the script. Falls to the download path. The download must satisfy three checks before anything runs: non-empty, last line literally# __HELIX_SETUP_SH_END__, andbash -nparses. Any failure → exit67, temp directory removed. $0is a bare shell name. A stdin-fed shell may reportbash,sh,dash,-bashor-sh. Those are blanked so a file literally namedbashin the current directory is never mistaken for this script.- The private temp directory (
${TMPDIR:-/tmp}/helix-setup.XXXXXX) is removed on every exit path including signals: the signal trap signals the child (only when it is a plain pid greater than 1), waits, cleans, then exits. INT/TERM. Forwarded to the runningsetup.sh— the child is started in the background andwaited so a signal can reach it. The signal handler disables furtherINT/TERMwhile it works.- Piped input left unread. When this script arrived on a pipe (not a terminal, not a file), the unread remainder
of stdin is drained with a 2-second
timeoutso the writingcurlis not left with a broken pipe. timeoutabsent. The stdin drain is skipped; nothing else changes.
- If an argument list arrives without the sentinel
__HELIX_INSTALL_RUN__, print a refusal and return64. - Install
INT→130 andTERM→143 traps. - Normalise
$BASH_SOURCE: blank it when it looks like a bare shell name; otherwise resolve its directory. - Local path — if
<that dir>/setup.shexists, run it as a waited-for child withHELIX_SETUP_INTERNAL_MODE=bootstrap, stdin from/dev/null, and return its status. - Download path — resolve
HELIX_SETUP_BASE_URL(trailing slash stripped),mktemp -d, thencurl -fsSL --retry 2 --connect-timeout 15orwget -q -Ointo<tmp>/setup.sh. - Validate the download (non-empty, end marker,
bash -n); on failure clean up and return67. - Run the downloaded script through the same child/
waitpath, clean up, return the child's status. - Drain unread stdin when this script came in on a pipe and
timeoutexists; exit with the forwarded status.
scripts/setup.sh— the implementation. Two modes: hook mode (run inside an installed checkout) and bootstrap mode (this script always selects bootstrap).scripts/update.sh— updates a constitution checkout and every submodule, rebase-based. Different job.scripts/install_constitution.sh— the richer installer (upstream table, agent wiring, backups,--restore). If you want flags like--upstream,--agent,--dry-runwith a printed plan, that is the script;install.shonly ever reachessetup.sh.docs/scripts/setup.md,docs/scripts/install_constitution.md,docs/guides/setup_script.md.
2026-12-04, in this checkout — script presence, parse cleanliness and the flag/exit-code contract read from source; the script was not executed (it runs an installer):
$ bash -n scripts/install.sh && echo PARSE-OK
PARSE-OK
$ grep -c 'HELIX_SETUP_INTERNAL_MODE=bootstrap' scripts/install.sh
1A reader can reproduce the parse check with the bash -n line above. Reproducing a real run requires network
access to HELIX_SETUP_BASE_URL (or a checkout containing setup.sh) and installs into a project — treat it
as a mutating command and run it only where you intend to install.