One-shot Next.js project initialization with GitHub and Vercel deployment.
/init-nextjs <project-name> # Normal mode (with confirmations)
/init-nextjs <project-name> --yolo # YOLO mode (skip all confirmations)| Step | Action |
|---|---|
| 1 | Creates Next.js app with TypeScript + Tailwind + App Router |
| 2 | Creates public GitHub repository and pushes code |
| 3 | Deploys to Vercel (preview + production) |
Install and authenticate these CLIs before first use:
# GitHub CLI
brew install gh
gh auth login
# Vercel CLI
npm i -g vercel
vercel login/init-nextjs my-saas-appOutput:
Project initialized successfully!
Local: ./my-saas-app
GitHub: https://github.com/<username>/my-saas-app
Vercel: https://my-saas-app-xxx.vercel.app
Next steps:
cd my-saas-app
npm run dev
If you prefer to run each step manually, copy and paste these commands:
npx create-next-app@latest my-project --typescript --tailwind --app --eslint --src-dir --import-alias "@/*" --use-npmcd my-projectgh repo create my-project --public --source=. --pushvercel --yesvercel --prod --yesnpm run devOpen http://localhost:3000 in your browser.
- Framework: Next.js 16 (App Router + Turbopack)
- Language: TypeScript
- Styling: Tailwind CSS
- Linting: ESLint
- Structure:
src/directory with@/*import alias
Edit ~/.claude/commands/init-nextjs.md to:
- Change default options (remove Tailwind, add different flags)
- Switch to private repos (
--privateinstead of--public) - Skip Vercel deployment
- Add additional setup steps (shadcn/ui, testing, etc.)
| Error | Solution |
|---|---|
gh: command not found |
Install GitHub CLI: brew install gh |
gh auth fails |
Run gh auth login |
vercel: command not found |
Install Vercel CLI: npm i -g vercel |
vercel auth fails |
Run vercel login |
| Project name exists | Choose a different name or delete existing |