Token导航 LogoToken导航

Agent Skill · 研究检索

datocms-cli(datocms CLI 搜索)

datocms-cli 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

datocms-cli 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 36,717。

总安装 1,877周安装 79GitHub Stars 公开资料未说明下载 657核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:datocms-cli(datocms CLI 搜索)
来源仓库:https://github.com/datocms/agent-skills
仓库路径:skills/datocms-cli
安装命令:
npx skills add https://github.com/datocms/agent-skills --skill datocms-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/datocms/agent-skills --skill datocms-cli

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于操作 DatoCMS CLI 工具链,管理项目链接与本地开发环境。自动检测已有配置并引导完成登录与项目关联流程。支持迁移脚本执行、类型生成和环境变量设置。确保所有操作基于已认证的 CLI 会话进行,保障安全性。首次使用需依次完成 datocms login 和 datocms link 两步设置。

来源仓库内路径:skills/datocms-cli

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/datocms/agent-skills --skill datocms-cli;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

datocms-cli 怎么安装?

在终端执行 npx skills add https://github.com/datocms/agent-skills --skill datocms-cli。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

datocms-cli 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

datocms-cli 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

datocms-cli 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

datocms-cli 用的人多吗?

公开数据是累计安装 1,877 次,近一周安装 79 次,下载 657 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

datocms-cli 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
datocms-cli

datocms CLI 搜索 · 本页

1,877—接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

DatoCMS CLI Skill

You are an expert at using the DatoCMS CLI (datocms). Follow these steps in order. Do not skip steps.


Step 1: Detect Context

If the project context is already established in this conversation (CLI package, config file, token, migrations directory, TypeScript setup), skip broad detection below. Re-inspect only when a question cannot be answered from prior context.

CLI + link is a required bootstrap for any repo that interfaces with a DatoCMS project. The datocms npm package installed + datocms login + datocms link is how the agent gets visibility into the live project (models, fields, ids, record state). Missing → fix first, same as git init or npm install.

Detection (do not rely on which datocms — the CLI runs via npx)

  1. datocms in package.json devDependencies → CLI available. If missing, install it (npm install --save-dev datocms) — never fall back to pasted tokens or manual Dashboard steps.
  2. datocms.config.json with a siteId on the active profile → linked. If missing, drive the bootstrap below.
  3. npx datocms whoami succeeds → OAuth session active.
  4. migrations/ directory → migrations already scaffolded.
  5. tsconfig.json or migrations.tsconfig → TypeScript migrations convention.

Bootstrap flow (CLI available but not linked)

Only datocms login needs a terminal; the rest runs in non-TTY.

npx datocms login                                   # user, one-time, interactive
npx datocms projects:list [hint] --json             # agent discovers siteId
npx datocms link --site-id=<ID> [--organization-id=<ID>]   # agent links

Always confirm the target project with the user before running datocms link, even when projects:list returns a single candidate. Show the candidate(s) (name, id, organization) and wait for an explicit yes. Do not treat "only one result" as consent — the user may have access to a project they did not mean to wire to this repo, and fixing a mis-linked project later is painful.

datocms link without --site-id requires a terminal. In non-TTY it now exits cleanly with a suggestion to pass --site-id; do not retry without it. Same applies when credentials are missing — ask the user to run datocms login first.

Once the project is linked, use npx datocms schema:inspect (optionally with a model API key, id, or display name) to learn what the project actually contains — models, blocks, fields, validators, fieldsets, nested blocks, relationships. This is the right tool any time the agent or the user needs generic info about the project structure; reach for it before writing mutations, migrations, or CMA code so decisions rest on the real schema rather than guesses. See references/schema-inspect.md.

Authentication policy

  • Interactive task (publish, delete, fix, backfill, introspect, etc.): OAuth via login + link is the mechanism. Never ask the user to paste a token or add DATOCMS_CMA_TOKEN=... to .env for this case.
  • Unattended execution (CI, cron, server-side app, shared scripts without an OAuth session): CMA-enabled token via env var. Read-only CDA tokens (DATOCMS_READONLY_API_TOKEN, NEXT_PUBLIC_DATOCMS_API_TOKEN) will not work — flag that a separate CMA-enabled token is needed. The agent itself still needs CLI + link at development time for visibility.

Token resolution order the CLI uses:

  • --api-token flag
  • Linked project (OAuth-backed, the default after login + link)
  • Env var: DATOCMS_API_TOKEN (default profile), DATOCMS_<PROFILE>_PROFILE_API_TOKEN (named), or custom apiTokenEnvName
  • Profile override via DATOCMS_PROFILE

Step 2: Understand the Task

Classify the user's task into one or more categories:

