Skip to content
gurl exec

gurl exec

Run another command with an environment’s variables in its process environment, without printing them.

Synopsis

gurl exec [--env NAME] [--var KEY=VALUE ...] -- <command> [args...]

gurl exec hands an environment to another tool: a test runner, a script, or a plain curl. Each variable of the environment (aliases resolved, secrets decrypted) is set in the child process’s environment. gurl itself never prints the values.

Everything after -- is the command to run. The exit code of gurl exec is the command’s exit code.

In agent mode, injected secret values are also masked in the child’s output, so a command that echoes $API_KEY prints *****.

Flags

FlagShortDefaultDescription
--env-eactive environmentEnvironment to load
--var-vnoneOverride a variable as KEY=VALUE (repeatable)

Examples

Run a script with an environment

gurl exec --env prod -- node e2e.mjs

The script reads process.env.API_KEY, process.env.BASE_URL, and so on.

Use variables in a shell command

gurl exec --env prod -- sh -c 'curl -H "Authorization: Bearer $API_KEY" "$BASE_URL/v1/charges"'

Single quotes keep your shell from expanding $API_KEY before gurl injects it.

Override one variable

gurl exec --env staging --var REGION=eu -- ./smoke-test.sh

Related commands