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 asPORTandLIZARD_*are not injected. - For an addon (
--service postgres,--service redis,--service s3), it injects the addon’s real connection values, such asDATABASE_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:
| Check | Command |
|---|---|
| Empty references | lizard logs --build --service api (the build log warns about every ${{…}} reference that resolved to an empty value) |
| Stored values | lizard secrets list --service api --show |
| An addon’s real connection values | lizard run --service postgres -- printenv DATABASE_URL |
Usage
lizard run [flags] -- <command>Flags
| Flag | Description |
|---|---|
-s, --service <name> | Service whose env to inject (defaults to the linked service) |
--no-service | Don’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.jsPrint an injected environment variable
lizard run --service postgres -- printenv DATABASE_URLRun a local tool with an app’s stored secrets
lizard run --service api -- node scripts/report.jsSee also
- lizard ssh: why shell access to services is off, and what to use instead
- lizard secrets: list and set the values
runinjects - Variables: how project and service variables are defined and referenced
- Python app hosting: running
manage.pyand other framework tooling against a deployed database
Updated