drift project
The whole-project verbs: ship everything the Driftfile declares, or run the same thing on your laptop.
| Command | Description |
|---|---|
drift project deploy [env] | Deploy everything declared in your Driftfile. Unchanged functions are skipped. |
drift project deploy --plan | Print the slice diff and the cost, then exit. Nothing is applied and no hooks run. |
drift project diff [env] | The same diff as its own verb: resource counts, envelope shape, and the cost change a deploy would apply. Never applies; exits non-zero if the manifest would abort the deploy. |
drift project run [env] | Build and run the whole project locally in Docker, with no account and no cloud |
drift project test [env] | Run it locally, wait for health, then run the Driftfile's tests.e2e commands against it |
drift project stop [env] | Stop the local run |
drift project logs [env] | Tail logs from the local run |
The four local verbs are one loop: run boots the whole project in Docker,
test runs the Driftfile's tests.e2e commands against it, logs
tails it, and stop tears it down.
Deploy flags
| Flag | What it does |
|---|---|
--plan | Dry run: render the diff and the monthly cost, apply nothing. Exits non-zero if the deploy would abort. |
--force | Redeploy every function, even ones whose source is unchanged |
--yes, -y | Auto-confirm the cost prompt (for CI) |
--env <name> | Same as the positional environment argument; also sets ${ENV} |
--secret KEY=value | Override one variable for ${VAR} / $ENVREF resolution. Repeatable. |
--no-env-file | Don't read the .env / .env.<env> file beside the Driftfile |
--no-slice-reconcile | Skip the slice diff entirely and deploy code into the active slice as it stands |
--billing-period-months N | Billing period for a slice this deploy creates or grows |
A deploy only ever creates or grows a slice.
drift slice resize --from Driftfile --allow-destructive.
Secrets declared in a Driftfile can pull values from your shell with $ENV references,
resolved at deploy time.
Testing before you ship
drift project test is run plus your own e2e commands. It starts the project
locally, waits for it to report healthy, exports the instance URL as DRIFT_TEST_URL (the port
is chosen at runtime, so read it rather than hardcoding one), and runs every command under
tests.e2e. The first non-zero exit fails the run, and the instance is torn down either way.
# Driftfile
tests:
e2e:
- npx playwright test
# then, with no account and no cloud:
$ drift project test