donmai is in 0.x preview. APIs may change between minor releases. See the changelog.

Environment variables complement ~/.donmai/daemon.yaml. Most are optional overrides; a few are the primary source for credentials that should not be stored in config files.

Never commit credentials to config files

Tokens such as WORKER_API_KEY and DONMAI_DAEMON_TOKEN should be set as environment variables or in a secrets manager — not written to ~/.donmai/daemon.yaml. The config file supports ${ENV_VAR} substitution for any value so you can reference them safely.

Setting credentials

# Add to ~/.zshrc or ~/.bashrc
export WORKER_API_KEY=rsk_...
export DONMAI_DAEMON_TOKEN=...
# ~/.donmai/daemon.yaml
orchestrator:
  authToken: ${DONMAI_DAEMON_TOKEN}

Authentication

WORKER_API_KEY

Type: string — rsk_* prefixed API token

Primary API key for authenticating the CLI against the orchestrator. Takes precedence over DONMAI_API_TOKEN when both are set.

export WORKER_API_KEY=rsk_...

DONMAI_API_TOKEN

Type: string — API token

Fallback API token when WORKER_API_KEY is not set. Accepts both rsk_ prefixed API auth tokens and rsp_ prefixed registration tokens.

export DONMAI_API_TOKEN=rsk_...

DONMAI_DAEMON_TOKEN

Type: string — bearer token

Auth token the daemon uses to authenticate with the orchestrator. Equivalent to setting orchestrator.authToken in ~/.donmai/daemon.yaml, but safer to keep out of the config file. Takes precedence over the config file value.

export DONMAI_DAEMON_TOKEN=...

Networking

WORKER_API_URL

Type: string — URL

Base URL of the orchestrator API. Overrides the default (http://localhost:3000) and the orchestrator.url value in daemon.yaml.

export WORKER_API_URL=https://platform.donmai.dev

DONMAI_BASE_URL

Type: string — URL

Alternative base URL override. Checked by the envcompat shim layer. Fallback from legacy AF_BASE_URL.

Paths

DONMAI_ARCH_BIN

Type: string — file path

Path to the architecture corpus binary (af arch). When unset, af uses the default discovery path. Legacy name AGENTFACTORY_ARCH_BIN is accepted with a deprecation warning.

export DONMAI_ARCH_BIN=/usr/local/bin/af-arch

DONMAI_CODE_BIN

Type: string — file path

Path to the code-intelligence binary. Legacy name AGENTFACTORY_CODE_BIN is accepted with a deprecation warning.

Provisioning

DONMAI_PROVISIONING_TOKEN

Type: string — one-time token

Short-lived provisioning token used during donmai daemon setup to register a new machine. Normally injected by the platform; operators rarely set this manually.

Internal / daemon lifecycle

DONMAI_DAEMON

Type: string — sentinel value

Set by the daemon itself as a re-exec guard in the daemonize path. Do not set this manually. Legacy name AF_DAEMON is accepted with a deprecation warning.

Deprecation: legacy AGENTFACTORY_* and AF_* variables

The following legacy variable names are accepted with a deprecation warning for one release cycle. Set the new name to silence the warning.

Legacy variableCurrent name
AGENTFACTORY_ARCH_BINDONMAI_ARCH_BIN
AGENTFACTORY_CODE_BINDONMAI_CODE_BIN
AF_BASE_URLDONMAI_BASE_URL
AF_DAEMONDONMAI_DAEMON
AF_PROVISIONING_TOKENDONMAI_PROVISIONING_TOKEN

These fallbacks will be removed in a future release. Update scripts and CI pipelines to use the current names.