Git-native CMS for Next.js

Your content lives
in your codebase

OctoCMS is a file-based CMS that drops into your Next.js app, powered by TanStack Query and Octokit. Design your schema in a visual editor, edit in a polished UI, query with full type safety. Your content is just files in GitHub — versioned, reviewable, yours.

$npx octocms init
How it works
localhost:3000/cms
Hero 1

How it works

Three steps. Full CMS.

From schema to live content in minutes. Everything stays in your repo.

Step 1

Define your schema

A single TypeScript config file describes your collections, fields, and relationships. Full autocomplete, version-controlled, reviewable in PRs.

typescript
defineConfig({
  collections: {
    post: {
      label: 'Blog Posts',
      hasMany: true,
      fields: {
        title: {
          label: 'Title',
          format: 'string',
          required: true,
        },
        body: {
          label: 'Content',
          format: 'markdown',
          ...
Step 2

Edit in the admin UI

A polished editor at /cms in your app. Protected by GitHub OAuth.

  • Rich markdown editor with live preview
  • Drag-and-drop media uploads
  • Inline editing of referenced entries
  • Draft, published & archived statuses
  • Full-text search across all content
Step 3

Query with type safety

A chainable API with full TypeScript inference. Autocomplete for collection names, field names, and return types.

typescript
import { query } from 'cms/__generated__/query'

const posts = await query('post')
  .filter(p =>
    p.fields.publishedAt !== null)
  .sort('publishedAt', 'desc')
  .limit(10)
  .toArray()
// ^ fully typed PostEntry[]

Features

Everything you need. Nothing you don’t.

Config-as-code

Your entire content model in one TypeScript file. Version it, review in PRs, get autocomplete everywhere.

12 field types

String, markdown, boolean, select, image, number, datetime, JSON, slug, URL, color, and reference.

Type-safe queries

Chainable, fully-typed content queries with autocomplete for collection and field names.

Rich editor

ProseMirror-based markdown editor with toolbar, shortcuts, and live preview. Clean diffs in Git.

Media manager

Upload images with auto-extracted dimensions and blur placeholders. Organize with folders.

Git-native publishing

Branch-based workflow: edit on feature branches, publish with a click, merge when ready.

GitHub OAuth

One-click sign-in via GitHub App. No separate auth system to maintain.

Reference fields

Link entries across collections. Inline editing, drag-to-reorder, backlink tracking.

Visual schema editor

Edit collections and fields in the UI. Changes are diffed, validated, and committed to your schema in one click.

AI chat assistant

Ask questions, find content, and propose edits in natural language. Bring your own Anthropic, OpenAI, or local model.

Instant cache invalidation

Built on Next.js use cache and cacheTag(). Save an entry and public pages update immediately.

No database, no vendor.

Content is JSON on disk in dev, in your GitHub repo in production. No external API, no hosted service to pay for.

Philosophy

Everything stays in your repo.

Your schema, your content, your media, your types — all committed to Git. git blame your content. Review changes in PRs. Roll back with git revert.

0
External services
12
Field types
100%
Type-safe

Use cases

Built for small teams.

Small teams

Content editors get a polished UI. Developers keep full control. Git history is your audit trail. No per-seat pricing.

Agencies

One codebase pattern for every client. Clone, customize, deploy. Clients edit content without touching code.

Solo developers

Ship a blog, docs site, or portfolio with a real CMS in minutes. No SaaS bills, no vendor lock-in.

Get started in 60 seconds

Three commands. That’s it.

$ npx octocms init
$ npm install octocms ...
$ npm run dev
# open localhost:3000/cms