Getting Started
A code-first CMS for Astro. Define collections in TypeScript and get a generated admin UI and typed content API.
Supports Astro’s route caching with tag-based invalidation.
Quick start
Section titled “Quick start”pnpx create-kide-appIt then asks how you want the CMS runtime:
Commands
Section titled “Commands”| Command | What it does |
|---|---|
pnpm dev |
Start dev server (auto-generates schema, pushes to DB) |
pnpm build |
Production build |
pnpm check |
astro check + Cloudflare TS profile + eslint |
pnpm test |
Run the test suite (vitest) |
pnpm format |
Format with Prettier |
pnpm cms:generate |
Regenerate .generated/ from cms.config.ts |
pnpm cms:admin |
Create an admin user from the CLI |
pnpm cms:mcp |
Start the local MCP server for AI-assisted editing |
pnpm cms:push |
Sync the local SQLite DB to the generated schema |
pnpm cms:upgrade |
Upgrade to a newer Kide release (see Updates) |
pnpm cms:restore |
Roll back a failed upgrade from its backup |
pnpm db:generate |
Generate migration SQL from schema changes (D1) |
In dev mode, schema changes are pushed to the DB automatically. On the Node target, cms:push is the same sync used in deploys; migration files are for Cloudflare D1 only.
Project structure
Section titled “Project structure”src/cms/ cms.config.ts # CMS config (locales, admin, collection imports) collections/ # One file per collection (schema, access rules) adapters/ # db / email / storage adapters (project-owned) fields/ # Custom admin field components (optional) runtime.ts # Wires adapters into the core runtime .generated/ # Auto-generated (don't edit) schema.ts # Drizzle tables types.ts # TypeScript interfaces validators.ts # Zod schemas api.ts # Typed API core/, admin/, routes/ # CMS runtime (embedded mode only — in package middleware/, platform/ # mode these ship inside @kidecms/core)Environment variables
Section titled “Environment variables”Set these in .env for local development or through your deployment platform. The full table with production requirements is in Deploy.
| Variable | Description |
|---|---|
AI_PROVIDER |
AI provider (openai) |
AI_API_KEY |
AI provider API key |
AI_MODEL |
AI model name (e.g. gpt-4o-mini) |
RESEND_API_KEY |
Enables automatic invite emails for new users |
RESEND_FROM_EMAIL |
Email sender address |
CMS_TRUSTED_ORIGIN |
Canonical public origin for admin CSRF checks |
CRON_SECRET |
Secures the cron endpoints (publish, tasks) |
Astro 7, React 19, Drizzle ORM, SQLite (local) / D1 (Cloudflare), Zod, Tiptap, shadcn/ui, Tailwind CSS v4