Skip to content

Sites and names

In LeafCloud, every static site is a named resource that corresponds to a subdomain (such as my-site.leafcloud.app).

Create a new site with leaf sites create:

Terminal window
leaf sites create my-cool-project

Output:

Created my-cool-project — https://my-cool-project.leafcloud.app

If you do not specify a name, LeafCloud provides suggestions:

Terminal window
leaf sites create

In interactive terminals:

Suggested names:
solitary-pine
golden-banyan
serene-monsoon
Site name [solitary-pine]:

Press Enter to accept the first suggestion, or type a custom name. In non-interactive environments (or when stdin is not a terminal), the first suggested name is used automatically.

To view all sites associated with your account:

Terminal window
leaf sites list

Output:

NAME URL
my-cool-project https://my-cool-project.leafcloud.app
portfolio https://portfolio.leafcloud.app

With --json, each site is printed as a newline-delimited JSON object:

Terminal window
leaf sites list --json
{"schema":1,"type":"sites","data":{"name":"my-cool-project","url":"https://my-cool-project.leafcloud.app"}}
{"schema":1,"type":"sites","data":{"name":"portfolio","url":"https://portfolio.leafcloud.app"}}

To permanently delete a site:

Terminal window
leaf sites delete my-cool-project

The CLI prompts for confirmation:

Type my-cool-project to confirm deletion: my-cool-project
Deleted site my-cool-project.

In scripts and CI pipelines, bypass the confirmation prompt with --yes:

Terminal window
leaf sites delete my-cool-project --yes

When you have multiple sites in your account, link a local project directory to its target site by creating a leaf.toml file at the root of your project:

leaf.toml
site = "my-cool-project"

If your account contains multiple sites and no site is specified in leaf.toml, leaf deploy will prompt you to configure it:

Set site = "name" in leaf.toml to choose a deployment target.

If your account only has a single site, leaf deploy targets that site automatically without requiring a leaf.toml.