cloud_register()
Register a local project on Framework Cloud and link it.
Creates the Cloud project for a folder that is already a Framework
project (one you adopted with adopt() or brought up to date with
upgrade()) and links the folder to it, in one step:
- Sends
.framework/spec.jsonas it is, with the name, slug, and description, in one request (POST /api/v1/projects). Framework Cloud stores the spec as the project's only layer, so the Cloud project has exactly this folder's name, type, language, folders, and tools, and none of your defaults. An adopted project is marked as adopted. - Writes the project token and server to
.env(FW_PROJECT_TOKEN,FW_CLOUD_URL), making sure git ignores.envfirst. An empty or differentFW_CLOUD_URLis replaced with the server that issued the token.
Usage
cloud_register(
path: str | Path = '.',
name: str | None = None,
slug: str | None = None,
description: str | None = None,
dry_run: bool = False,
include_private: bool = False,
) -> dict[str, Any]
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| path | str | Path | '.' |
The project folder. |
| name | str | None | None |
The Cloud project's name. Default: the spec's name, then the folder's name. |
| slug | str | None | None |
The project's slug. Default: made from the name (lowercase letters, digits, and hyphens). |
| description | str | None | None |
An optional description. |
| dry_run | bool | False |
Print the request without sending it. |
| include_private | bool | False |
A project whose path has a folder named |
Value
slug, url, type, adopted, created, linked, and
spec_changed; with dry_run, the request body.
Details
A project that already has a token in .env is left as it is. When you
already have a project with the slug, an interactive session offers to
link this folder to that project instead, and nothing is created. A slug
held by a project in your Trash cannot be reused. A self-hosted server from
before the spec API builds the project from your defaults; the spec is
then sent separately (PUT /api/v1/project/spec). This is
fw project link --create.
Raises
FrameworkError: When the folder is not a Framework project or has no.framework/spec.json, when git tracks.env, or when the project is in a private folder.CloudError: When you are not logged in, or the server refuses the project.