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

# Configuration

> Credentials file, profiles, environment variables, and request timeouts.

Settings resolve in this order: flags, environment variables, the credentials file (`~/.testsprite/credentials`), then built-in defaults.

## Global flags

Global flags apply to one invocation and can go before or after the subcommand. Descriptions: [Command Reference](https://docs.testsprite.com/cli/reference/command-reference.md#global-flags).

| Flag | Overrides | Default |
| :- | :- | :- |
| `--output <json\|text>` | — | `text` |
| `--profile <name>` | `TESTSPRITE_PROFILE` | `default` |
| `--endpoint-url <url>` | `TESTSPRITE_API_URL` | production API |
| `--verbose` | — | false |
| `--debug` | — | false |
| `--dry-run` | — | false |
| `--request-timeout <seconds>` | `TESTSPRITE_REQUEST_TIMEOUT_MS` | `120` |

## Credentials file and profiles

`~/.testsprite/credentials` is an INI file (directory `0700`, file `0600`, atomic writes). Each **profile** is a section holding an `api_key`, for example one for interactive use and one for CI.

```ini theme={null}
[default]
api_key = sk-...

[ci]
api_key = sk-...
```

`testsprite setup` writes a profile; `--from-env` skips the prompt in CI. Select a profile per command or per shell session:

```bash theme={null}
testsprite --profile ci project list
export TESTSPRITE_PROFILE=ci
```

## Environment variables

| Variable | Purpose | Overridden by |
| :- | :- | :- |
| `TESTSPRITE_API_KEY` | API key | — (highest for the key) |
| `TESTSPRITE_PROFILE` | Active profile | `--profile` |
| `TESTSPRITE_API_URL` | API endpoint host | `--endpoint-url` |
| `TESTSPRITE_REQUEST_TIMEOUT_MS` | Per-request timeout in **milliseconds** | `--request-timeout` (seconds) |
| `TESTSPRITE_NO_UPDATE_NOTIFIER` | Any non-empty value disables the "new version" stderr notice | — |
| `NO_COLOR` | Any non-empty value disables colored output | — |
| `HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY` | Route requests through a proxy (lower-case also works) | — |

**Profile:** `--profile`, then `TESTSPRITE_PROFILE`, then `default`. **API key:** `TESTSPRITE_API_KEY`, then the active profile's `api_key`. The CLI never logs the key.

## Output

`--output json` is the stable contract ([Output & Scripting](https://docs.testsprite.com/cli/reference/output-and-scripting.md#the-json-contract)). Errors become a JSON envelope on stderr; exit codes are stable in either mode ([Exit Codes & Errors](https://docs.testsprite.com/cli/reference/exit-codes.md)).

## Request timeouts

`--request-timeout <seconds>` (1–600, default 120) limits each HTTP request; as a variable it is milliseconds: `TESTSPRITE_REQUEST_TIMEOUT_MS=30000`. It does **not** affect the `--timeout` on `test run --wait`, `test wait` or `test rerun --wait`.

## The dashboard link

On run completion and on `test create` / `test create-batch`, JSON output may include `dashboardUrl` (text mode prints `Dashboard:`), a deep link to the test in the Web Portal. The backend builds it; if it offers none the CLI computes one from `projectId` + `testId`. If no correct link exists, no URL is printed (an `[advisory]` points at `test get <id>`) rather than one that would 404. The field is absent under `--dry-run`.

```json theme={null}
{
  "runId": "run_5c1d...",
  "status": "failed",
  "dashboardUrl": "https://www.testsprite.com/dashboard/tests/proj_8f0f6/test/test_3a9f21c7"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.