@webflow/webflow-cli 2.3.0 → 2.4.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,15 +37,48 @@ webflow auth login --force # Re-authenticate even if credentials exist
37
37
 
38
38
  ## Sites
39
39
 
40
- Manage Webflow sites from the CLI.
40
+ Manage Webflow sites from the CLI, and keep a project directory's local source files (page bodies, styles, variables) in sync with the Designer.
41
41
 
42
42
  ```shell
43
43
  webflow sites list # List all sites in your workspace
44
44
  webflow sites get <siteId> # Get details for a specific site
45
45
  webflow sites domains --site <siteId> # List custom domains for a site
46
46
  webflow sites publish --site <siteId> # Publish a site
47
+ webflow sites init # Bind this project to an existing site, or create a new one
48
+ webflow sites init --site-id <siteId> # Bind without the interactive picker (CI/scripted setup)
49
+ webflow sites init --create --name "My Site" # Create a new site and bind to it
50
+ webflow sites pull # Write the site's source files locally
51
+ webflow sites push # Push local changes back to the site
52
+ webflow sites push --dry-run # Preview what push would send
47
53
  ```
48
54
 
55
+ > `sites init`, `sites pull` and `sites push` are in beta and ship only in `@next` builds (`npm i -g @webflow/webflow-cli@next`). They aren't registered in the stable release yet.
56
+
57
+ By default, pages materialize under `src/pages/<slug>.tsw` (the default page as `index.tsw`), components under `src/components/<name>.tsw`, and design-system theme modules under `src/theme/`. Styles and variables have no framework convention to follow, so they land at `site/styles/` and `site/variables/`. A `.webflow/wfs/` lockfile (one file per tracked path, plus an `index.json`) records which site the project is synced with and each file's last-synced hash, so `push` can detect conflicting Designer edits.
58
+
59
+ Set `site.layout` in `webflow.json` to use a different framework's layout:
60
+
61
+ ```json
62
+ {
63
+ "siteId": "...",
64
+ "site": {
65
+ "layout": { "preset": "nextjs" }
66
+ }
67
+ }
68
+ ```
69
+
70
+ | Preset | Shape |
71
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
72
+ | `library`/`astro` | Flat `src/pages/<slug>.tsw` + `src/components/<name>.tsw` (the default) |
73
+ | `nextjs` | Next.js App Router — one folder per route segment, nested `page.tsw` (`src/app/<slug>/page.tsw`, home at `src/app/page.tsw`) |
74
+ | `nextjs-pages` | Next.js Pages Router — flat `pages/<slug>.tsw` |
75
+
76
+ A page nested under a Designer Page Folder (e.g. `/blog/en/about`) mirrors that subpath locally (`<pagesRoot>/blog/en/about.tsw`, or `.../blog/en/about/page.tsw` under the `nextjs` shape). A component's Designer group maps to a local subfolder under `componentsRoot` — `src/components/ui/Card.tsw` and a flat `src/components/Card.tsw` are distinct components. Explicit `pagesRoot`/`componentsRoot`/`pagesShape` (`"flat"` or `"nested"`) override a preset's defaults, or can be set without a preset at all. The theme root isn't configured directly — it's derived as a sibling of whatever `pagesRoot` and `componentsRoot` have in common, so `src/pages` + `src/components` puts theme modules at `src/theme`.
77
+
78
+ Pulled `.tsw` files are formatted with Prettier, honoring the project's own Prettier config when it has one.
79
+
80
+ A project is bound to one site: the lockfile records which site it was pulled from, and both commands refuse to run against a different one. Use `sites pull --site-id <other> --reset` to repoint a project at another site — it discards the existing sync state and pulls from scratch.
81
+
49
82
  ### `sites list` options
50
83
 
51
84
  | Flag | Description |
@@ -62,6 +95,34 @@ webflow sites publish --site <siteId> # Publish a site
62
95
  | `--page <pageId>` | Publish a single page instead of the full site |
63
96
  | `--dry-run` | Preview what would be published without triggering a build |
64
97
 
