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 site
Section titled “Create a site”Create a new site with leaf sites create:
leaf sites create my-cool-projectOutput:
Created my-cool-project — https://my-cool-project.leafcloud.appAutomatic name suggestions
Section titled “Automatic name suggestions”If you do not specify a name, LeafCloud provides suggestions:
leaf sites createIn interactive terminals:
Suggested names: solitary-pine golden-banyan serene-monsoonSite 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.
List existing sites
Section titled “List existing sites”To view all sites associated with your account:
leaf sites listOutput:
NAME URLmy-cool-project https://my-cool-project.leafcloud.appportfolio https://portfolio.leafcloud.appWith --json, each site is printed as a newline-delimited JSON object:
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"}}Delete a site
Section titled “Delete a site”To permanently delete a site:
leaf sites delete my-cool-projectThe CLI prompts for confirmation:
Type my-cool-project to confirm deletion: my-cool-projectDeleted site my-cool-project.In scripts and CI pipelines, bypass the confirmation prompt with --yes:
leaf sites delete my-cool-project --yesLink a project with leaf.toml
Section titled “Link a project with leaf.toml”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:
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.