drift Docs
Start
What is Drift?
The tour, if you are new here.
Use cases
Whether Drift does your thing.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, four unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Accounts, tokens and scopes.
Security
Boundaries, sandboxing and hardening.
Troubleshooting
Error codes
What went wrong, and what to do about it.
Legal
Acceptable use
What a slice may not be used for.
Data processing
The DPA, and every sub-processor.

drift slice

Create, resize and operate the slice itself — the environment your project lives in.

Command Description
drift slice create [name]Draw the slice's shape in the terminal. You pick resources there, see the price update as you type, and apply; the new slice becomes the active one.
drift slice create <name> --freeCreate a free Hacker slice with no form, usable in CI, scripts, and SSH sessions. --headless is an alias.
drift slice listList your slices (* marks the active one)
drift slice use <name>Set the active slice for the commands that follow
drift slice resize [name]Draw the slice's shape opened on what it already is. Defaults to the active slice.
drift slice shrinkDeprecated: resizes the active slice, exactly as resize does.
drift slice restartRestart your slice
drift slice delete <name> [--yes]Delete a slice and everything in it (irreversible)

Changing a slice's shape

drift slice create and drift slice resize own a slice's shape, and they are the only things that write one. Every resource, every limit and the price of the lot are chosen there, in a form that recomputes the total as you type. A Driftfile declares what runs on a slice; it does not say what the slice is.

The form is a tree you move around in. Arrows move, space folds a section, and typing edits the row you are on directly — a function's row is its route, so you highlight it and start spelling. ^D removes an item, Esc discards a half-typed one. Everything is collapsed to begin with, so the parts you never open stay at the platform's own defaults.

The price comes from the server on every edit; the CLI ships no rates of its own, so the figure above Apply is the figure you are charged.

So there is one path for a change of any direction — up or down:

Shell
drift slice resize            # the active slice
drift slice resize my-slice   # or a named one

drift slice shrink still works and resizes the active slice. It says once that it is deprecated: a reduction is chosen and confirmed where the shape lives, so there is no longer a destructive spelling of resize for it to be.

A resize is refused twice on purpose, and each refusal is answered on the form itself rather than by starting again. Booking memory per function for the first time reprices the whole slice, so it is refused until you agree to the new figure — the button changes to say what it now costs, and pressing it again is the agreement. A change that takes something away is refused until you confirm it, after the form has listed what would go.

drift file apply neither creates a slice nor resizes one.

It refuses against a slice that does not exist, naming drift slice create. Growing and shrinking are the same act now, and both happen in the form — which is also where a reduction that would strand data is refused, with each offending resource named against its current usage.

The form needs a terminal.

It is refused outright on a shell with nothing attached, so CI gets an immediate error rather than a half-drawn screen. --free is the one create path that asks nothing and works anywhere.

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 listList 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. Your source comes back as you wrote it, with every Drift-generated wrapper stripped out; the only Drift files in the archive are two manifests that sit beside the tree rather than inside it.

Command Description
drift slice snapshot create [--name label]Snapshot the active slice (polls until ready)
drift slice snapshot listList 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.

Both hold data that is recomputable or short-lived by design, so a restore gives you a cold cache and no held locks.

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> --wildcardRoute 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 listList 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.