Skip to content

Environment Variables

The wh CLI reads a small set of environment variables for authentication, the default repo target, and the backend URL. This page is the canonical list, with the precedence rules that decide which value wins when more than one source is set.

The variables use two prefixes: WH_* for authentication (WH_TOKEN, WH_PROFILE) and WARMHUB_* for connection and repo context (WARMHUB_API_URL, WARMHUB_REPO, WARMHUB_ORG). The two prefixes are not interchangeable — use the exact names in the table below.

VariablePurposeExample
WH_TOKENWarmHub authentication. A bearer token (personal access token) the CLI sends on every request.eyJhbGciOi...
WH_PROFILENamed auth profile to use, equivalent to --profile / -P.staging
WARMHUB_REPODefault org/repo for commands that take a repo.myorg/myrepo
WARMHUB_ORGDefault org for org-scoped commands and for resolving a bare repo name (myrepomyorg/myrepo).myorg
WARMHUB_API_URLBackend API URL. Overrides the default https://api.warmhub.ai.https://warmhub.example.com

Set them as you would any environment variable:

Terminal window
export WH_TOKEN=eyJhbGciOi...
export WARMHUB_REPO=myorg/myrepo
wh thing list # targets myorg/myrepo, authenticated with WH_TOKEN

The CLI resolves the auth token in this order:

  1. WH_TOKEN environment variable
  2. The named profile on disk (selected by --profile, or WH_PROFILE when the flag is absent; otherwise default)

When WH_TOKEN is set it takes priority over any stored profile — wh auth login writes a profile but does not override an exported WH_TOKEN. The server validates the token, so an invalid or expired WH_TOKEN surfaces as an authentication error rather than silently falling back to a profile.

Commands resolve the target repo in this order:

  1. --repo org/repo flag (per-command override)
  2. WARMHUB_REPO environment variable
  3. .wh file in the current directory (written by wh use)

WARMHUB_ORG does not select a repo on its own. It supplies the org for a bare repo name (wh thing list --repo myrepo) and for org-scoped commands that take an org but no repo, such as wh repo list.

The CLI resolves the backend URL in this order:

  1. --api-url flag
  2. The active profile’s stored URL (profiles are created by wh auth login)
  3. WARMHUB_API_URL environment variable
  4. The default, https://api.warmhub.ai

WARMHUB_API_URL is a fallback that applies only when no profile sets a URL — a loaded profile’s URL takes priority over it. To point a profile-bound CLI at a different backend, pass --api-url.

The SDK does not read any environment variables directly. Pass the token to the client explicitly — typically by reading WH_TOKEN in your own code:

import { WarmHubClient } from "@warmhub/sdk-ts"
const client = new WarmHubClient({
auth: { getToken: async () => process.env.WH_TOKEN },
})

See the SDK overview for the full client setup.

The MCP endpoint authenticates the bearer token sent in the Authorization header. WH_TOKEN is a convenient local source for that value — reference it as Bearer ${WH_TOKEN} in your MCP client config. See the MCP server guide.

These variables tune CLI behavior and are optional:

VariablePurposeExample
WARMHUB_CLI_HTTP_TIMEOUT_MSHTTP headers/body timeout in milliseconds for long-running requests (Node only; no-op under Bun). Default 5700000 (95 minutes); 0 disables the timeout.3600000
WARMHUB_CLI_NO_UPDATE_CHECKDisable the background CLI update check. Set to 1, true, or TRUE. Equivalent to --no-update-check.1
WARMHUB_DEBUGSet to 1 to enable debug output, equivalent to --debug.1
WARMHUB_FUNCTION_LOGSReplay backend function logs. Set to off or raw. Equivalent to --function-logs.raw

WarmHub does not read a GITHUB_TOKEN environment variable from your shell. Credentials for private GitHub-backed component sources are stored explicitly as a named credential — wh credential set <set-name> GITHUB_TOKEN --org myorg — and resolved by the backend at install time. See the component registry reference.