Skip to content
Apothem
How-to guides

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 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

VariableControlsDefault
APOTHEM_HOMEInstall destination for the cloned source tree$HOME/.apothem
APOTHEM_REPOGit remote to clonehttps://github.com/ahmed-g-gad/apothem
APOTHEM_REFGit ref to check out; unset resolves the latest signed vMAJOR.MINOR.PATCH tag, a tag value pins it, main selects the moving branchunset (latest signed tag)
APOTHEM_ALLOW_UNVERIFIEDDowngrade a tag-signature-verification failure from a fatal abort to a warning when set to 10 (verify, fail-closed)
APOTHEM_SOURCEExplicit local source tree to use instead of cloningunset (clone)
APOTHEM_HARNESSHarness to installclaude-code
APOTHEM_PROFILEPath to the shared profile YAML$HOME/.config/apothem/profile.yaml
APOTHEM_SKIP_VERIFYSkip the post-install verify step when set to 10 (verify runs)
APOTHEM_AUTO_INSTALL_DEPSInstall the missing click / rich prerequisites automatically, without prompting, when set to 10 (prompt, or decline in a non-interactive pipe)
APOTHEM_BIN_DIRDirectory for the placed apothem command shim$HOME/.local/bin (POSIX); %LOCALAPPDATA%\Microsoft\WindowsApps (Windows)

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> (also verified; a tag from the releases page), select the moving branch with APOTHEM_REF=main (unverified), or set APOTHEM_ALLOW_UNVERIFIED=1 to proceed past a verification failure with a warning (air-gapped, local, or pre-signed-release use).

Pinned, verified install
APOTHEM_REF=vMAJOR.MINOR.PATCH bash install.sh
Proceed without verification (interim / air-gapped)
APOTHEM_ALLOW_UNVERIFIED=1 bash install.sh

Steps (POSIX bash)

  1. Install a non-default harness:

    APOTHEM_HARNESS=cursor bash install.sh
  2. Pin the source ref and the install destination:

    APOTHEM_REF=main APOTHEM_HOME=/opt/apothem bash install.sh
  3. 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 = 'cursor'
pwsh -NoProfile -File install.ps1
$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.ps1

Verify

The installer prints ✓ Harness <name> installed, then (unless APOTHEM_SKIP_VERIFY=1) ✓ verify passed. Confirm independently:

apothem verify --harness cursor

When the profile did not yet exist, the installer creates one from the example and exits early — edit $APOTHEM_PROFILE, then re-run.

  • Installing covers the one-shot network install.
  • Add a harness covers adding harnesses through the CLI after the first install.

On this page