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

Safe content operations

Use mcms-cli to inspect, validate, preview, and write microCMS content safely, with machine-readable checks before and after every change.

A reliable write workflow checks the destination, loads the current schema, validates the payload, previews the operation, executes it, and then reads the remote state back.

Check the destination

Confirm the active profile, service domain, and credential source before changing content.

microcms auth status --json
microcms config doctor --json

Both commands should exit with status 0, and their JSON response should contain .ok == true.

Read content

microcms content list blogs --all --json
microcms content get blogs <content-id> --json

Using JSON output lets scripts inspect stable fields instead of parsing messages intended for people.

Validate before creating

Pull the latest API schema and validate the payload against it.

microcms schema pull --out microcms-schema.json --json
microcms validate blogs --file payload.json --json

Preview and execute a write

Run the same command with --dry-run first. Execute it only after the dry-run succeeds.

microcms content create blogs --file payload.json --dry-run --json
microcms content create blogs --file payload.json --json

The same pattern applies to update and delete operations. For multiple changes, content bulk can validate every payload before any request is sent.

microcms content bulk \
  --file operations.json \
  --validate-payload \
  --strict-warnings \
  --dry-run \
  --json

After execution, check that .ok == true, data.failed == 0, and the expected content can be read from microCMS.

Last updated on August 2, 2026