Skip to content

Environments

Manage environment variables and secrets for Smoketest tests from the CLI.

View as Markdown

Environments hold variables for a project. Use them for URLs, test accounts, feature flags, and secrets that tests need at runtime.

Create an environment

Shell
smoketest env create \
  --project "Production" \
  --name staging \
  --var BASE_URL=https://staging.example.com

If you have a default project set with smoketest projects use, --project can be omitted.

Add secrets

Prompt securely for a secret value:

Shell
smoketest env set staging API_TOKEN --secret

For automation, pass KEY=value:

Shell
smoketest env set staging API_TOKEN=secret-value --secret

Passing secrets as command arguments can expose them to shell history, process lists, terminal logs, or CI output. Prefer the masked prompt for local interactive use.

Plain variables

Shell
smoketest env set staging BASE_URL=https://staging.example.com
smoketest env unset staging BASE_URL

Plain variables are visible in environment output. Secrets are marked as sensitive and their values are not printed back.

List and inspect

Shell
smoketest env list --project "Production"
smoketest env get staging

Environment arguments accept a full ID, short ID, or exact environment name.

Edit as JSON

Shell
smoketest env edit staging --editor

Editor mode opens the environment variable set as JSON. For unchanged sensitive variables, leave out the value field so the stored secret is preserved.

Delete

Shell
smoketest env delete staging
smoketest env delete staging --yes

Deleting an environment does not delete tests, but tests that referenced the environment need to be updated before they can use those variables again.

On this page