A modern, high-performance CLI tool for scaffolding Next.js projects, written in Go. This is a complete rewrite of create-next-app that provides faster startup times, single binary distribution, and feature parity with the original TypeScript implementation.
- Single Binary Distribution - No Node.js required to run the CLI
- Faster Startup - Native compilation means instant execution
- Cross-Platform - Compile once for Windows, macOS, and Linux
- Built-in Concurrency - Leverage Go's goroutines for parallel operations
- Template Embedding - All templates bundled in the binary using
embeddirective
- β¨ Interactive or Non-Interactive - Use prompts or CLI flags
- π¨ App Router Only - Focused on Next.js App Router with/without Tailwind
- π¦ Smart Package Manager Detection - Auto-detects npm, pnpm, yarn, or bun
- π§ Flexible Configuration - TypeScript, ESLint, Biome, React Compiler support
- π GitHub Examples - Download official examples or custom repositories
- πΎ Preference Persistence - Save your choices for future projects
- π Future Extensibility - Planned support for database integration, ORM, and more
# npm
npx create-better-next-app@latest
# pnpm
pnpm dlx create-better-next-app@latest
# bun
bunx create-better-next-app@latest
# yarn
yarn create better-next-appgo install github.com/yeasin2002/better-next-app@latestDownload the latest binary for your platform from the releases page.
git clone https://github.com/yeasin2002/better-next-app.git
cd better-next-app
task buildnpx create better-next-app@latestOn installation, you'll see the following prompts:
What is your project named? my-app
Would you like to use the recommended Next.js defaults?
Yes, use recommended defaults - TypeScript, ESLint, Tailwind CSS, App Router, Turbopack
No, reuse previous settings
No, customize settings - Choose your own preferences
If you choose to customize settings, you'll see:
Would you like to use TypeScript? No / Yes
Which linter would you like to use? ESLint / Biome / None
Would you like to use React Compiler? No / Yes
Would you like to use Tailwind CSS? No / Yes
Would you like your code inside a `src/` directory? No / Yes
Would you like to customize the import alias (`@/*` by default)? No / Yes
What import alias would you like configured? @/*
better-next-app my-app --typescript --tailwind --eslint# Official Next.js example
better-next-app my-app --example with-tailwindcss
# Custom GitHub repository
better-next-app my-app --example https://github.com/user/repo--typescript/--javascript- Language choice--tailwind/--no-tailwind- Include Tailwind CSS--src-dir/--no-src-dir- Usesrc/directory--import-alias <string>- Custom import alias (default:@/*)--empty- Minimal template with no boilerplate
Note: This CLI only supports Next.js App Router. Pages Router is not supported.
--eslint- Use ESLint--biome- Use Biome--no-lint- Skip linter setup--react-compiler/--no-react-compiler- Enable React Compiler
--turbo- Use Turbopack (default)--webpack- Use Webpack--rspack- Use Rspack
--use-npm- Use npm--use-pnpm- Use pnpm--use-yarn- Use Yarn--use-bun- Use Bun--skip-install- Skip dependency installation
--skip-git- Skip git initialization
--example <name-or-url>- Use an example template--example-path <path>- Path within repository (for monorepos)
--yes- Skip all prompts and use defaults--reset-preferences- Clear saved preferences
better-next-app/
βββ main.go # Entry point with signal handlers
βββ cmd/ # Cobra command definitions
βββ internal/ # Business logic (private)
β βββ config/ # Configuration management
β βββ prompt/ # Interactive prompts (Huh)
β βββ validate/ # Validation logic
β βββ template/ # Template installation
β βββ example/ # GitHub example downloading
β βββ install/ # Post-installation tasks
β βββ util/ # Shared utilities
βββ templates/ # Embedded template files
- Cobra - CLI framework
- Viper - Configuration management
- Huh - Interactive prompts
- Lipgloss - Terminal styling
- Doublestar - File globbing
- Go 1.21 or higher
- Task - Task runner (optional but recommended)
# Clone the repository
git clone https://github.com/yeasin2002/better-next-app.git
cd better-next-app
# Setup development environment (installs tools and git hooks)
task setup
# Or manually
go mod download# Run locally
task dev
# Build for current platform
task build
# Build for all platforms
task build:all
# Run tests
task test
# Run all checks (format, lint, test)
task check
# Test release locally (no git tag required)
task release:snapshot# Setup NPM publishing (first time)
task npm:setup
# Test NPM package locally
task npm:test
# Publish to NPM manually
task npm:publishDocumentation:
- Complete Guide: docs/npm-complete-guide.md
- Token Generation: docs/npm-token-guide.md
This project uses GoReleaser for automated releases:
# Create and push a tag
git tag -a v0.1.0 -m "Release v0.1.0"
git push origin v0.1.0
# GitHub Actions will automatically build and releaseSee docs/releasing.md for detailed release instructions.
- PROJECT-GUIDE.md - Comprehensive implementation guide
- docs/releasing.md - Release process and versioning
- docs/npm-complete-guide.md - Complete NPM publishing guide
- docs/npm-token-guide.md - NPM token generation guide
- Steering Rules - Development guidelines and patterns
Contributions are welcome! Please read the PROJECT-GUIDE.md for architecture details and implementation guidelines.
MIT
Future enhancements planned:
- Database integration options
- ORM setup (Prisma, Drizzle, etc.)
- Authentication scaffolding
- Additional tooling integrations
This project is inspired by and maintains feature parity with create-next-app from the Next.js team, with a focus on App Router and modern Next.js development.