$npx -y skills add webflow/webflow-skills --skill webflow-cloud-commandInitialize, build, and deploy full-stack Webflow applications to Webflow Cloud hosting. Supports site-attached deploys (linked to an existing Webflow site) and project app deploys (independent project, no existing site required). Use when creating new projects, deploying existing
| 1 | # Webflow Cloud |
| 2 | |
| 3 | Initialize new projects from templates and deploy to Webflow Cloud. Supports two modes: **site-attached** (deploy to an existing Webflow site) and **project app** (deploy as an independent project, no existing site required). |
| 4 | |
| 5 | ## Instructions |
| 6 | |
| 7 | ### Step 0: Verify CLI is installed |
| 8 | |
| 9 | ```bash |
| 10 | webflow --version |
| 11 | ``` |
| 12 | |
| 13 | If the command is not found, install it: |
| 14 | |
| 15 | ```bash |
| 16 | npm install -g @webflow/webflow-cli@latest |
| 17 | # or yarn global add @webflow/webflow-cli@latest |
| 18 | # or pnpm add -g @webflow/webflow-cli@latest |
| 19 | ``` |
| 20 | |
| 21 | Then proceed to state detection. |
| 22 | |
| 23 | ### Step 1: Detect project state |
| 24 | |
| 25 | Run both checks before deciding which path to follow: |
| 26 | |
| 27 | ```bash |
| 28 | # Is this project already set up on Webflow Cloud? |
| 29 | cat webflow.json |
| 30 | |
| 31 | # Is there a git remote? |
| 32 | git remote get-url origin 2>/dev/null |
| 33 | ``` |
| 34 | |
| 35 | **Quick reference:** |
| 36 | |
| 37 | | `cloud.project_id` in `webflow.json` | git remote | → Path | |
| 38 | |---|---|---| |
| 39 | | No | — | **A** — new project | |
| 40 | | Yes | No | **B** — existing project, no git | |
| 41 | | Yes | Yes | **C** — ideal state | |
| 42 | |
| 43 | --- |
| 44 | |
| 45 | > **You are running without a TTY.** The CLI's interactive prompts only fire when `process.stdin.isTTY` is true. As an agent invoking the CLI through a subprocess, you do not have a TTY — every prompt is silently skipped, and any required value that wasn't passed as a flag triggers a hard error like `--project-name cannot be empty`. |
| 46 | > |
| 47 | > **Rule for every command in this skill:** pass all required flags explicitly. Never rely on prompts. Pass `--no-input` when the CLI accepts it to make this contract explicit. The required flag set per command: |
| 48 | > |
| 49 | > | Command | Always pass | |
| 50 | > |---|---| |
| 51 | > | `cloud init` (site-attached) | `--no-input --project-name <3–39 chars> --framework <astro\|nextjs> --mount <path> --site-id <id>` | |
| 52 | > | `cloud init --new` (app) | `--no-input --project-name <3–39 chars> --framework <astro\|nextjs> --workspace-id <id>` | |
| 53 | > | `cloud deploy` (site-attached) | `--no-input --mount <path> --environment <env> --site-id <id>` plus `--project-name` on first deploy | |
| 54 | > | `cloud deploy` (project app, first deploy) | `--no-input --mount <path> --environment <env> --workspace-id <id> --project-name <name>` | |
| 55 | > |
| 56 | > `--site-id`, `--project-id`, `--framework`, and `--workspace-id` on `cloud deploy` let agents override what's in `webflow.json` at deploy time. |
| 57 | > |
| 58 | > **Multi-workspace tokens used to be an agent-fatal hang** because workspace selection had no non-TTY path. Now pass `--workspace-id` to skip the picker. **The workspace ID is not surfaced anywhere in the Webflow dashboard UI** — users can't look it up by hand. If the agent doesn't have it, ask the user to run `webflow cloud deploy` interactively once from inside their project. The preflight prompts for workspace selection and writes `cloud.workspace_id` to `webflow.json`; from that point the agent can read it from the manifest and pass `--workspace-id` on subsequent runs. Do **not** suggest `cloud init --new` for ID discovery — on an existing project it creates a discarded scratch directory. **Exception:** in Path A2 (empty directory) it *is* safe to try `cloud init --new` without `--workspace-id` to auto-resolve a single-workspace token — see [Path A2](#path-a2-empty-directory-scaffold-from-scratch). |
| 59 | > |
| 60 | > **Site IDs are visible in the dashboard.** When `--site-id` is needed but unknown, do not ask the user for a raw `site_XXXX` value — use [`webflow sites list`](#picking-a-site-id-from-a-list) to fetch their sites and present a picker keyed by display name. Users can still check their dashboard to fetch it. |
| 61 | |
| 62 | --- |
| 63 | |
| 64 | ### Path A: No `project_id` — new project |
| 65 | |
| 66 | The project has not been deployed yet. **Before doing anything else, ask the user one question:** |
| 67 | |
| 68 | > "Do you already have source code for this project (an existing Next.js or Astro codebase), or are you starting from an empty directory and want a Webflow starter scaffold?" |
| 69 | |
| 70 | That answer chooses the branch — and they're meaningfully different: |
| 71 | |
| 72 | | User has... | Branch | Init step | |
| 73 | |---|---|---| |
| 74 | | **Existing code** (their own Next.js / Astro project) | **Path A1** | **Skip `cloud init`.** It would create a `./<project-name>/` subfolder with a hello-world scaffold inside their repo, which they don't want. | |
| 75 | | **Empty directory** or wants a Webflow starter | **Path A2** | Run `cloud init` to scaffold from `Webflow-Examples/hello-world-*`. | |
| 76 | |
| 77 | After the branch decision, also ask **site-attached vs app** (only relevant before the first deploy): |
| 78 | |
| 79 | | User says... | Mode | Outcome | |
| 80 | |---|---|---| |
| 81 | | "deploy to my Webflow site `<name>`", "site-attached", references an existing site | **Site-attached** | Project is bound to an existing Webflow site |