Skip to Content
CLI & APICommand reference

stackblaze projects

Manage projects

Usage: stackblaze projects|project [options] [command]

Manage projects

Options:
  -h, --help                       Print help

Commands:
  list [options]                   List projects and their environments
  create [options] [name]          Create a new project (name positionally or
                                   via -p)
  delete [options] [name]          Delete a project and all its apps (default:
                                   the linked project)
  rename [options] [display-name]  Set the name people see for a project (its
                                   ID, URLs and commands do not change);
                                   --clear removes it
  iac [options] [state]            Turn Infrastructure as Code on or off for
                                   the project (on | off | status)
  help [command]                   Print this message or the help of the given
                                   subcommand(s)

projects list

Usage: stackblaze projects list [options]

List projects and their environments

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

List the projects and their environments:

stackblaze projects list
┌───────────────────────┬────────────────────────┬────────┐
│ Project               │ Environments           │ Domain │
├───────────────────────┼────────────────────────┼────────┤
│ github-demo-587h      │ dev, stage, production │ —      │
├───────────────────────┼────────────────────────┼────────┤
…
├───────────────────────┼────────────────────────┼────────┤
│ github-demo-gv35      │ dev, stage, production │ —      │
├───────────────────────┼────────────────────────┼────────┤
│ github-demo-kpw0      │ dev, stage, production │ —      │
├───────────────────────┼────────────────────────┼────────┤
…
└───────────────────────┴────────────────────────┴────────┘

In a script, pick one project out of the --json list, e.g. to see whether preview environments (reviewapps) are on:

stackblaze projects list --json | jq '.[] | select(.name=="github-demo-gv35")'
{
  "name": "github-demo-gv35",
  "displayName": null,
  "phases": [
    "dev",
    "stage",
    "production"
  ],
  "reviewapps": false,
  "strategy": "git"
}

projects create

Usage: stackblaze projects create [options] [name]

Create a new project (name positionally or via -p)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --domain <host>        Wildcard domain for apps
  --phases <names...>    Environments to create (default: production)
  --region <slug>        Region to create the project in, from `stackblaze
                         regions list` (default: the workspace's preferred
                         region; asked when run interactively)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

--region is checked against the regions open for new projects (exit 1 with
the list when it is not one of them). Without it, an interactive run offers
the list — Enter keeps the default — and a script (or -y) leaves placement
to the server: the workspace's preferred region.

Examples:
  $ stackblaze regions list
  $ stackblaze projects create shop --region us-west-1
  $ stackblaze projects create shop -y          # no prompt, default region

projects delete

Usage: stackblaze projects delete [options] [name]

Delete a project and all its apps (default: the linked project)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -y, --yes              Skip confirmation prompt (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

projects rename

Usage: stackblaze projects rename [options] [display-name]

Set the name people see for a project (its ID, URLs and commands do not
change); --clear removes it

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --clear                Remove the display name (the project ID is shown
                         again) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Only the display name changes (1 to 60 characters, one line): the project
ID used by -p, namespaces and URLs stays as it is and nothing is deployed.
Uses the linked project unless -p is passed.

Examples:
  $ stackblaze projects rename "Web shop" -p shop
  $ stackblaze projects rename --clear -p shop

Example

Give a project a name people recognize. Only the display name changes; -p, URLs and environments keep using the ID:

stackblaze projects rename "Shop (docs demo)" -p github-demo-cw8z
stackblaze projects list
OK Project github-demo-cw8z is now shown as "Shop (docs demo)"
Its ID stays github-demo-cw8z: commands, URLs and environments are unchanged.
┌───────────────────────┬──────────────────┬────────────────────────┬────────┐
│ Project               │ Name             │ Environments           │ Domain │
├───────────────────────┼──────────────────┼────────────────────────┼────────┤
…
├───────────────────────┼──────────────────┼────────────────────────┼────────┤
│ github-demo-cw8z      │ Shop (docs demo) │ dev, stage, production │ —      │
├───────────────────────┼──────────────────┼────────────────────────┼────────┤
…

Remove it again with --clear:

stackblaze projects rename --clear -p github-demo-cw8z
OK Project github-demo-cw8z has no display name any more (its ID is shown)
Its ID stays github-demo-cw8z: commands, URLs and environments are unchanged.

projects iac

Usage: stackblaze projects iac [options] [state]

Turn Infrastructure as Code on or off for the project (on | off | status)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

apply and plan are refused while IaC is off, and projects created with
`projects create` start with it off. Uses the linked project unless -p is
passed. Same switch as Project Settings → General → Infrastructure as Code.

Examples:
  $ stackblaze projects iac              # show
  $ stackblaze projects iac on -p demo
  $ stackblaze projects iac off

Example

Check whether a project accepts plan and apply, turn Infrastructure as Code on, and later back off:

stackblaze projects iac -p github-demo-cw8z
stackblaze projects iac on -p github-demo-cw8z
Infrastructure as Code is off for project github-demo-cw8z
apply/plan need it: stackblaze projects iac on -p github-demo-cw8z
OK Infrastructure as Code turned on for project github-demo-cw8z
`stackblaze plan` and `stackblaze apply` can now change project github-demo-cw8z.
stackblaze projects iac off -p github-demo-cw8z
stackblaze projects iac -p github-demo-cw8z --json
OK Infrastructure as Code turned off for project github-demo-cw8z
apply and plan are refused for it until IaC is on again; export still works.
{
  "pipeline": "github-demo-cw8z",
  "iacEnabled": false
}

On this page