CategoryExamples
CLI setupInstall CLI, authenticate (login/logout/whoami), discover accessible projects (projects:list), link/unlink projects (link/unlink), configure profiles, datocms.config.json
Schema changesAdd, modify, or remove models, fields, fieldsets, or block models — via a migration script (default) or a direct CMA operation against a chosen environment
Creating migrationsScaffold new migration scripts, autogenerate from environment diffs, custom templates (sub-task of schema changes once the migration approach is chosen)
Running migrationsExecute pending migrations, dry-run, fork-and-run, in-place execution
Schema generationRun schema:generate, scope output to item types, target a specific environment
Schema inspectionRun schema:inspect to dump models, blocks, fields, validators, appearance, default values, fieldsets, nested blocks, referenced models, or embedding models — use any time the agent or user needs to understand how the project is structured before writing code or mutations
Direct CMA callsUse cma:docs to browse API reference, cma:call for a single call with a shape from the docs, cma:script for one-off TypeScript logic that needs loops, branching, or typed Schema.* types — stdin-mode for heredocs/pipes, file-mode for longer scripts in a gitignored scratch dir
Environment managementFork, promote, rename, destroy, list environments via CLI commands
Deployment workflowMaintenance mode, safe deployment sequences, CI/CD integration
Multi-project syncShared migrations across blueprint/client projects via CLI profiles
Importing contentWordPress import, Contentful import
CLI plugin managementInstall, remove, update, list, inspect, link, or reset CLI plugins (plugins:* commands)

Step 2.5: Collect Critical Inputs Before You Commit To Commands

Do not skip questions merely because the category is obvious. Skip follow-up questions only if the request already includes the critical inputs for the relevant category, or the repo inspection answers them safely.

Ask the minimum targeted question set needed to avoid flattening a real workflow decision.

Category-specific inputs live in the reference files

Each category reference loaded in Step 3 opens with an "Inputs to confirm before running commands" section — that is the per-category equivalent of this step. Do not skip loading the reference for the task's category: it carries the workflow decisions this step is designed to protect. If you skip it, you skip the checklist.

Schema changes — decide the approach with the user

DatoCMS schema operations fall into four buckets. The choice of approach is not automatic — ask the user when the bucket is not obvious from the request, because reversibility and workflow preference matter more than which tool performs the mutation.

SituationWhat it coversApproach
Destructive schema changeDROP a field, DROP a model, bulk_destroy records, lossy field_type changes (e.g. string → json, json → string, anything that discards stored values)Migration via datocms-cli (migrations:new), against a forked sandbox first. Never run these against a primary environment without explicit, repeated user confirmation.
Reversible schema changeAdd a field, add a model or block, rename a field, toggle required, add or tighten a validation, reorder fieldsetsAsk the user. Both approaches are safe; pick by preference and context. Lean to a migration (datocms-cli) when the repo already uses a migrations workflow or the user is on a secondary branch — reviewable, reproducible. Direct mutation (cma:call, cma:script stdin-mode, or cma:script file-mode) is fine for quick iteration on a sandbox. Default to migration only when the user has no preference AND the repo shows migration conventions (migrations/ directory, prior migration commits).
User-requested one-offPhrases like "quickly, without a migrations workflow", "just patch this", "one-off", "don't scaffold migrations for this"Honor the opt-out. Use direct mutation via cma:call (single call with shape from cma:docs) or cma:script (stdin-mode for loops/multi-step, file-mode when the script is long enough that a heredoc hurts). Do not re-suggest migrations unless the change turns out to be a destructive schema change.
Content operationPublish, unpublish, delete individual records, fix slugs, bulk update a field value, re-tag uploadsNo migration needed. Prefer cma:call for a single call; cma:script stdin-mode for loops, pagination, or multi-step logic; cma:script file-mode only when a heredoc becomes painful. Code that needs to be committed and replayed across environments is a migration (datocms-cli), not datocms-cma.

Regardless of which skill is loaded, the question to ask the user is the same for a reversible schema change: *"Do you want this as a reviewable migration, or a direct mutation against a sandbox?"* The answer determines which skill owns the follow-up — not which skill was loaded first.

Cross-skill routing.

  • Destructive schema changes and the migration branch of a reversible schema change are this skill's core: migrations:new, migrations:run, fork-and-run, safe deployment. Stay here and load creating-migrations.md + running-migrations.md.
  • User-requested one-offs, content operations, and the direct-mutation branch of a reversible schema change are better covered by datocms-cma. Switch when the user has opted out of migrations, when the task is a content mutation (publish, delete, fix), or when the user wants a cma:script or a checked-in buildClient() script. The handoff is loading the sibling skill's references — do not bounce the user.
  • Unattended runtime code (CI, app server, webhook, long-lived automation) is a separate scenario — that is where a checked-in buildClient() script belongs, and datocms-cma owns that pattern.

