Skip to main content

cubby init

Scaffold a new Cubby app with Next.js and Prisma preconfigured for the platform.

Usage

cubby init [name]

Arguments

ArgumentDescriptionDefault
nameApp name or . for current directorymy-cubby-app

Examples

# Create app in new directory
cubby init myapp

# Initialize in current directory
cubby init .

# Create with default name
cubby init

What Gets Created

The scaffold includes a complete Next.js 16 + Prisma setup:
myapp/
├── app/
│   ├── api/
│   │   └── health/
│   │       └── route.ts       # Health check endpoint
│   ├── page.tsx               # Home page
│   ├── layout.tsx             # Root layout
│   └── globals.css            # Global styles
├── lib/
│   └── db.ts                  # Prisma client singleton
├── prisma/
│   └── schema.prisma          # Database schema
├── public/
│   ├── manifest.json          # PWA manifest
│   └── favicon.ico
├── .env.example               # Environment template
├── .gitignore
├── cubby.yaml                 # Platform configuration
├── CUBBY.md                   # AI context file
├── next.config.ts             # Next.js config (standalone output)
├── package.json
└── tsconfig.json

App Name Rules

App names must be DNS-safe:
  • 3-30 characters
  • Lowercase letters, numbers, and hyphens only
  • Must start and end with a letter or number
Names are automatically slugified:
  • My App becomes my-app
  • app_name becomes app-name

After Initialization

cd myapp
npm install
cubby dev
This starts local development with:
  • Hot reload on code changes
  • Local Postgres database
  • Automatic schema sync

The CUBBY.md File

Every scaffolded app includes a CUBBY.md file that provides context for AI coding assistants. It documents:
  • Platform constraints
  • API route patterns
  • Database access patterns
  • Authentication (handled by Cubby SSO)
  • What NOT to do
When using Claude or other AI tools, this file helps them understand Cubby’s conventions.

Customizing the Schema

Edit prisma/schema.prisma to define your data models:
model Task {
  id        String   @id @default(cuid())
  title     String
  completed Boolean  @default(false)
  createdAt DateTime @default(now())
}
Then run:
npx prisma db push
npx prisma generate
Or just run cubby dev which handles this automatically.

Next Steps

After cubby init:
  1. Install dependencies: npm install
  2. Start development: cubby dev
  3. Edit your schema: prisma/schema.prisma
  4. Build your app: Add pages in app/
  5. Deploy: cubby deploy