Contentrain AI
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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.
Try it in 30 seconds
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:
- See the 2-minute demo
- Open the normalize guide
- Read the docs
What Contentrain is for
- **Rescuing hardcoded strings** from existing apps and turning them into structured, translatable content
- **Starting new projects with a real content layer** instead of scattering copy across components
- **Serving the same content across web, docs, mobile, and backend systems** from plain JSON and Markdown in Git
What it is not
- Not an AI writing app
- Not a database-first or dashboard-first CMS replacement for every team
- Not a proprietary content runtime that locks your app to one platform
What it looks like
**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.**
How it works
- **Agent** decides what content should exist and where it should come from
- **Contentrain** enforces schemas, validation, canonical serialization, and git workflow
- **Human** reviews through branches, PRs, or the local Serve UI
- **Output** is plain JSON + Markdown that any language or framework can consume
4 content kinds
| 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.
Use your content anywhere
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.
Why teams use it
- **Git-native** — every write goes through worktree isolation + review branches
- **Normalize flow** — scan codebase for hardcoded strings → extract → create i18n-ready content → patch source files
- **MCP engine** — 27 tools (22 core + 5 media) over stdio or HTTP transport, works with Claude Code, Cursor, Windsurf, or any MCP client
- **Provider-agnostic engine** — the same tool surface runs over a local worktree, GitHub, or GitLab (self-hosted included) with zero tool-code changes. HTTP transport available for remote drivers such as Studio.
- **Canonical serialization** — sorted keys, deterministic output, clean git diffs, conflict-free parallel edits
- **Agent rules & skills** — behavioral policies and step-by-step workflows ship as npm packages