Skip to main content
ubx exec runs a command with all stack outputs injected as environment variables. Output keys are uppercased and non-alphanumeric characters replaced with underscores — matching ubx output --format env.

Usage

ubx --experimental exec -- <command> [args...]

Requirements

  • --experimental global flag required
  • A deployed stack with outputs in .ubx/

Examples

ubx --experimental exec -- env | grep VPC
ubx --experimental exec -- psql $DATABASE_URL
ubx --experimental exec -- bash -c 'echo $BUCKET_NAME'
ubx --experimental exec -- terraform plan

Environment injection

Stack outputs become environment variables:
  • Keys uppercased: vpc_idVPC_ID
  • Non-alphanumeric chars replaced with _: db.endpointDB_ENDPOINT
  • Secrets are not injected (shown as [sensitive] in output)
  • Objects and arrays become compact JSON strings
The child process inherits the full parent environment plus the injected output variables.

Experimental flag

ubx --experimental exec -- psql $DATABASE_URL
Without --experimental:
ubx exec is experimental — run with 'ubx --experimental exec' to enable

Exit codes

The exit code from the child command is propagated. If the command cannot be started, ubx exits 1.
  • ubx shell — interactive shell with outputs injected
  • ubx output — display outputs in various formats