|
| 1 | +# OpenNext.js CLI |
| 2 | + |
| 3 | +> Interactive CLI/TUI tool for setting up and configuring OpenNext.js projects for Cloudflare Workers |
| 4 | +
|
| 5 | +[](https://opensource.org/licenses/MIT) |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +`opennextjs-cli` is an interactive command-line tool that guides you through setting up and configuring OpenNext.js for Cloudflare Workers deployments. Similar to `create-next-app` or `next-forge`, it automates the setup process with step-by-step prompts, making it easy to get started with OpenNext.js Cloudflare. |
| 10 | + |
| 11 | +## Features |
| 12 | + |
| 13 | +- 🚀 **Interactive Setup Wizard** - Step-by-step prompts for configuration |
| 14 | +- ⚙️ **Automatic Configuration** - Generates `open-next.config.ts`, `wrangler.toml`, and more |
| 15 | +- 🔧 **Smart Defaults** - Best practices built-in |
| 16 | +- 📦 **Dependency Management** - Automatically installs required packages |
| 17 | +- 🛡️ **Type-Safe** - Full TypeScript support with Zod validation |
| 18 | +- 🎯 **Next.js Version Support** - Official support for Next.js 15.x, experimental for 16.x |
| 19 | + |
| 20 | +## Quick Start |
| 21 | + |
| 22 | +```bash |
| 23 | +# Install globally |
| 24 | +npm install -g opennextjs-cli |
| 25 | + |
| 26 | +# Initialize a new project |
| 27 | +opennextjs-cli init my-project |
| 28 | + |
| 29 | +# Add OpenNext to existing project |
| 30 | +opennextjs-cli add |
| 31 | +``` |
| 32 | + |
| 33 | +## Installation |
| 34 | + |
| 35 | +```bash |
| 36 | +npm install -g opennextjs-cli |
| 37 | +# or |
| 38 | +pnpm add -g opennextjs-cli |
| 39 | +# or |
| 40 | +yarn global add opennextjs-cli |
| 41 | +``` |
| 42 | + |
| 43 | +## Usage |
| 44 | + |
| 45 | +### Initialize New Project |
| 46 | + |
| 47 | +```bash |
| 48 | +opennextjs-cli init <project-name> |
| 49 | +``` |
| 50 | + |
| 51 | +This will: |
| 52 | +- Create a new Next.js project |
| 53 | +- Configure OpenNext.js for Cloudflare |
| 54 | +- Set up all necessary configuration files |
| 55 | +- Install dependencies |
| 56 | + |
| 57 | +### Add to Existing Project |
| 58 | + |
| 59 | +```bash |
| 60 | +cd your-existing-project |
| 61 | +opennextjs-cli add |
| 62 | +``` |
| 63 | + |
| 64 | +This will: |
| 65 | +- Detect your existing Next.js project |
| 66 | +- Add OpenNext.js configuration |
| 67 | +- Update your `package.json` with necessary scripts |
| 68 | +- Install required dependencies |
| 69 | + |
| 70 | +## Configuration Options |
| 71 | + |
| 72 | +The CLI guides you through: |
| 73 | + |
| 74 | +- **Caching Strategy**: Static Assets, R2, R2 + Durable Objects |
| 75 | +- **Database Integration**: Hyperdrive, D1, or none |
| 76 | +- **Observability**: Logs, traces, and sampling rates |
| 77 | +- **Environments**: Development and production configurations |
| 78 | +- **Next.js Version**: 15.x (official) or 16.x (experimental) |
| 79 | + |
| 80 | +## Credits |
| 81 | + |
| 82 | +This tool is built for and powered by [OpenNext.js](https://opennext.js.org/), |
| 83 | +an amazing project that makes deploying Next.js to various platforms possible. |
| 84 | + |
| 85 | +- **OpenNext.js Cloudflare**: https://github.com/opennextjs/opennextjs-cloudflare |
| 86 | +- **Official Documentation**: https://opennext.js.org/cloudflare |
| 87 | +- **Package**: `@opennextjs/cloudflare` on npm |
| 88 | + |
| 89 | +> **Note:** This is an unofficial community tool. It is not affiliated with or endorsed by the OpenNext.js team. |
| 90 | +
|
| 91 | +## License |
| 92 | + |
| 93 | +MIT License - see [LICENSE](LICENSE) file for details. |
| 94 | + |
| 95 | +## Contributing |
| 96 | + |
| 97 | +Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. |
| 98 | + |
| 99 | +## Support |
| 100 | + |
| 101 | +- 📖 [Documentation](https://opennextjs-cli.dev) (coming soon) |
| 102 | +- 🐛 [Report Issues](https://github.com/JSONbored/opennextjs-cli/issues) |
| 103 | +- 💬 [Discussions](https://github.com/JSONbored/opennextjs-cli/discussions) |
0 commit comments