lizard run

Run a command locally with project and service secrets injected.

What run injects

lizard run loads the project’s secrets, then the service’s secrets on top, and runs your command on your machine with them in its environment.

  • For an app service, it injects the stored values. References such as ${{postgres.DATABASE_URL}} arrive as that literal text, not the resolved value. Platform variables such as PORT and LIZARD_* are not injected.
  • For an addon (--service postgres, --service redis, --service s3), it injects the addon’s real connection values, such as DATABASE_URL.

To run a migration or database client locally, point --service at the addon, not at the app that references it.

Lizard disables lizard ssh into running services (the API answers 403 “Shell access to services is disabled”). To check what the running app gets, use:

CheckCommand
Empty referenceslizard logs --build --service api (the build log warns about every ${{…}} reference that resolved to an empty value)
Stored valueslizard secrets list --service api --show
An addon’s real connection valueslizard run --service postgres -- printenv DATABASE_URL

Usage

lizard run [flags] -- <command>

Flags

FlagDescription
-s, --service <name>Service whose env to inject (defaults to the linked service)
--no-serviceDon’t inject service env, project secrets only
-p, --project <id>Project name, slug, or ID (defaults to the linked project, or to your default project in an unlinked folder)

In an unlinked folder, lizard run --service postgres reads the postgres addon of your default project, the oldest project in your personal workspace. Pass -p to use another project’s database.

Examples

Run a migration against Managed Postgres

lizard run --service postgres -- node scripts/migrate.js
lizard run --service postgres -- printenv DATABASE_URL

Run a local tool with an app’s stored secrets

lizard run --service api -- node scripts/report.js

See also

  • lizard ssh: why shell access to services is off, and what to use instead
  • lizard secrets: list and set the values run injects
  • Variables: how project and service variables are defined and referenced
  • Python app hosting: running manage.py and other framework tooling against a deployed database

Updated