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.
Variables
Section titled “Variables”| Variable | Purpose | Example |
|---|---|---|
WH_TOKEN | WarmHub authentication. A bearer token (personal access token) the CLI sends on every request. | eyJhbGciOi... |
WH_PROFILE | Named auth profile to use, equivalent to --profile / -P. | staging |
WARMHUB_REPO | Default org/repo for commands that take a repo. | myorg/myrepo |
WARMHUB_ORG | Default org for org-scoped commands and for resolving a bare repo name (myrepo → myorg/myrepo). | myorg |
WARMHUB_API_URL | Backend API URL. Overrides the default https://api.warmhub.ai. | https://warmhub.example.com |
Set them as you would any environment variable:
export WH_TOKEN=eyJhbGciOi...export WARMHUB_REPO=myorg/myrepowh thing list # targets myorg/myrepo, authenticated with WH_TOKENPrecedence
Section titled “Precedence”Authentication
Section titled “Authentication”The CLI resolves the auth token in this order:
WH_TOKENenvironment variable- The named profile on disk (selected by
--profile, orWH_PROFILEwhen the flag is absent; otherwisedefault)
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.
Repo target
Section titled “Repo target”Commands resolve the target repo in this order:
--repo org/repoflag (per-command override)WARMHUB_REPOenvironment variable.whfile in the current directory (written bywh 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.
Backend URL
Section titled “Backend URL”The CLI resolves the backend URL in this order:
--api-urlflag- The active profile’s stored URL (profiles are created by
wh auth login) WARMHUB_API_URLenvironment variable- 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.
Using these with the SDK
Section titled “Using these with the SDK”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.
Using these with the MCP server
Section titled “Using these with the MCP server”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.
Advanced CLI behavior
Section titled “Advanced CLI behavior”These variables tune CLI behavior and are optional:
| Variable | Purpose | Example |
|---|---|---|
WARMHUB_CLI_HTTP_TIMEOUT_MS | HTTP 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_CHECK | Disable the background CLI update check. Set to 1, true, or TRUE. Equivalent to --no-update-check. | 1 |
WARMHUB_DEBUG | Set to 1 to enable debug output, equivalent to --debug. | 1 |
WARMHUB_FUNCTION_LOGS | Replay backend function logs. Set to off or raw. Equivalent to --function-logs. | raw |
Component sources and GitHub
Section titled “Component sources and GitHub”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.
Hit a problem or have a question? Get in touch.