Skip to content

Environments and secrets

An environment is a named set of variables belonging to a project — typically one per stage. It is also where credentials belong, instead of inside a recorded script.

Creating an environment

qaclan env create staging
qaclan env set staging base_url https://staging.your-app.test
qaclan env set staging login_email [email protected]

Setting a key that already exists updates it. Environments belong to the active project, so switch projects first if you are working on more than one.

Secrets

Add --secret and the value is masked when environments are listed, so a shared terminal or a screen recording does not leak it.

qaclan env set staging login_password 'correct horse' --secret
qaclan env list staging

Secret values print as ********. The variable still resolves normally when a test runs — only the display is masked.

What masking does and does not do

Masking hides values in CLI output. It is not encryption at rest, and it does not stop a value appearing in an application's own logs or in a response body that your test captures. Treat an environment as private to the machine it lives on.

Using variables

In API requests, reference a variable as {{name}} anywhere — the URL, a header, a query parameter or the body.

{{base_url}}/api/v1/orders?since={{last_sync}}

In browser scripts, the editor binds a recorded literal to a variable for you: it spots a hardcoded email, password or URL in the recording and offers to replace it with an environment key. That is the intended way to get credentials out of a script — see Web testing.

Post-request scripts can also write into shared state with qc.set(key, value), which is how a value captured from one response becomes available to later steps in the same run.

Choosing an environment for a run

Pass --env when you run. For a browser suite the environment's variables are loaded into the process environment for the duration of the run; for an API collection they are available for {{var}} resolution.

qaclan web run --suite <suite_id> --env staging
qaclan api run <name_or_id> --collection Orders --env staging

Listing and removing

CommandWhat it does
qaclan env listEvery environment in the active project, with variables
qaclan env list <name>Just one environment
qaclan env delete <name>Delete an environment and its variables, after confirming

Where values are stored

In the SQLite database at ~/.qaclan/qaclan.db on your machine. If you are logged in, environments and their variables are part of what syncs to the server — so treat a shared workspace as somewhere your teammates can see those values, and keep production credentials out of it.