Environment Variables

Reference for the environment variables used by the current Divekit CLI.

This page lists the environment variables that are relevant in normal Divekit CLI usage.

User and Configuration Variables

VariablePurpose
DIVEKIT_HOMEOverrides the base location used for ~/.divekit-style user data resolution.
DIVEKIT_MEMBERSBase directory used for members.path resolution when paths use $DIVEKIT_MEMBERS/....
DIVEKIT_API_TOKENDefault token key used by host entries when no host-specific token key is derived.
DIVEKIT_API_TOKEN_<HOST>Derived host-specific token key, for example DIVEKIT_API_TOKEN_GITLAB.

Interaction Mode Variables

These are typically set by CLI flags, but they can also be set explicitly:

VariablePurpose
DIVEKIT_NON_INTERACTIVE=1Forces non-interactive behavior. Commands fail if input is required.
DIVEKIT_ASSUME_YES=1Accepts default answers automatically. Useful in CI or scripted flows.

Equivalent flags:

  • --non-interactive
  • -y / --yes

--yes also implies non-interactive execution. It accepts explicit defaults, uses the first option for single-choice prompts when no default is configured, and uses an empty selection for multi-select prompts without defaults. Use plain --non-interactive when a script should fail instead of choosing a default automatically.

Extension Runtime Variables

When divekit run executes an extension, Divekit injects these variables into the process environment:

VariablePurpose
DIVEKIT_DISTRIBUTIONCurrent distribution name.
DIVEKIT_REPO_UUIDUUID of the current repository/group.
DIVEKIT_REPO_PATHLocal filesystem path to the repository.
DIVEKIT_RESULT_FILEResult file path for the current extension run.
DIVEKIT_RESULTS_DIRResults directory for the full extension run.
DIVEKIT_RUN_PHASEExternal workflow phase: prepare, each, or cleanup.
DIVEKIT_REPOSITORIESJSON array of selected repositories for external prepare and cleanup phases.

Note: some older help texts also mention DIVEKIT_REPO_USER, but the currently injected runtime variables are the ones listed above.

Lua extensions can also read the same values from dk.run in the simple per-repository form. Lua workflows use callback arguments instead: dk.run.prepare(function(ctx) ... end), dk.run.each(function(repo) ... end), and dk.run.cleanup(function(ctx) ... end). External workflow directories use DIVEKIT_RUN_PHASE; single-file external workflows also receive the phase as the first command-line argument.

Documentation Variable

VariablePurpose
DIVEKIT_DOCS_URLOverrides the docs URL shown by some install/update output.
DIVEKIT_EVAL_CI_CLI_VERSIONOverrides the Divekit CLI version pinned into generated evaluation CI files. Use a release that supports the hidden divekit ci commands used by the generated pipeline.

Notes

  • For authentication setup, prefer divekit auth over managing token-related variables manually.
  • Token values are normally stored via Divekit’s secret storage integration, while tokenAt in hosts.json only stores the lookup key.

Related pages:

Last modified July 13, 2026: docs: update CLI behavior notes (cae77c5)