Skip to content

Environment variables

Single source of truth for every environment variable APM reads. Variables are grouped by purpose. Unless noted, scope is process (the running apm invocation and any child processes it spawns); a small number toggle behaviour for the entire shell session.

For CLI flags that pair with these variables, see CLI commands. For token policy and supply-chain guidance, see Security and supply chain.

PAT / bearer credentials APM reads when cloning packages, calling host APIs, or wiring secrets into agent runtimes. Treat every value here as a secret: never commit, never log, never echo. See Authentication for the resolution chain and Security and supply chain for token scoping.

VariablePurposeDefaultNotes
GITHUB_APM_PATFine-grained PAT for APM module access on GitHub-class hosts (github.com, GHE Cloud, GHES). First in the GitHub modules precedence chain.unsetHighest precedence for module clones. Also re-exported into Copilot / Codex runtimes.
GITHUB_APM_PAT_<ORG>Per-org PAT override for github.com / GHE Cloud / GHES. <ORG> is the org name uppercased with non-alphanumeric chars replaced by _.unsetWins over GITHUB_APM_PAT when the package owner matches <ORG>.
GITHUB_TOKENStandard GitHub token. Falls back when GITHUB_APM_PAT is unset. Also forwarded to Codex.unsetUsed by modules, copilot, and models purposes.
GH_TOKENgh CLI token. Last in the GitHub modules chain before gh auth token and credential helpers.unsetForwarded to the Copilot runtime.
GITHUB_COPILOT_PATFirst-choice token for the Copilot runtime.unsetOnly consulted by the copilot purpose.
GITHUB_PERSONAL_ACCESS_TOKENForwarded to the Copilot runtime when present.unsetNot part of the modules resolution chain.
GITHUB_HOSTGHES / GHE Cloud hostname (e.g. ghe.example.com). Switches host classification, transport selection, and auth chain.github.comProcess-wide; affects clone URLs and host detection.
GITLAB_APM_PATAPM module access on GitLab SaaS or self-managed. First in the gitlab_modules chain.unset
GITLAB_TOKENGitLab fallback token.unset
GITLAB_HOSTSingle self-managed GitLab hostname (e.g. gitlab.example.com).unsetRecognised as GitLab-class for transport / auth.
APM_GITLAB_HOSTSComma-separated list of additional GitLab hostnames to classify as GitLab-class.unsetUse when you operate multiple GitLab instances.
ADO_APM_PATAzure DevOps PAT for ado_modules.unsetIf unset, APM falls back to AAD bearer via az CLI.
ARTIFACTORY_APM_TOKENJFrog Artifactory token for artifactory_modules.unsetAlso used by the registry-proxy resolver.
GIT_SSH_COMMANDStandard git SSH command override. APM reads it before composing its own SSH env.unsetIf you set it, APM preserves your value.
APM_GIT_CREDENTIAL_TIMEOUTSeconds to wait for a git credential fill response.implementation defaultInteger-like string; invalid values are ignored.
VariablePurposeDefaultNotes
MCP_REGISTRY_URLOverride the MCP registry endpoint used by apm mcp and apm install --mcp NAME. Must be https://.public registryWhen set, every apm mcp command prints Registry: <url>. See apm mcp.
MCP_REGISTRY_ALLOW_HTTPSet to 1 to permit a plaintext http:// MCP_REGISTRY_URL (development only).unsetRequired to opt in to HTTP; production should always use HTTPS.
MCP_REGISTRY_CONNECT_TIMEOUTConnect timeout for registry HTTP calls, in seconds (float).implementation defaultNon-positive / non-numeric values are ignored.
MCP_REGISTRY_READ_TIMEOUTRead timeout for registry HTTP calls, in seconds (float).implementation defaultNon-positive / non-numeric values are ignored.
PROXY_REGISTRY_URLEnterprise package proxy base URL. See Registry proxy.unsetWhen set, APM resolves package downloads through the proxy.
PROXY_REGISTRY_TOKENBearer token for PROXY_REGISTRY_URL.unsetRequired for authenticated proxies.
PROXY_REGISTRY_ALLOW_HTTPAllow http:// for PROXY_REGISTRY_URL (development only).unsetMirrors the MCP registry’s HTTP opt-in.
PROXY_REGISTRY_ONLYSet to 1 to refuse any download not served by the proxy.unsetAir-gapped deployments.
ARTIFACTORY_BASE_URLLegacy alias for PROXY_REGISTRY_URL.unsetPrefer PROXY_REGISTRY_URL in new setups.
ARTIFACTORY_ONLYLegacy alias for PROXY_REGISTRY_ONLY.unsetPrefer PROXY_REGISTRY_ONLY.
ARTIFACTORY_MAX_ARCHIVE_MBMaximum archive size accepted from Artifactory, in MB.500Integer-like string.
VariablePurposeDefaultNotes
APM_CACHE_DIROverride the APM cache root.platform default (XDG / LOCALAPPDATA)Must be writable. See apm cache.
APM_NO_CACHE1/true/yes disables read and write of the cache for the current invocation.unsetEquivalent to --no-cache on commands that support it.
APM_TEMP_DIROverride the temp directory used by clone and download operations.system defaultUseful on Windows when endpoint security blocks %TEMP%. Resolution: env var > temp_dir in ~/.apm/config.json > system default.
APM_NO_REFLINKAny non-empty value disables copy-on-write (reflink) optimisation; APM falls back to plain copies.unsetDiagnostic / portability escape hatch.
APM_COPILOT_COWORK_SKILLS_DIROverride the destination directory for Copilot cowork skills.platform auto-detectResolution: env var > config > auto-detect.
XDG_CACHE_HOMEStandard XDG base-directory variable APM consults when APM_CACHE_DIR is unset (Linux / macOS).unsetHonoured per the XDG spec.
LOCALAPPDATAStandard Windows variable APM consults when APM_CACHE_DIR is unset.OS-providedUsed to derive the default Windows cache path.
CLAUDE_CONFIG_DIROverride the destination Claude reads for skills / agents.Claude defaultRead by the Claude integration target.
VariablePurposeDefaultNotes
APM_POLICY_DISABLESet to 1 to skip policy discovery and enforcement for the entire shell session. Loudly logged.unsetEquivalent to the per-invocation --no-policy on commands that expose it. The only escape hatch for apm deps update. See apm policy.
VariablePurposeDefaultNotes
APM_DEBUGAny non-empty value enables low-level debug logging in download, file ops, and clone-cache paths.unsetVerbose; use for troubleshooting only.
APM_VERBOSE1 enables verbose output for the install pipeline. APM also sets this internally when --verbose is passed.unset
APM_PROGRESSForce the install TUI on or off: always/on/1/true/yes to force on; never/quiet/off/0/false/no to force off; auto (default) lets APM decide based on CI, TERM, and TTY.autoThe CLI sets APM_PROGRESS=quiet when --quiet is passed.
CIStandard CI marker. When truthy (1/true/yes), APM disables the install TUI and adjusts a few interactive defaults.unsetRead; never written.
TERMStandard terminal type. "" or dumb disables the install TUI.OS-providedRead; never written.

These variables exist in the codebase but are not part of the documented contract. Behaviour and naming may change without notice. Do not rely on them in production scripts.

VariablePurposeDefaultNotes
APM_RESOLVE_PARALLELTunes parallelism in the dependency resolver.implementation defaultSubject to change.
APM_LEGACY_SKILL_PATHSToggles legacy skill-path layout in integration targets.unsetCompatibility shim; will be removed.
APM_E2E_TESTSMarks the process as an end-to-end test run; relaxes some interactive guards.unsetTest harness only. Do not set in normal use.