Environment Variables
This page lists the environment variables that are relevant in normal Divekit CLI usage.
User and Configuration Variables
| Variable | Purpose |
|---|---|
DIVEKIT_HOME | Overrides the base location used for ~/.divekit-style user data resolution. |
DIVEKIT_MEMBERS | Base directory used for members.path resolution when paths use $DIVEKIT_MEMBERS/.... |
DIVEKIT_API_TOKEN | Default 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:
| Variable | Purpose |
|---|---|
DIVEKIT_NON_INTERACTIVE=1 | Forces non-interactive behavior. Commands fail if input is required. |
DIVEKIT_ASSUME_YES=1 | Accepts 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:
| Variable | Purpose |
|---|---|
DIVEKIT_DISTRIBUTION | Current distribution name. |
DIVEKIT_REPO_UUID | UUID of the current repository/group. |
DIVEKIT_REPO_PATH | Local filesystem path to the repository. |
DIVEKIT_RESULT_FILE | Result file path for the current extension run. |
DIVEKIT_RESULTS_DIR | Results directory for the full extension run. |
DIVEKIT_RUN_PHASE | External workflow phase: prepare, each, or cleanup. |
DIVEKIT_REPOSITORIES | JSON 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
| Variable | Purpose |
|---|---|
DIVEKIT_DOCS_URL | Overrides the docs URL shown by some install/update output. |
DIVEKIT_EVAL_CI_CLI_VERSION | Overrides 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 authover managing token-related variables manually. - Token values are normally stored via Divekit’s secret storage integration, while
tokenAtinhosts.jsononly stores the lookup key.
Related pages: