Run
envsh run pulls secrets, injects them as environment variables, and runs a command. The secrets are never written to disk.
envsh run --project my-api production -- node server.jsExamples
Section titled “Examples”# Run a Node.js appenvsh run --project my-api production -- node server.js
# Run a database migrationenvsh run --project my-api production -- npx prisma migrate deploy
# Run a deploy scriptenvsh run --project my-api staging -- ./deploy.shThe -- separator
Section titled “The -- separator”The -- is required to separate envsh flags from the command being run.
# Correct — deploy.sh gets --verbose as its own flagenvsh run --project my-api production -- ./deploy.sh --verbose
# Wrong — envsh tries to parse --verboseenvsh run --project my-api production ./deploy.sh --verboseEnvironment variable merging
Section titled “Environment variable merging”The subprocess receives your current shell environment plus the pulled secrets. Secrets override existing env vars with the same name.
Exit code propagation
Section titled “Exit code propagation”The exit code of the subprocess is propagated. If node server.js exits with code 1, envsh run also exits with code 1. This makes it safe to use in scripts and CI pipelines.
Custom SSH key
Section titled “Custom SSH key”envsh run --project my-api --key ~/.ssh/id_ed25519_work production -- node server.js