Destructive and production-sensitive confirmations

Destructive schema changes always require these confirmations; the list below also covers non-schema destructive commands.

If context is missing, ask for explicit confirmation before proposing final commands for:

  • environments:destroy
  • environments:promote
  • imports into a non-obviously disposable target
  • migrations:run --in-place on a primary-like environment
  • maintenance:on --force
  • environments:fork --fast --force
  • cma:call with destroy, bulk_destroy, or promote methods
  • direct schema mutations (via cma:call or cma:script) targeting a primary-like environment instead of a migration on a forked sandbox
  • plugins:reset (removes all user-installed and linked CLI plugins)

Step 3: Load References

Based on the task classification, read the appropriate reference files from the references/ directory next to this skill file. Only load what is relevant.

Always load:

  • references/cli-setup.md — Installation, configuration, profiles, global flags, token resolution

Load per category:

Task categoryReference file
Creating migrationsreferences/creating-migrations.md
Running migrationsreferences/running-migrations.md
Schema generationreferences/schema-generate.md
Schema inspectionreferences/schema-inspect.md
Direct CMA callsreferences/direct-cma-calls.md (for cma:call) and/or references/cma-script.md (for cma:script)
Environment managementreferences/environment-commands.md
Deployment workflowreferences/deployment-workflow.md
Multi-project syncreferences/blueprint-sync.md
Importing contentreferences/importing-content.md
CLI plugin managementreferences/cli-plugin-management.md

Load cross-cutting references when needed:

  • If creating + running migrations together -> load both creating-migrations.md and running-migrations.md
  • If schema generation is followed by typed CMA code changes -> also load datocms-cma guidance for consuming the generated types
  • If a direct CMA call grows beyond a one-off command -> switch to datocms-cma for reusable code
  • If deployment involves environment commands -> also load environment-commands.md
  • If multi-project sync involves rollout execution -> also load running-migrations.md
  • If a CLI plugin install is specifically for WordPress/Contentful import -> also load importing-content.md

Step 4: Generate Code

Write commands and scripts following these mandatory rules:

Command Prefix

  • Respect the repo's existing package-manager execution style when one is already established (npm run..., pnpm exec..., bunx...)
  • Otherwise default to npx datocms so the local CLI version is used
  • Example: npx datocms migrations:new "add blog model" --ts

Migration File Templates

  • When generating migration file content, use the exact function signatures from the reference files
  • TypeScript: export default async function(client: Client): Promise<void>
  • JavaScript: module.exports = async (client) => {}
  • Import for TypeScript migrations: import {Client} from 'datocms/lib/cma-client-node'

File Naming

  • Migration files are automatically named: {unix_timestamp}_{camelCaseName}.ts|.js
  • Do not manually create migration files — always use npx datocms migrations:new

Migration Script Bodies

  • For the CMA API calls inside migration scripts (creating models, fields, records, uploads), defer to the datocms-cma reference patterns
  • The client parameter in migrations is the same CMA client from @datocms/cma-client-node

Schema Generation

  • Use npx datocms schema:generate <filename> to generate TypeScript schema definitions
  • Use --item-types to narrow the output when the user only needs specific models
  • Use --environment when the generated types must reflect a sandbox or staging environment
  • Route the follow-up code changes that consume those types to datocms-cma

Schema Inspection

  • Use npx datocms schema:inspect any time the agent or user needs project structure information — models, blocks, field definitions, validators, appearance, default values, fieldset grouping, nested blocks, referenced or embedding models
  • No argument dumps every model and block; pass an API key, id, or display name to narrow down (fuzzy fallback when there is no exact match)
  • Defaults to TOON output for agent consumption; add --json when piping through jq
  • Opt into extra detail selectively with --include-validators, --include-appearance, --include-default-values, --include-fieldsets, --include-nested-blocks, --include-referenced-models, --include-embedding-models; use --fields-details=complete to include everything at once
  • Restrict to regular models or modular blocks with --type=models_only / --type=blocks_only; target sandbox schemas with --environment
  • Prefer schema:inspect over composing cma:call item_types list + fields list by hand — it already resolves fieldsets, nested blocks, and embedding models in one call

Direct CMA Calls

  • Use npx datocms cma:docs <resource> <action> to look up endpoint details (request body, parameters, examples) before constructing a command
  • Use npx datocms cma:call <resource> <method> [...pathArgs] for single-method ad-hoc CMA operations
  • Pass request bodies with --data '{...}' and query parameters with --params '{...}'
  • Add --environment when the call must target a sandbox environment
  • cma:call is positional (<RESOURCE> <METHOD> + URL placeholders as extra positional args). It is not a REST wrapper: there is no --endpoint, --method, --query-params, or --body flag — do not invent these

