Skip to main content
The Retab CLI stores named environment profiles in ~/.retab/config.json. Each profile pairs a slug (test, production, staging, qa, …) with a stored API key. CLI commands resolve credentials from those profiles, environment variables, and flags using a strict precedence so the command target is never ambiguous. The key still selects the customer environment. CLI profile flags only choose which stored key the CLI sends.

Commands

retab env switch only changes the local default. It never mutates server state and it never changes what an API key can access.

Selecting an environment for one command

Three flags pick an environment for a single command:
--live is documented as an alias for --env production. It always targets the canonical production environment, regardless of any custom display name you give production locally.

Resolution precedence

The CLI picks credentials in this strict order. The first source that provides a key wins.

Conflict rejection

The CLI rejects combinations where the visible command target and the actual key target could disagree. This is deliberate: silent overrides are exactly how production accidents happen. Sample error:

Server-resolved environment

retab auth status reports what the server says about the active credential, not just what the prefix looks like:
retab env list shows the same picture in a table:
JSON output is available for scripts (add --json or rely on the non-TTY default).

Production safety prompts

High-risk live writes (publish, delete, rotate secret, run with external side effects, retry job, resend webhook) require confirmation. In an interactive shell the CLI prints:
In a non-interactive shell — CI, scripts, agent runs — confirmation is not available, so the CLI requires --confirm:
Read-only commands (list, get, auth status, diagnose, …) never prompt; they print the resolved environment in debug/status output so the target is still visible.

CI guidance

Prefer explicit keys plus --confirm over ambient env switch production in CI. The explicit form makes production use visible in the script and in CI logs, and it avoids the failure mode where a forgotten env switch silently turns subsequent commands into production writes.
Do not recommend retab env switch production in a CI runner.

Custom environments

Custom slugs (e.g. staging, qa, demo) are local profile names. Each custom slug is still backed by a test or production API key, so its server-side type is determined by the key:
  • rt_test_... -> server type test
  • rt_live_... -> server type production
This keeps the two important safety classes (test vs. production) intact while letting you organize multiple credentials under names that match your own infrastructure.

See also