Skip to main content

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​

CommandDescription
listList variables.
getShow a variable.
createCreate a variable.
updateChange a variable's name, description, value, or secret setting.
deleteDelete a variable.

All commands also accept the global options, such as --region.

note

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]
FlagShorthandDescription
--out-oOutput format. Options: text (default) and json.
--scopeNoneFilter by scope. Options: org, team, testSuite, and testCase.
--test-suite-idNoneSuite ID. Required with --scope testSuite.
--test-case-idNoneTest case ID. Required with --scope testCase.
--searchNoneCase-insensitive substring match on the variable name.
--skipNoneNumber of results to skip. Default is 0.
--limitNoneMaximum number of results to return, from 1 to 200. Default is 20. Unlike other list commands, 0 is not supported.
--allNoneReturn 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]
FlagShorthandDescription
--out-oOutput 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.

caution

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]
FlagShorthandDescription
--scopeNoneRequired. Options: org, team, testSuite, and testCase.
--nameNoneRequired. Lowercase letters, digits, and underscores only, 1 to 255 characters.
--test-suite-idNoneSuite ID. Required with --scope testSuite.
--test-case-idNoneTest case ID. Required with --scope testCase.
--valueNoneThe value.
--value-from-envNoneRead the value from this environment variable.
--value-from-fileNoneRead the value from this file, or use - to read it from standard input. One trailing newline is removed.
--secretNoneMark the value as secret. It is never displayed again.
--descriptionNoneDescription, up to 1000 characters.
--out-oOutput 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]
FlagShorthandDescription
--nameNoneNew name. Lowercase letters, digits, and underscores only.
--descriptionNoneNew description, up to 1000 characters.
--valueNoneNew value.
--value-from-envNoneRead the new value from this environment variable.
--value-from-fileNoneRead the new value from this file, or use - to read it from standard input. One trailing newline is removed.
--secretNoneSet 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-updateNoneThe 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-oOutput 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]
FlagShorthandDescription
--expected-last-updateNoneThe lastUpdate value from an earlier read. The delete fails if the variable has changed since then. Default is the current value.
--yes-ySkip 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>