datocms-cli

Installation
SKILL.md

DatoCMS CLI Skill

Use for CLI commands, migrations, and local project configuration.

Pure Structured Text conversion or local DAST work → datocms-structured-text before CLI bootstrap: document model, editing, or conversion. CLI execution/authentication stays here when a project operation is needed. Missing sibling reference → install that skill from datocms/agent-skills or update the full bundle; ordinary CLI commands need none.

Step 1: Detect Context

Reuse established CLI context. For live reads or content operations, follow datocms-cma route selection first. Don't install CLI solely to displace a working current remote MCP connection. User chose the DatoCMS MCP for live work → stop here and stay on it until they explicitly switch.

Bootstrap only for selected CLI execution; explaining commands needs no connection. CLI-specific migrations, linking, profiles, imports, and type generation stay here.

Detection (don't rely on which datocms — CLI runs via npx)

  1. datocms in package.json devDependencies → CLI available. Missing for selected CLI execution: install it (npm install --save-dev datocms).
  2. datocms.config.json with siteId on active profile → linked. Unlinked + profile token env var set (default DATOCMS_API_TOKEN; .env/.env.local count) → token auth works: skip login/projects:list/link (linking overrides it). Else drive bootstrap below.
  3. npx datocms whoami succeeds → OAuth session active.
  4. migrations/ directory → migrations already scaffolded.
  5. tsconfig.json or migrations.tsconfig → TS migrations convention.
Installs
236
GitHub Stars
3
First Seen
Apr 23, 2026