drift slice
Create, resize and operate the slice itself, the one running thing your project lives in.
| Command | Description |
|---|---|
drift slice create [name] | Open the dashboard's create-slice view. You configure resources there, see the price update as you go, and submit; the new slice becomes the active one. |
drift slice create <name> --free | Create a free Hacker slice with no dashboard, usable in CI, scripts, and SSH sessions. --headless is an alias. |
drift slice create --from <Driftfile> | Create the slice at the shape a Driftfile declares. The name comes from the file, so don't also pass one. |
drift slice list | List your slices (* marks the active one) |
drift slice use <name> | Set the active slice for the commands that follow |
drift slice resize [name] | Resize a slice: the browser configurator by default, or --from a Driftfile. Defaults to the active slice. |
drift slice restart | Restart your slice |
drift slice delete <name> [--yes] | Delete a slice and everything in it (irreversible) |
On the --from path, both create and resize price the manifest server-side and ask you to confirm. --yes auto-confirms that prompt for CI, and --billing-period-months N sets the billing period. The dashboard and browser paths collect both in their own form.
Growing and shrinking
A deploy only ever creates or grows a slice. Shrinking is a separate verb with a separate flag, so that lowering production's limits is never something a deploy does on your behalf.
# Grow: edit the Driftfile upward, then deploy.
drift project deploy
# Shrink: edit the Driftfile downward, then resize WITH the flag.
drift slice resize --from Driftfile --allow-destructive--allow-destructive is required for any non-zero shrink.
resize --from that lowers a limit is refused. The flag lives on the command line rather than in the Driftfile deliberately: a teammate reading the manifest can't see that a run will shrink production, but they can see it in the workflow file that passed the flag.A shrink is also refused when the new limit sits below what the slice holds, and the response names each offending resource with its current usage. Remove the resources first, then resize.
Linking
Let the active slice call another slice you own, in-cluster (e.g. an app calling your own observability slice). From code, reach the linked slice with drift.Slice("<name>").
| Command | Description |
|---|---|
drift slice link add <slice> | Allow the active slice to call <slice> (same owner) |
drift slice link list | List the slices the active slice can call, and who can call it |
drift slice link remove <slice> | Remove a link |
Snapshots
Portable backups of a whole slice: source code, data, secrets, and sites, with no Drift-specific files in the archive.
| Command | Description |
|---|---|
drift slice snapshot create [--name label] | Snapshot the active slice (polls until ready) |
drift slice snapshot list | List snapshots with id, name, size, and status |
drift slice snapshot download <id> [-o path] | Download a snapshot archive |
drift slice snapshot restore <id> | Restore a snapshot into the active slice |
drift slice snapshot delete <id> [--yes] | Delete a snapshot |
Cache and locks are not in the archive.
Custom domains
Point your own hostname at a slice; Drift verifies ownership and issues the TLS certificate. See Getting started for the full flow.
| Command | Description |
|---|---|
drift slice domain add <host> | Register a custom hostname (prints the DNS records to create) |
drift slice domain add <host> --wildcard | Route every subdomain of host to this slice as well |
drift slice domain verify <host> | Re-check the TXT record and, on success, issue the certificate |
drift slice domain list | List custom hostnames for the active slice |
drift slice domain remove <host> | Remove a hostname, its certificate, and its routing |
--wildcard is routing only. Every subdomain reaches the slice, and each one gets its own certificate issued on demand, and there is no wildcard certificate. Telling alice.example.com from bob.example.com is your app's job; the platform hands both to the same slice.
Hostnames can also be declared in the Driftfile under domains:, which the deploy reconciles.