ββββ ββββ ββββββ ββββββββββββββββββ βββββββ βββββββββββββββ
βββββ βββββββββββββββββββββββββββββββ ββββββββ βββββββββββββββ
βββββββββββββββββββ βββ βββ βββββββββββββββ ββββββ βββ
βββββββββββββββββββ βββ βββ ββββββββββββββββββββββ βββ
βββ βββ ββββββ βββ βββ βββ ββββββ βββββββββ βββ
βββ ββββββ βββ βββ βββ ββββββ ββββββββ βββA CLI tool for scaffolding Next.js projects the way I like 'em.
Warning
I am no longer maintaining this project. I've trying to expand out from the NextJS ecosystem, and have been learning tons of new tools and technologies! There's so many fun project out there beyond this; go explore!
- Wickedly Fast Setup - Under 30 seconds to a fully wired Next.js starter
- Minimal Choices - Three streamlined prompts: backend setup, database provider, and tooling preferences
- Opinionated Defaults - Pre-configured with sensible defaults and best practices
- Backend Bundles - Choose "DB + Drizzle + BetterAuth" for full-stack or "None" for frontend-only
- Zero Configuration - Strict linting, Prettier, pre-commit hooks, and CI rules included
- Type-Safe Environment - Zod-validated env variables that fail fast on missing config
- Ready for Deployment - Tailwind, VSCode settings, and production optimizations included
I've probably started and abandoned a dozen Next.js projects. The commonality between them is that the first hour or two of a given project is spent setting up the same things over and over again. This tool aims to automate that setup process with the components and configurations I prefer, so I can focus on building features instead of boilerplate.
Also, because enforcing harsh linting rules on hackathon teammates is more justafiable when "it came installed like that".
npx matt-init@latest [project-name] [options]npx matt-init@latestThis will prompt you for:
- Project name - What to call your app
- Backend setup - Choose from:
DB + Drizzle + BetterAuth- Full-stack with database, ORM, and authenticationSupabase- (coming soon)None- Frontend-only
- Database provider - If you chose the full-stack option:
Turso (SQLite)- Edge database (implemented)Neon (Postgres)- (coming soon)Docker Postgres- (coming soon)
- Nix flake - Optional reproducible dev environment
- Install dependencies - Run
pnpm installautomatically - VS Code settings - Setup workspace settings and recommended extensions
- Git repository - Initialize git with initial commit
matt-init [project-name] [options]
Options:
--no-git Skip git initialization
--no-install Skip package installation
--no-nix Skip Nix flake for environment management
--no-vscode Skip VS Code settings setup
-y, --default Use defaults, skip prompts
--ci Run in CI mode (non-interactive, test mode)
-V, --version Display version number
-h, --help Display help# Create a new project with prompts (recommended)
npx matt-init@latest my-awesome-app
# Create with defaults (frontend-only, no prompts)
npx matt-init@latest my-app --default
# Create without git and dependency installation
npx matt-init@latest my-app --no-git --no-install
# Create without Nix support (Nix is disabled by default)
npx matt-init@latest my-app --no-nixEvery generated project includes:
- Next.js 15 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS framework
- ESLint - Code linting with @antfu/eslint-config
- Zod-validated environment variables - Type-safe env configuration
- VSCode settings - Optimized workspace configuration
- VSCode extensions - Recommended extensions for the stack
- Full-Stack Backend - Turso database + Drizzle ORM + BetterAuth authentication
- Supabase Integration - (coming soon)
- Nix Flake - Reproducible development environment
Generated projects roughly follow this structure:
my-project/
βββ src/
β βββ app/
β β βββ globals.css
β β βββ layout.tsx
β β βββ page.tsx
β βββ components/
β β βββ matt-init-banner.tsx
β βββ lib/
β βββ env.ts
β βββ try-parse-env.ts
βββ .vscode/ # (if VSCode setup chosen)
β βββ extensions.json
β βββ settings.json
βββ flake.nix # (if Nix enabled)
βββ drizzle.config.ts # (if backend setup chosen)
βββ .env # (if backend setup chosen)
βββ .env.example
βββ eslint.config.mjs
βββ next.config.ts
βββ package.json
βββ postcss.config.mjs
βββ tsconfig.jsonCore (Every Project):
- ESLint + Prettier configuration
- Custom Next.js app with banner
- Zod-validated environment variables
- VS Code workspace settings
- Tailwind CSS setup
- TypeScript configuration
Optional (Behind Flags or Prompts):
- Full-stack backend (Turso + Drizzle + BetterAuth)
- Nix development environment (--nix flag)
- Git repository initialization
- Dependency installation
- Docker Postgres support
- Custom README generation
- Improved CI/CD templates
Backend Options:
- Supabase integration
- Neon (Postgres) support
Future Flags:
- --shadcn for UI components
- --auth-only for auth without ORM
- Nix
Feel free to go install all the project dependencies manually if you don't want to use Nix, but I ain't telling you how to do that. This is a Nix-first project baby.
# Clone the repository
git clone <repository-url>
cd matt-init
# Switch to the development shell
nix develop
# Install dependencies
pnpm install
# Run the tool in development mode!
pnpm dev:clipnpm build:cli- Compile CLI TypeScript to JavaScriptpnpm dev:cli- Run CLI in development mode with ts-nodepnpm test:cli- Test the CLI by creating a test projectpnpm lint:cli- Run ESLint on CLIpnpm --filter ./cli lint:fix- Fix CLI ESLint issues automatically
MIT
- Thanks to @antfu for the ESLint config
- Shoutout to @w3cj from the Syntax team for general
project setup advice, and the
try-parse-env.tsscript - Quick mention to create-t3-app for pointing me in the right direction architecture-wise