- CLI flags
- Environment variables
~/.config/tensormesh/config.toml- Built-in defaults
--controlplane-base,
TENSORMESH_CONTROL_PLANE_BASE_URL, or top-level controlplane_base in
config.toml.
If you need an alternate local state root for scripting or side-by-side environments, set TM_CONFIG_HOME. That moves both config.toml and auth.json together under the directory you choose.
Within config.toml, gateway values resolve in this order:
[overrides][managed]
tm config show --sources when you need to confirm which layer actually won for each value.
Create A Starter Config
Canonical Config File
The standard persistent CLI setup lives in:~/.config/tensormesh/config.toml
Or, when TM_CONFIG_HOME is set:
- config:
$TM_CONFIG_HOME/config.toml - auth:
$TM_CONFIG_HOME/auth.json
tm config init creates the file with user-owned request settings plus two
gateway sections:
[managed]: written bytm init --sync[overrides]: optional manual gateway overrides
tm init --sync syncs the available gateway settings from the Control Plane,
then updates [managed]. When the command runs with --controlplane-base, it
also persists that controlplane_base into the active config.toml. A
session-only TENSORMESH_CONTROL_PLANE_BASE_URL override still wins while it is
set, but tm init --sync does not write that env override into config.toml.
When a served deployment already exists, that
includes the gateway provider and served model name. When no served model
exists yet, the sync can still write the API key and user id while leaving
gateway_model_id unset:
[overrides] values in config.toml still win over [managed], and env
vars still win over both.
Config File Schema
The starter template is the real schema the CLI understands today:controlplane_base: optional Control Plane base URL override for auth, sync, and other Control Plane commandstimeout_seconds: default HTTP timeout for commands that use the shared request clientmax_retries: default retry count for idempotent requestsca_bundle: optional PEM CA bundle path for TLS verification
[managed]: synced values owned bytm init --sync[overrides]: optional manual overrides for provider, API key, user id, and served model name
gateway_api_key is the shared inference API key for both On-Demand and
Serverless requests. The name stays gateway_api_key for config compatibility,
even when you are only using tm infer chat --surface serverless.
gateway_api_key is the stored inference API key used by the SDK as inference_api_key.
gateway_model_id remains a config compatibility key; its value is the served model name string sent as model.
Top-level gateway_* keys are no longer read. Move manual values into
[overrides], or run tm init --sync to refresh [managed].
gateway_base is not configured directly. The CLI derives it from gateway_provider.
Single-File Design
The CLI now uses a single canonical config file. If you want to change gateway behavior manually, edit[overrides] in ~/.config/tensormesh/config.toml
instead of switching between named profiles or maintaining a separate runtime file.
If you want that same single-file design in a different local root, set
TM_CONFIG_HOME instead of introducing another profile layer.
Example:
tm doctor, tm infer doctor, and tm auth status report local config and credential presence. Use tm auth whoami when you need a live Control Plane auth check.
Interpreting config show --sources
Use --sources when debugging precedence:
values: resolved config after redacting secrets such asgateway_api_keysources: where each value came from, such asconfig:timeout_seconds,managed:gateway_api_key, orderived-from:managed:gateway_provider
built-in:config_path: CLI defaultTENSORMESH_CONTROL_PLANE_BASE_URL: environment override for the Control Plane base URLmanaged:gateway_api_key: synced value from[managed]in~/.config/tensormesh/config.tomlderived-from:managed:gateway_provider: computed value, such asgateway_base, derived from a synced managed providerconfig:controlplane_base: explicit top-level Control Plane host fromconfig.tomlconfig:gateway_provider: explicit user override from[overrides]inconfig.toml
tm config show and tm config show --sources redact secrets such as
gateway_api_key in both text and JSON output. That is intentional.
To access the unredacted key, read the config file directly as shown in
the Exporting Managed Values section below.
Exporting Managed Values For Automation
If you need to bridge CLI-managed local state into a controlled shell script, read the local config file directly instead of scraping redactedtm config show
output.
Example:
Environment Variables
| Variable | Overrides flag | Description |
|---|---|---|
TENSORMESH_CONTROL_PLANE_BASE_URL | --controlplane-base | Override the Control Plane base URL for CLI auth and Control Plane requests. |
TENSORMESH_CA_BUNDLE | --ca-bundle | Path to a PEM CA bundle for TLS verification. |
TENSORMESH_TIMEOUT_SECONDS | --timeout | Default HTTP timeout in seconds. |
TENSORMESH_MAX_RETRIES | --max-retries | Max retries for idempotent requests on transient errors. |
TM_CONFIG_HOME | — | Override the config and auth root directory. Moves both config.toml and auth.json to $TM_CONFIG_HOME/. |
gateway_api_key, gateway_user_id, and gateway_model_id — do not have environment variable equivalents in the CLI. Set them in [overrides] in config.toml, or use tm init --sync to populate [managed].
If you need an environment-variable-only credential workflow without a config file, use the Tensormesh SDK instead, which supports TENSORMESH_INFERENCE_API_KEY and related credential variables.

