saucectl authoring variables
Manage Data Variables, the shared values such as usernames, passwords, and URLs that authored tests can reference.
Every variable belongs to one of four scopes: org, team, testSuite, or testCase. Org variables are visible to every team in your organization. Variables in the other scopes are visible only to the team that owns them. Only the owning team can update or delete a variable.
Aliases: variable, var
Usage
$ saucectl authoring variables [command] [flags]
Commands
| Command | Description |
|---|---|
list | List variables. |
get | Show a variable. |
create | Create a variable. |
update | Change a variable's name, description, value, or secret setting. |
delete | Delete a variable. |
All commands also accept the global options, such as --region.
A secret variable's value is stored separately and is never returned by any command.
list
List variables.
Alias: ls
$ saucectl authoring variables list [flags]
| Flag | Shorthand | Description |
|---|---|---|
| --out | -o | Output format. Options: text (default) and json. |
| --scope | None | Filter by scope. Options: org, team, testSuite, and testCase. |
| --test-suite-id | None | Suite ID. Required with --scope testSuite. |
| --test-case-id | None | Test case ID. Required with --scope testCase. |
| --search | None | Case-insensitive substring match on the variable name. |
| --skip | None | Number of results to skip. Default is 0. |
| --limit | None | Maximum number of results to return, from 1 to 200. Default is 20. Unlike other list commands, 0 is not supported. |
| --all | None | Return every result, fetching all pages. --limit is ignored. |
saucectl authoring variables list --scope org
saucectl authoring variables list --scope testSuite --test-suite-id <test-suite-id>
saucectl authoring variables list --search pass -o json
get
Show a variable.
$ saucectl authoring variables get <id> [flags]
| Flag | Shorthand | Description |
|---|---|---|
| --out | -o | Output format. Options: text (default) and json. |
saucectl authoring variables get <variable-id>
create
Create a variable in the org, team, testSuite, or testCase scope.
Supply the value with exactly one of --value, --value-from-env, or --value-from-file. If you supply none of them, an interactive session prompts for the value, masking the input for --secret. A non-interactive session fails.
A value passed with --value is visible in your shell history and the process list. For secrets, use --value-from-env or --value-from-file.
$ saucectl authoring variables create [flags]
| Flag | Shorthand | Description |
|---|---|---|
| --scope | None | Required. Options: org, team, testSuite, and testCase. |
| --name | None | Required. Lowercase letters, digits, and underscores only, 1 to 255 characters. |
| --test-suite-id | None | Suite ID. Required with --scope testSuite. |
| --test-case-id | None | Test case ID. Required with --scope testCase. |
| --value | None | The value. |
| --value-from-env | None | Read the value from this environment variable. |
| --value-from-file | None | Read the value from this file, or use - to read it from standard input. One trailing newline is removed. |
| --secret | None | Mark the value as secret. It is never displayed again. |
| --description | None | Description, up to 1000 characters. |
| --out | -o | Output format. Options: text (default) and json. |
saucectl authoring variables create --scope org --name password --secret --value-from-env SAUCE_DEMO_PASSWORD
echo -n "standard_user" | saucectl authoring variables create --scope team --name username --value-from-file -
saucectl authoring variables create --scope testCase --test-case-id <test-case-id> --name coupon --value SAVE10
update
Change a variable's name, description, value, or secret setting. Only the flags you specify change, and you must specify at least one.
Updates are protected against concurrent edits. By default, saucectl reads the variable first and sends its current version with the update, so if someone else changes the variable in between, the update is refused instead of overwriting their change. To check against a version you read earlier, pass --expected-last-update.
$ saucectl authoring variables update <id> [flags]
| Flag | Shorthand | Description |
|---|---|---|
| --name | None | New name. Lowercase letters, digits, and underscores only. |
| --description | None | New description, up to 1000 characters. |
| --value | None | New value. |
| --value-from-env | None | Read the new value from this environment variable. |
| --value-from-file | None | Read the new value from this file, or use - to read it from standard input. One trailing newline is removed. |
| --secret | None | Set whether the value is secret, with --secret=true or --secret=false. If you don't supply a new value, the existing value is moved between normal and secret storage. |
| --expected-last-update | None | The lastUpdate value from an earlier read. The update fails if the variable has changed since then. Default is to read the current value first. |
| --out | -o | Output format. Options: text (default) and json. |
saucectl authoring variables update <variable-id> --value-from-env NEW_PASSWORD
saucectl authoring variables update <variable-id> --secret=true
saucectl authoring variables update <variable-id> --description "Rotated 2026-09" \
--expected-last-update <last-update>
delete
Delete a variable. If the variable is secret, its stored value is deleted too.
Alias: rm
$ saucectl authoring variables delete <id> [flags]
| Flag | Shorthand | Description |
|---|---|---|
| --expected-last-update | None | The lastUpdate value from an earlier read. The delete fails if the variable has changed since then. Default is the current value. |
| --yes | -y | Skip the confirmation prompt. Required when saucectl is not running interactively. |
saucectl authoring variables delete <variable-id>
saucectl authoring variables delete <variable-id> --yes --expected-last-update <last-update>