Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Contentful CLI

$ contentful Official Med Risk
Contentful · Workspace & SaaS · MIT · macos / linux / windows

Contentful CLI (contentful) manages Contentful spaces, environments, content types, and migration scripts. It provides repeatable environment cloning and local JSON exports, though interactive prompts are common unless --management-token and flags are explicitly supplied.

FCRS-1.0 Score
78 /100
Good
Medium Confidence
Zero-Friction Install
brew install contentful-cli
CLI vs MCP Decision Hybrid (CLI + MCP)

Use contentful CLI for schema migrations, space exports, and environment aliases; use Contentful MCP for reading or authoring individual CMS entries.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Accepts --management-token and explicit ID flags, but lacks universal --json stdout formatting and can fall back to interactive prompts if IDs are omitted.

  • Omitting --space-id triggers interactive space picker prompts
  • Outputs human-readable tables rather than structured JSON
Trust & Safety 19 / 25

Supports environment isolation (--environment-id) and JSON exports before migrations, though master mutations are high-impact.

  • Named environments isolate schema changes from master
  • Requires Content Management API token
Setup & Portability 12 / 15

Installable via npm or Homebrew on macOS, Linux, and Windows.

  • Published as contentful-cli on npm and Homebrew
Utility & Efficiency 12 / 15

Reliable for environment cloning, migrations, and full space JSON backup/restore.

  • Standard tool for Contentful CI/CD schema migrations
Maintenance & Lineage 9 / 10

Official Contentful repository (contentful/contentful-cli) under MIT.

  • Official Contentful GitHub organization
Docs & Verifiability 8 / 10

Documented in Contentful Developer Docs and repository README.

  • Official tutorials and reference docs at contentful.com

Security, Auth & Guardrails

Auth Modes
OAuth Browser Env API Key Config File
Credential Storage

Stores management tokens in ~/.contentfulrc.json or reads CONTENTFUL_MANAGEMENT_TOKEN / --management-token.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

CLI is free (MIT); Contentful offers a free community space tier with paid enterprise plans.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Contentful CLI Agent Rules
- Always pass `--space-id` and `--environment-id` targeting a non-`master` environment.
- Run `contentful space export` before executing `contentful space migration` or `import`.
- Never delete environments or modify `master` environment aliases without explicit human approval.

Agent-Ready Command Recipes

Safe Read-Only Queries

List accessible Contentful spaces
contentful space list

Lists Contentful space IDs and names accessible to the configured management token.

List environments in a space
contentful space environment list --space-id <SPACE_ID>

Inspects master and staging environments within the given space.

Controlled Writes & Previews

Export a staging environment to JSON
contentful space export --space-id <SPACE_ID> --environment-id staging

Writes a local JSON snapshot of content types, entries, and assets from staging.

Strengths for Agents

  • + Built-in space export and space migration support reproducible Contentful CI/CD pipelines.
  • + Environment isolation via --environment-id lets agents test schema changes safely off master.
  • + Supports CONTENTFUL_MANAGEMENT_TOKEN for headless execution.

Caveats & Pitfalls

  • ! Commands prompt interactively if --space-id or --environment-id is omitted.
  • ! Table-formatted stdout on list commands lacks a native --json flag.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI