Environment variables

Spin respects a small set of environment variables for paths, git behaviour, and CI detection.

XDG_CONFIG_HOME

Spin stores all local state under $XDG_CONFIG_HOME/spin. If unset, it falls back to the OS default:

  • Linux: ~/.config/spin
  • macOS: ~/Library/Application Support/spin
  • Windows: %AppData%/spin

State files:

PathPurpose
pinned.jsonPinned templates from spin add.
registries.jsonRegistered registries from spin registry add.
templates/Cached clones/copies of pinned templates.
registries/<alias>/Cached clones/copies of registered registries.

GIT_TERMINAL_PROMPT

Spin sets GIT_TERMINAL_PROMPT=0 when running git clone, git fetch, and git reset so a missing credential never hangs the CLI waiting for a password. You do not need to set this yourself.

HOME

Used to expand ~ and ~/ in local paths passed to spin add, spin new, and spin registry add.

CI / non-interactive mode

Spin detects non-interactive runs by checking whether stdin is a TTY. In non-interactive mode:

  • spin new requires both <name> and <template> (or --template).
  • Prompts are skipped.
  • --param values are used directly.
  • --dry-run and --print-params also force non-interactive behaviour.

There is no dedicated CI variable; redirect stdin or use the flags above.