The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the AI listing page.
Website · Docs · Discord · Twitter · LinkedIn
Extract, govern, and ship structured content from your codebase.
Contentrain helps teams turn hardcoded UI text, docs, and structured content into a governed, reviewable content layer. Agents can extract, create, translate, and update content, while Contentrain enforces schema, Git review, and portable file output.
That's it. You now have a governed content workspace with models, validation, review branches, and a local UI — no account, no cloud, no proprietary content format.
Start here:
Before: Hardcoded strings scattered across your codebase — no structure, no translations, no review.
After: Content lives in .contentrain/, typed and structured. Source files use i18n keys.
The normalize flow extracts strings, creates models, and patches your source files — all through reviewable git branches.
This is the strongest entry point into the product:
take the content chaos already in your codebase and turn it into a governed, reviewable content layer.
| Kind | What it stores | Storage | Example |
|---|---|---|---|
| Collection | Multiple typed entries | JSON object-map | Blog posts, products, team |
| Singleton | Single entry per locale | JSON object | Hero section, site config |
| Document | Markdown + frontmatter | .md files | Docs, articles, changelog |
| Dictionary | Flat key-value strings | JSON flat map | i18n translations, UI labels |
27 field types (string, email, url, image, relation, array, object, markdown, ...) with built-in validation.
Content is plain JSON and Markdown. Any language reads it directly.
For TypeScript projects, generate a typed SDK:
Works with Nuxt, Next.js, Astro, SvelteKit, Vue, React, Node, Go, Python, Swift, Flutter, and 20+ stacks.
This repo ships 15 Agent Skills — reusable workflow procedures that any AI coding agent can load on demand.
Install all skills to your agent:
Or install a specific skill:
Skills work with Claude Code, Cursor, Windsurf, GitHub Copilot, OpenAI Codex, Gemini CLI, and 40+ other agents.
See AGENTS.md for the full skill catalog and agent guidance.
| Package | npm | Role |
|---|---|---|
@contentrain/mcp | 27 MCP tools + stdio / HTTP transport + Local / GitHub / GitLab providers | |
contentrain | CLI + Serve UI + MCP stdio entrypoint | |
@contentrain/query | Generated TypeScript query SDK | |
@contentrain/types | Shared type definitions + constants | |
@contentrain/rules | Agent quality rules for IDE integration | |
@contentrain/skills | Workflow procedures + framework guides | |
@contentrain/wp-import | WordPress WXR / REST → RawIR → .contentrain store | |
@contentrain/emitter-astro | ProjectIR → a complete Astro project | |
@contentrain/verify | SEO, indexing, link and asset gates for a built site |
Production-ready templates with Contentrain content models, generated SDK client, and framework-specific patterns:
| Template | Framework | Use Case |
|---|---|---|
| astro-blog | Astro | Blog / editorial |
| astro-landing | Astro | Landing page |
| next-commerce | Next.js | E-commerce storytelling |
| next-multi-surface-saas | Next.js | Marketing + app + docs unified |
| next-saas-dashboard | Next.js | SaaS dashboard UI copy |
| next-white-label-portal | Next.js | White-label / multi-tenant |
| nuxt-admin-console | Nuxt | Admin console / operations |
| nuxt-saas | Nuxt | SaaS marketing site |
| sveltekit-editorial | SvelteKit | Editorial / publication |
| vitepress-docs | VitePress | Documentation site |
Each template is a GitHub template repo — click "Use this template" to start.
pnpm docs:check runs two guards, both needing pnpm build first:
AGENTS.md state one.@contentrain/* import in a documented example must
name a real export, and no example may mix CommonJS with a top-level await
(a shape that runs in no module system at all).Both self-test against real defects from this repo's history before they run, so a check that stops catching fails loudly instead of passing silently.
See RELEASING.md for the versioning and publish workflow.
If Contentrain AI is useful to you, consider giving it a star — it helps others discover the project.
MIT