> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensormesh.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Diagnose the most common CLI setup, auth, and gateway issues.

## Missing Control Plane Login

If a Control Plane command says you are not authenticated:

```sh theme={null}
tm auth login
tm auth whoami
tm doctor
```

For automation, use `tm auth status --exit-status` when you need a shell-friendly local readiness check for both the Control Plane token and the current gateway credentials. `tm auth status` only reports local credential presence; `tm auth whoami` is the live validation step.

If `tm auth login` appears to wait forever in a remote shell, rerun it with an explicit ceiling such as `tm auth login --no-open-browser --max-wait-seconds 60`.

## Missing Inference Credentials

If `tm infer chat` reports a missing API key or model name, set `gateway_api_key`
under `[overrides]` in your `config.toml`, or pass `--api-key` and `--model` on
the command line:

```sh theme={null}
tm infer doctor --exit-status
tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --json '[{"role":"user","content":"hi"}]'
```

Control Plane auth (`tm auth login`) is separate from the inference API key and
does not substitute for one when calling serverless inference.

If a streaming request stalls because the upstream stops sending events, rerun with a smaller or larger idle timeout:

```sh theme={null}
tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --stream --stream-idle-timeout 60 --json '[{"role":"user","content":"hi"}]'
```

## Config Resolution Confusion

If the CLI is picking up the wrong config or env values:

```sh theme={null}
tm config show
tm config show --sources
tm doctor --exit-status
```

Use `tm infer doctor --exit-status` when you specifically want to gate a direct inference path. Use `tm auth status --exit-status` when you specifically want to gate the broader local auth-and-gateway prerequisites.

## TLS Or Connectivity Problems

If your environment needs a custom CA bundle:

```sh theme={null}
export TENSORMESH_CA_BUNDLE="/path/to/ca-bundle.pem"
tm doctor
```

## Related Reference

* [`tm doctor`](/cli/reference/doctor)
* [`tm auth login`](/cli/reference/auth/login)
* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm config show`](/cli/reference/config/show)
* [`tm infer chat`](/cli/reference/infer/chat)