98
+ ### `sites init` options
99
+
100
+ | Flag | Description |
101
+ | --------------------- | --------------------------------------------------------------- |
102
+ | `--site-id <siteId>` | Skip the interactive picker and bind to this site ID |
103
+ | `--create` | Create a new Webflow site instead of binding to an existing one |
104
+ | `--name <name>` | Name for the new site (implies `--create`; skips the prompt) |
105
+ | `--api-token <token>` | Use this token instead of the stored session |
106
+
107
+ ### `sites pull` options
108
+
109
+ | Flag | Description |
110
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
111
+ | `--site-id <siteId>` | Pull this site instead of the one in `webflow.json`, without rebinding the project. Needs `--reset` if the project is already synced with another site |
112
+ | `--force` | Overwrite local files that changed both locally and in the Designer since the last sync (they're left alone by default) |
113
+ | `--reset` | Discard the existing local sync state and pull from scratch |
114
+ | `--json` | Output the pulled manifest and file list as JSON |
115
+ | `--api-token <token>` | Use this token instead of the stored session |
116
+
117
+ ### `sites push` options
118
+
119
+ | Flag | Description |
120
+ | --------------------- | ---------------------------------------------------------------------------------------------------- |
121
+ | `--dry-run` | List the files that would be pushed without sending them |
122
+ | `--force` | Skip upstream conflict checks and re-push every tracked file, not just the ones that changed locally |
123
+ | `--json` | Output the push results as JSON |
124
+ | `--api-token <token>` | Use this token instead of the stored session |
125
+
65
126
  ---
66
127
 
67
128
  ## CMS
@@ -0,0 +1,4 @@
1
+ {
2
+ "recommendations": ["astro-build.astro-vscode"],
3
+ "unwantedRecommendations": []
4
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "command": "./node_modules/.bin/astro dev",
6
+ "name": "Development server",
7
+ "request": "launch",
8
+ "type": "node-terminal"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "files.associations": {
3
+ "wrangler.json": "jsonc"
4
+ }
5
+ }
@@ -0,0 +1,2 @@
1
+ _worker.js
2
+ _routes.json
@@ -0,0 +1,5 @@
1
+ {
2
+ "files.associations": {
3
+ "wrangler.json": "jsonc"
4
+ }
5
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "extends": [
3
+ "eslint:recommended",
4
+ "plugin:@typescript-eslint/eslint-recommended",
5
+ "plugin:@typescript-eslint/recommended"
6
+ ],
7
+ "parser": "@typescript-eslint/parser",
8
+ "parserOptions": {
9
+ "project": "./tsconfig.json"
10
+ },
11
+ "plugins": ["@typescript-eslint", "promise"],
12
+ "rules": {
13
+ "@typescript-eslint/explicit-function-return-type": "off",
14
+ "@typescript-eslint/no-explicit-any": "off",
15
+ "@typescript-eslint/no-floating-promises": "error",
16
+ "@typescript-eslint/no-misused-promises": [
17
+ "error",
18
+ { "checksVoidReturn": false }
19
+ ],
20
+ "@typescript-eslint/no-unused-vars": "error",
21
+ "no-async-promise-executor": "error",
22
+ "require-await": "error",
23
+ "promise/catch-or-return": "error"
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "extends": [
3
+ "eslint:recommended",
4
+ "plugin:@typescript-eslint/eslint-recommended",
5
+ "plugin:@typescript-eslint/recommended"
6
+ ],
7
+ "parser": "@typescript-eslint/parser",
8
+ "parserOptions": {
9
+ "project": "./tsconfig.json"
10
+ },
11
+ "plugins": ["@typescript-eslint", "promise"],
12
+ "rules": {
13
+ "@typescript-eslint/explicit-function-return-type": "off",
14
+ "@typescript-eslint/no-explicit-any": "off",
15
+ "@typescript-eslint/no-floating-promises": "error",
16
+ "@typescript-eslint/no-misused-promises": [
17
+ "error",
18
+ { "checksVoidReturn": false }
19
+ ],
20
+ "@typescript-eslint/no-unused-vars": "error",
21
+ "no-async-promise-executor": "error",
22
+ "require-await": "error",
23
+ "promise/catch-or-return": "error"
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "extends": [
3
+ "eslint:recommended",
4
+ "plugin:@typescript-eslint/eslint-recommended",
5
+ "plugin:@typescript-eslint/recommended"
6
+ ],
7
+ "parser": "@typescript-eslint/parser",
8
+ "parserOptions": {
9
+ "project": "./tsconfig.json"
10
+ },
11
+ "plugins": ["@typescript-eslint", "promise"],
12
+ "rules": {
13
+ "@typescript-eslint/explicit-function-return-type": "off",
14
+ "@typescript-eslint/no-explicit-any": "off",
15
+ "@typescript-eslint/no-floating-promises": "error",
16
+ "@typescript-eslint/no-misused-promises": [
17
+ "error",
18
+ { "checksVoidReturn": false }
19
+ ],
20
+ "@typescript-eslint/no-unused-vars": "error",
21
+ "no-async-promise-executor": "error",
22
+ "require-await": "error",
23
+ "promise/catch-or-return": "error"
24
+ }
25
+ }