Installer environment variables
Control the script installer (destination, source, harness, profile, verify) with environment variables.
Goal: drive install.sh / install.ps1 without editing the script by setting
environment variables before you run it.
Prerequisites
- A POSIX shell (
bash) or PowerShell 5.1+. The PowerShell examples below runpwsh(PowerShell 7+). Under Windows PowerShell 5.1, runpowershell -NoProfile -ExecutionPolicy Bypass -File install.ps1instead. - The variables are read once at the top of the installer, so set them in the same command (or export them first), then run the installer.
The installer variables
| Variable | Controls | Default |
|---|---|---|
APOTHEM_HOME | Install destination for the cloned source tree | $HOME/.apothem |
APOTHEM_REPO | Git remote to clone | https://github.com/ahmed-g-gad/apothem |
APOTHEM_REF | Git ref to check out; unset resolves the latest signed vMAJOR.MINOR.PATCH tag, a tag value pins it, main selects the moving branch. A non-tag ref such as main aborts unless APOTHEM_ALLOW_UNVERIFIED=1. | unset (latest signed tag) |
APOTHEM_ALLOW_UNVERIFIED | Downgrade a tag-signature-verification failure from a fatal abort to a warning when set to 1 | 0 (verify, fail-closed) |
APOTHEM_VERIFY | signature verifies the release tag's GPG signature; checksum installs the release's platform archive after checking its SHA-256 against the release's SHA256SUMS (integrity, not proof of who published it) | signature |
APOTHEM_RELEASE_BASE | Download base for checksum mode | <APOTHEM_REPO>/releases/download |
APOTHEM_SOURCE | Explicit local source tree to use instead of cloning | unset (clone) |
APOTHEM_HARNESS | User-scope harness to install (antigravity, claude-code, codex, hermes, open-claw, opencode, qwen-code). The installer does not pass --project, so a project-scope harness fails with project.required; install those afterward with apothem install --harness NAME --project PATH. | claude-code |
APOTHEM_PROFILE | Path to the shared profile YAML | $HOME/.config/apothem/profile.yaml |
APOTHEM_SKIP_VERIFY | Skip the post-install verify step when set to 1 | 0 (verify runs) |
APOTHEM_AUTO_INSTALL_DEPS | Install the missing click / rich prerequisites automatically, without prompting, when set to 1 | 0 (prompt, or decline in a non-interactive pipe) |
APOTHEM_BIN_DIR | Directory for the placed apothem command shim | $HOME/.local/bin (POSIX); %LOCALAPPDATA%\Microsoft\WindowsApps (Windows) |
NO_COLOR | Turn off coloured output when set to any value (no-color.org); colour is also off whenever the output is not a terminal (a pipe, a file, a CI log) | unset (colour on an interactive terminal only) |
APOTHEM_SOURCE takes precedence over a clone: when set to a checkout that
contains src/apothem, the installer uses it directly, never touches
APOTHEM_REPO / APOTHEM_REF, and skips tag resolution and signature
verification (nothing is fetched to verify).
When APOTHEM_HOME points at an existing directory that is not a git
clone, the installer refuses to delete it: move it aside, point
APOTHEM_HOME elsewhere, or pass --yes (-Yes on Windows) to
authorize the replacement. A stale empty directory is replaced
without the flag.
Trust model
With no APOTHEM_REF set, the installer resolves the latest signed release
tag and verifies its signature with git verify-tag before materializing any
configuration; an unsigned or tampered tag aborts the install. A signed tag
whose maintainer public key is missing from the local keyring aborts with
key-import guidance instead - import the key and check its fingerprint
against the value published in
SECURITY.md.
Pin a known
release with APOTHEM_REF=<tag>, taking the tag from the
releases page; a pinned tag
is verified the same way. Select the moving branch with APOTHEM_REF=main plus
APOTHEM_ALLOW_UNVERIFIED=1; that install is unverified, and main alone
aborts because a branch is not a signed tag. Set APOTHEM_ALLOW_UNVERIFIED=1 on
its own to proceed past a verification failure with a warning (air-gapped,
local, or pre-signed-release use).
APOTHEM_REF=vMAJOR.MINOR.PATCH bash install.shAPOTHEM_VERIFY=checksum bash install.shAPOTHEM_ALLOW_UNVERIFIED=1 bash install.shSteps (POSIX bash)
-
Install a non-default user-scope harness:
APOTHEM_HARNESS=codex bash install.sh -
Pin the install destination and select the moving
mainbranch. A branch is not a signed tag, so the installer also needsAPOTHEM_ALLOW_UNVERIFIED=1:APOTHEM_REF=main APOTHEM_ALLOW_UNVERIFIED=1 APOTHEM_HOME=/opt/apothem bash install.sh -
Use a local checkout and a custom profile, skipping verify:
APOTHEM_SOURCE=/work/apothem \ APOTHEM_PROFILE=/work/profile.yaml \ APOTHEM_SKIP_VERIFY=1 \ bash install.sh
Steps (PowerShell)
Set each variable on $env: before running the installer:
$env:APOTHEM_HARNESS = 'codex'
pwsh -NoProfile -File install.ps1$env:APOTHEM_ALLOW_UNVERIFIED = '1'
$env:APOTHEM_REF = 'main'
$env:APOTHEM_HOME = 'C:\opt\apothem'
pwsh -NoProfile -File install.ps1$env:APOTHEM_SOURCE = 'C:\work\apothem'
$env:APOTHEM_PROFILE = 'C:\work\profile.yaml'
$env:APOTHEM_SKIP_VERIFY = '1'
pwsh -NoProfile -File install.ps1Verify
The installer prints ✓ Harness <name> installed, then (unless
APOTHEM_SKIP_VERIFY=1) ✓ verify passed. Confirm independently:
apothem verify --harness codexFor a project-scope harness such as Cursor, run the install and the verify
yourself after the installer, with --project:
apothem install --harness cursor --project /path/to/project
apothem verify --harness cursor --project /path/to/projectWhen the profile did not yet exist, the installer creates one from the example
and carries on to install and verify in the same run. The example's identity
fields are placeholders, so the install prints a note; edit $APOTHEM_PROFILE,
then run apothem update --harness <name> to apply your identity. A --dry-run
with no profile previews with the example in place and writes nothing.
Related
- Installing covers the one-shot network install.
- Add a harness covers adding harnesses through the CLI after the first install.
Add a harness
Enable a harness adapter so its native configuration is materialized from the shared profile.
Run the behavioural evals
Measure whether Apothem's commands and subagents fire on the right requests, whether each pipeline stage produces its artifact, and whether a rule changes behaviour, with a cost-capped eval run.