From 04519f36d3204bc39ae76b0cc059763c98f14a10 Mon Sep 17 00:00:00 2001 From: Zeshi Du Date: Tue, 24 Nov 2026 13:31:18 -0800 Subject: [PATCH] docs: simplify the credentials paragraph and the CI skill's local-testing tip --- DOCUMENTATION.md | 2 +- skills/testsprite-ci.skill.md | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index e702d2ab..d5c8e6c4 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1134,7 +1134,7 @@ Print a shell completion script (shell auto-detected from `$SHELL`), for example ### Profiles & credentials -Credentials live at `~/.testsprite/credentials` (INI-style, mode `0600`) — one section per profile. A credentials file resaved as UTF-16 (Windows PowerShell 5.1 `>` / `Out-File`, or Notepad's "Unicode") is still read, and the next save writes it back as UTF-8. **Profile resolution order** (highest first): `--profile` flag → `TESTSPRITE_PROFILE` env → `default`. Within a profile, `TESTSPRITE_API_KEY` and `TESTSPRITE_API_URL` override values from the file. To resolve the key and endpoint without reading the credentials file, set both variables, or set `TESTSPRITE_API_KEY` and pass `--endpoint-url`. In text output, `run` and `auth status` still look at the file for the skill-install warning; `TESTSPRITE_NO_SKILL_WARNING=1` or `--output json` skips that. With an API key alone, the CLI can still read the selected profile to resolve its endpoint. +Credentials live at `~/.testsprite/credentials` (INI-style, mode `0600`) — one section per profile. A credentials file resaved as UTF-16 (Windows PowerShell 5.1 `>` / `Out-File`, or Notepad's "Unicode") is still read, and the next save writes it back as UTF-8. **Profile resolution order** (highest first): `--profile` flag → `TESTSPRITE_PROFILE` env → `default`. Within a profile, the `TESTSPRITE_API_KEY` env var overrides the file, so CI never needs to store the key in `~/.testsprite/credentials`. ### Global flags diff --git a/skills/testsprite-ci.skill.md b/skills/testsprite-ci.skill.md index 60aadca6..d9e7c5a3 100644 --- a/skills/testsprite-ci.skill.md +++ b/skills/testsprite-ci.skill.md @@ -170,14 +170,9 @@ deployments are filtered out by the `if:`). URL) — which in a pull request is the preview, because `ci run --env X --target-url U` runs in a `github-pr-` clone of X at U. Outside a pull request they use the environment's own URL (`--env`'s, or the default's). A hard-coded URL is left as is and always tests that address. -- Testing `ci run` locally: a shell that exports `TESTSPRITE_API_URL` or - `TESTSPRITE_API_KEY` overrides the saved endpoint or key for the selected profile. - If the CLI reports `fetch failed` against a healthy API, check whether those - overrides are set without printing their values. - - ```bash - node -e 'for (const name of ["TESTSPRITE_API_URL","TESTSPRITE_API_KEY"]) console.log(name + ": " + (process.env[name]?.trim() ? "set" : "unset"))' - ``` +- Testing `ci run` locally: a shell that exports `TESTSPRITE_API_KEY` overrides the + key `--profile` selects — an unexpected auth failure is usually that. Check + which are set first, without printing the key: `env | grep -o '^TESTSPRITE_[A-Z_]*'`. ## Don'ts