@@ -5,6 +5,7 @@ import "github.com/urfave/cli/v2"
55func buildCommands () []* cli.Command {
66 return []* cli.Command {
77 buildInitCommand (),
8+ buildPagesCommand (),
89 buildDocsCommand (),
910 buildMigrateCommand (),
1011 buildPublishCommand (),
@@ -16,6 +17,61 @@ func buildCommands() []*cli.Command {
1617 }
1718}
1819
20+ func buildPagesCommand () * cli.Command {
21+ return & cli.Command {
22+ Name : "pages" ,
23+ Usage : "Inspect, create, and type Webflow pages" ,
24+ Subcommands : []* cli.Command {
25+ {
26+ Name : "list" ,
27+ Usage : "List static Webflow pages for the current site" ,
28+ Flags : []cli.Flag {& cli.BoolFlag {Name : "json" , Usage : "Print pages as JSON" }},
29+ Action : pagesListMode ,
30+ },
31+ {
32+ Name : "create" ,
33+ Usage : "Create a new static Webflow page" ,
34+ Flags : []cli.Flag {
35+ & cli.StringFlag {Name : "name" , Usage : "Page title to create" },
36+ & cli.StringFlag {Name : "slug" , Usage : "Page slug (defaults to a slugified title)" },
37+ & cli.BoolFlag {Name : "json" , Usage : "Print the created page as JSON" },
38+ & cli.BoolFlag {Name : "types" , Value : true , Usage : "Regenerate local page types after creating the page" },
39+ & cli.StringFlag {Name : "output" , Value : "src/generated/wfkit-pages.ts" , Usage : "Output path for generated page types when --types is enabled" },
40+ },
41+ Action : pagesCreateMode ,
42+ },
43+ {
44+ Name : "types" ,
45+ Usage : "Generate typed page names from the current Webflow site" ,
46+ Flags : []cli.Flag {
47+ & cli.StringFlag {Name : "output" , Value : "src/generated/wfkit-pages.ts" , Usage : "Output path for generated page types" },
48+ },
49+ Action : pagesTypesMode ,
50+ },
51+ {
52+ Name : "inspect" ,
53+ Usage : "Inspect one Webflow page by slug or page id" ,
54+ Flags : []cli.Flag {
55+ & cli.StringFlag {Name : "slug" , Usage : "Page slug to inspect" },
56+ & cli.StringFlag {Name : "id" , Usage : "Page id to inspect" },
57+ & cli.BoolFlag {Name : "json" , Usage : "Print the page as JSON" },
58+ },
59+ Action : pagesInspectMode ,
60+ },
61+ {
62+ Name : "delete" ,
63+ Usage : "Delete one Webflow page by slug or page id" ,
64+ Flags : []cli.Flag {
65+ & cli.StringFlag {Name : "slug" , Usage : "Page slug to delete" },
66+ & cli.StringFlag {Name : "id" , Usage : "Page id to delete" },
67+ & cli.BoolFlag {Name : "yes" , Usage : "Delete without an extra safety prompt" },
68+ },
69+ Action : pagesDeleteMode ,
70+ },
71+ },
72+ }
73+ }
74+
1975func buildInitCommand () * cli.Command {
2076 return & cli.Command {
2177 Name : "init" ,
@@ -61,6 +117,7 @@ func buildMigrateCommand() *cli.Command {
61117 & cli.BoolFlag {Name : "publish" , Usage : "After writing local files, build assets, push the artifact branch, and update Webflow" },
62118 & cli.StringFlag {Name : "custom-commit" , Value : "Migrate Webflow page code via wfkit" , Usage : "Custom commit message" },
63119 & cli.StringFlag {Name : "delivery" , Value : "cdn" , Usage : "Delivery mode for --publish: cdn or inline" },
120+ & cli.StringFlag {Name : "target" , Value : "staging" , Usage : "Webflow publish targets for --publish: staging, production, or all" },
64121 & cli.StringFlag {Name : "asset-branch" , Value : "wfkit-dist" , Usage : "Git branch used for published build artifacts and jsDelivr URLs" },
65122 & cli.StringFlag {Name : "branch" , Hidden : true , Usage : "Deprecated alias for --asset-branch" },
66123 & cli.StringFlag {Name : "build-dir" , Value : "dist/assets" , Usage : "Build directory" },
@@ -83,6 +140,7 @@ func buildPublishCommand() *cli.Command {
83140 & cli.StringFlag {Name : "dev-host" , Value : "localhost" , Usage : "Local dev server host (dev mode)" },
84141 & cli.StringFlag {Name : "custom-commit" , Value : "Auto publish from wfkit tool" , Usage : "Custom commit message" },
85142 & cli.StringFlag {Name : "delivery" , Value : "cdn" , Usage : "Production delivery mode: cdn or inline" },
143+ & cli.StringFlag {Name : "target" , Value : "staging" , Usage : "Webflow publish targets: staging, production, or all" },
86144 & cli.StringFlag {Name : "asset-branch" , Value : "wfkit-dist" , Usage : "Git branch used for published build artifacts and jsDelivr URLs" },
87145 & cli.StringFlag {Name : "branch" , Hidden : true , Usage : "Deprecated alias for --asset-branch" },
88146 & cli.StringFlag {Name : "build-dir" , Value : "dist/assets" , Usage : "Build directory" },
0 commit comments