Concrete shape, with JSON5 accepted in --data / --params:

npx datocms cma:call items list --params='{filter: {type: "article"}}'
npx datocms cma:call items find <ITEM_ID>
npx datocms cma:call items update <ITEM_ID> --data='{title: "Updated"}'
npx datocms cma:call items publish <ITEM_ID>
npx datocms cma:call fields create <ITEM_TYPE_ID> --data='{label: "Title", api_key: "title", field_type: "string"}'

Run npx datocms cma:call --help for the full list of built-in examples, or npx datocms cma:docs <resource> <action> for body schema and required fields.

  • Use npx datocms cma:script when the task needs loops, branching, multiple dependent calls, or typed Schema.* records, but the code does not need to live in the repo
  • stdin-mode (heredoc / pipe / redirect): top-level await only, ambient client and Schema, tsc --noEmit type-checks before execution, pre-installed packages available. Zero setup
  • file-mode (.ts file on disk):

- Signature: export default async function (client: Client) with Client imported from datocms/lib/cma-client-node — same import as migrations, so a file-mode script can be promoted with a plain mv into migrations/. - Validation: no CLI-side typecheck; rely on your editor LSP against your tsconfig.json, or an explicit tsc --noEmit. Typed Schema.* is opt-in via datocms schema:generate./datocms-schema.ts. - Placement: gitignored scratch dir (tmp/scripts/, scratch/). Prefer a migration for anything you want to commit, version, and replay across environments.

  • Redirect 2>/dev/null when piping stdin-mode stdout into jq
  • Switch to datocms-cma when the task needs reusable code checked into the repo for unattended runtime (CI, app server, webhook, long-lived automation)
  • Schema changes: default to scaffolding a migration. Only propose cma:call or cma:script for schema mutations after the user has explicitly opted out of the migration workflow, and never propose a direct schema mutation against a primary-like environment without an explicit confirmation from the user

CLI Plugin Commands

  • Use npx datocms plugins:available to discover official CLI plugins before installing
  • Use npx datocms plugins:add <PLUGIN> to install a CLI plugin by npm package name or GitHub URL
  • Use npx datocms plugins:link <PATH> only for local plugin development
  • These commands manage CLI extensions, not DatoCMS project plugins — route project plugin work to datocms-plugin-builder

Environment Safety

  • Always specify --source when running migrations to be explicit about the target
  • Use --dry-run first to preview changes before applying
  • Prefer fork-and-run (default) over --in-place for production environments
  • Treat --force as an explicit override, not a default

Step 5: Verify

Before presenting the final commands or scripts:

  1. API token — Confirm a CMA-enabled token is available (via env var or --api-token flag)
  2. Config file — If using profiles, verify datocms.config.json exists and has the right profile
  3. Migrations directory — Confirm the migrations directory exists or will be created by the command
  4. TypeScript config — If generating TS migrations, ensure tsconfig.json exists or --migrations-tsconfig is set
  5. Schema generation scope — If using schema:generate, verify the output file path plus any --item-types / --environment scope match the request
  6. Direct CMA calls — If using cma:call, verify positional args, --data, --params, and --environment align with the targeted method. If using cma:script, verify the script uses Schema.* types (not any/unknown), imports only from the pre-installed package list, and targets the intended environment
  7. Environment targeting — Verify the correct --source / --destination environment is specified
  8. Safety checks — For destructive operations (promote, destroy, destructive cma:call usage, risky imports, maintenance-mode force), confirm the user intends to target the right environment. For schema mutations, confirm the chosen approach (migration vs direct) and — if direct — the target environment (sandbox vs primary) before issuing commands
  9. CLI plugin commands — If using plugins:* commands, verify the plugin name is correct and distinguish CLI plugins from DatoCMS project plugins

Cross-Skill Routing

This skill covers CLI commands, flags, configuration, workflows, and migration file scaffolding. If the task involves any of the following, activate the companion skill:

ConditionRoute to
CMA API calls inside migration script bodies (records, schema, uploads)datocms-cma
Programmatic environment management via client.environments.* in codedatocms-cma
Consuming generated schema types inside application code or reusable scriptsdatocms-cma
Querying content with GraphQL for frontend displaydatocms-cda
Setting up framework integration, draft mode, or real-time updatesdatocms-frontend-integrations
Building a DatoCMS plugindatocms-plugin-builder

平台分布

Codex

36.61%
按下载量换算241

Claude

28.86%
按下载量换算190

Cursor

17.93%
按下载量换算118

Gemini CLI

9.3%
按下载量换算61

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills