You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/cloudflare/cli.mdx
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The Cloudflare adapter provides a `opennextjs-cloudflare` CLI to develop, build,
8
8
9
9
`opennextjs-cloudflare` support multiple commands, invoked via `opennextjs-cloudflare <command>`.
10
10
11
-
The currently supported commands are `build`, `populateCache`, `preview`, `deploy`, and `upload`.
11
+
The currently supported commands are `build`, `populateCache`, `preview`, `deploy`, `upload`, and `migrate`.
12
12
13
13
You can list the commands by invoking `pnpm opennextjs-cloudflare` and get help with a given command by invoking `pnpm opennextjs-cloudflare <command> --help`.
14
14
@@ -47,3 +47,30 @@ It starts by populating the remote cache and then deploys your application to Cl
47
47
### `upload` command
48
48
49
49
It starts by populating the remote cache and then uploads a version of your application to Cloudflare (via `wrangler upload`). Note that the application will not automatically be served on uploads. See [Gradual deployments](https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/) to learn more about how to serve an uploaded version.
50
+
51
+
### `migrate` command
52
+
53
+
Converts a standard Next.js project into an OpenNext-compatible one. This command automates the setup steps described in the [Get Started guide](/cloudflare/get-started#existing-nextjs-apps), including:
54
+
55
+
- Installing required dependencies (`@opennextjs/cloudflare` and `wrangler`)
The easiest way to convert an existing Next.js app is to use the `migrate` command:
16
+
17
+
```sh
18
+
npx @opennextjs/cloudflare migrate
19
+
```
20
+
21
+
This command automates all the setup steps below. If R2 is enabled on your account, it also creates an R2 bucket for caching. See the [CLI documentation](/cloudflare/cli#migrate-command) for more details.
22
+
23
+
Alternatively, you can follow the manual steps below.
0 commit comments