Skip to content
mcms-cli is an unofficial community CLI(microCMS非公式).GitHub
mcms-cli Docs
English
Esc
navigateopen⌘Jpreview
On this page

Managing schemas and types

Pull and compare microCMS API schemas, then generate TypeScript declarations or JSON Schema for applications, validation, forms, and AI tools.

mcms-cli can save the API schema used by a microCMS service. Keeping that definition in a build artifact or repository makes schema changes reviewable and gives other tools a reliable input.

Pull an API schema

microcms schema pull \
  --out microcms-schema.json \
  --json

Limit the result to a specific endpoint when a task does not need the full service definition.

microcms schema pull \
  --endpoints blogs \
  --out blogs-schema.json \
  --json

Compare with a baseline

microcms schema diff \
  --baseline microcms-schema.json \
  --json

Add --exit-code in CI when a detected difference should fail the job. The JSON result still describes what changed.

Generate TypeScript declarations

microcms types generate \
  --schema microcms-schema.json \
  --out microcms-types.d.ts \
  --json

types sync combines schema retrieval and type generation in one command.

microcms types sync \
  --out microcms-types.d.ts \
  --schema-out microcms-schema.json \
  --json

Generate JSON Schema

microcms schema pull \
  --format json-schema \
  --include-extensions \
  --out schema.json \
  --json

The generated document uses JSON Schema draft-07. It can support payload validation, form generation, or a structured definition passed to an AI tool.

Last updated on August 2, 2026