datocms-cli
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)
datocmsinpackage.jsondevDependencies → CLI available. Missing for selected CLI execution: install it (npm install --save-dev datocms).datocms.config.jsonwithsiteIdon active profile → linked. Unlinked + profile token env var set (defaultDATOCMS_API_TOKEN;.env/.env.localcount) → token auth works: skip login/projects:list/link (linking overrides it). Else drive bootstrap below.npx datocms whoamisucceeds → OAuth session active.migrations/directory → migrations already scaffolded.tsconfig.jsonormigrations.tsconfig→ TS migrations convention.