Reference
pier add
Add a resource
pier add <command>Add a resource.
Subcommands
pier add app
pier add app [flags]Add an app.
| Flag | Value | Default | Description |
|---|---|---|---|
--name | STRING | App name | |
--plan | STRING | App plan (e.g. app-s, app-m) | |
--replicas | 0 | 0 | Number of replicas |
--autoscale | STRING | Autoscale range min-max (e.g. 1-4); XOR with --replicas | |
--trigger | TRIGGER,... | Autoscale trigger type:value (cpu:70, memory:80, rps:50, latency:250ms); repeatable | |
--idle-after | STRING | Zero-traffic window before scale-to-zero (with --autoscale 0-N) | |
--image | STRING | Container image (static-image flow, skips build) | |
--port | INT | Container port (required with --image) | |
--template | STRING | Scaffold from a starter template (e.g. node_hono, python_fastapi, go_fiber, rust_axum, dockerfile_caddy) | |
-y, --yes | Skip confirmation prompt | ||
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier add site
pier add site [flags]Add a static site.
| Flag | Value | Default | Description |
|---|---|---|---|
--name | STRING | Site name | |
--template | STRING | Scaffold from a starter template (e.g. site_nextjs, site_astro, site_vite, site_hugo, site_html) | |
-y, --yes | Skip confirmation prompt | ||
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier add pg
pier add pg [flags]Add a Postgres instance.
| Flag | Value | Default | Description |
|---|---|---|---|
--name | STRING | Postgres cluster name (CNPG cluster / Pier resource name) | |
--default-db | STRING | Default Postgres database name created with the cluster (required) | |
--plan | STRING | Sizing plan (e.g. pg-s, pg-m, pg-l) | |
--replicas | 0 | 0 | Number of replicas |
--pg-version | STRING | Postgres major version | |
-y, --yes | Skip confirmation prompt | ||
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier add bucket
pier add bucket [flags]Add a bucket.
| Flag | Value | Default | Description |
|---|---|---|---|
--name | STRING | Bucket name | |
--access | "" | Access level: public or private | |
-y, --yes | Skip confirmation prompt | ||
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier add volume
pier add volume [flags]Add a persistent volume.
| Flag | Value | Default | Description |
|---|---|---|---|
--name | STRING | Volume name | |
--size | "" | Size (e.g. 1GB, 5GB) | |
--durability | "" | Durability tier: standard (node-local, default) or ha (replicated, survives node failure). Immutable after creation. | |
-a, --app | STRING | Attach to an app (slug or slug/target) | |
--mount | STRING | Mount path inside the app (required with --app non-interactively) | |
-y, --yes | Skip confirmation | ||
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier add domain
pier add domain [<domain>] [flags]Add a custom domain.
| Argument | Required | Description |
|---|---|---|
<domain> | no | Domain to add (e.g. app.example.com) |
| Flag | Value | Default | Description |
|---|---|---|---|
-a, --app | STRING | App ref (slug or slug/target) | |
-s, --site | STRING | Site ref (slug or slug/target) | |
-y, --yes | Skip confirmation | ||
--stage | Write the change to pier.yaml only — apply later with 'pier deploy' |
pier add target
pier add target <app> <name> [flags]Add a deployment target to an app or site.
| Argument | Required | Description |
|---|---|---|
<app> | yes | App or site (name) |
<name> | yes | New target name (slug-shaped, e.g. canary) |
| Flag | Value | Default | Description |
|---|---|---|---|
--branch | STRING | Git branch that deploys this target | |
--plan | STRING | Sizing plan (e.g. app-s, app-m) | |
--dockerfile | STRING | Dockerfile path override (relative to build context) | |
-y, --yes | Skip confirmation prompt |
Global flags apply to every command.
Examples
pier add app --name api --plan app-s # build from ./Dockerfile
pier add app --name whoami --image traefik/whoami --port 80
pier add pg --name main --plan pg-s --default-db app
pier add domain api.example.com --app api
pier add target api canary --branch main
pier add app --stage # write pier.yaml onlyBehaviour
adddeclares; the resource is created on the platform immediately unless--stageis set, in which case it is written topier.yamland created by the nextpier applyorpier deploy.addis paired withrm;setchanges an existing resource.createis used only for artifacts that are taken rather than declared (snapshots create,backups create).