Local Development

Local development mode (coming soon)

🚧 Coming Soon — Local development mode (--local) is currently under development. Use the default cloud mode (gencow dev) for all development work. This page will be updated when local development is available.

Current Status

Gencow uses Cloud-first development — your dev environment connects to Gencow Cloud DB, so it matches production from day one.

# Default: Cloud development (recommended)
gencow dev

What works now

Feature Status
gencow dev (cloud mode) ✅ Available
gencow db:push (cloud) ✅ Available
gencow db:seed (cloud) ✅ Available
gencow db:generate ✅ Available
gencow deploy ✅ Available

What's coming

Feature Status
gencow dev --local 🚧 Coming soon
gencow db:push --local 🚧 Coming soon
gencow db:seed --local 🚧 Coming soon
gencow db:reset 🚧 Coming soon (use Dashboard)
Offline development 🚧 Coming soon

Environment Variables

.env File

The .env file at your project root is for local configuration and is gitignored:

# Auto-set by `gencow init` / `gencow dev`:
VITE_API_URL=https://my-app-id.gencow.app

# Your secrets (used in cloud via env push):
OPENAI_API_KEY=sk-your-key-here

gencow dev automatically loads .env on start.

For cloud environment variables, use gencow env set KEY=VALUE (hot-reload, no restart). See Deployment.

AI API Key

In production (Gencow Cloud), AI API keys are provided automatically by the platform proxy — no key needed.

For development, add your OpenAI key to .env:

OPENAI_API_KEY=sk-your-key-here

Don't create OPENAI_API_KEY placeholders in cloud environment variables. The platform proxy injects the key automatically.

Database Commands

# Push schema to cloud DB (default)
gencow db:push

# Push to production DB (confirmation required)
gencow db:push --prod

# Generate SQL migration files from schema.ts
gencow db:generate

# Insert test data via cloud app
gencow db:seed

# Seed production app
gencow db:seed --prod

Tip: gencow dev and gencow deploy automatically run gencow db:generate before bundling — you only need to run it manually if you want to preview or commit migration files without deploying.

Seed Data

Create gencow/seed.ts for test data:

import { tasks } from "./schema";

export default async function seed(ctx) {
    await ctx.db.insert(tasks).values([
        { title: "Learn Gencow", userId: "test-user-id" },
        { title: "Build an awesome app", userId: "test-user-id" },
    ]);
}
gencow db:seed    # Insert test data on cloud app

Next Steps