@contentstack/cli

中文文档
2.0.2发布于 2026/10/07MITTypeScriptCommonJS近 30 天下载 4.6万

Command-line tool (CLI) to interact with Contentstack

原始使用文档
文档目录6 节
  1. Requirements
  2. Installation
  3. Usage
  4. Bundled Plugins
  5. Installable Plugins
  6. License

@contentstack/cli

Use Contentstack Command-line Interface (CLI) to interact with Contentstack directly from your terminal.

License npm

Requirements

Node.js v22 or higher — download from nodejs.org.

Installation

npm install -g @contentstack/cli

Usage

csdx --version
csdx --help
csdx auth:login

For complete documentation, visit the Contentstack CLI docs.

Bundled Plugins

PluginDescriptionDocs
@contentstack/cli-authAuthentication — login, logout, token managementDocs
@contentstack/cli-configRegion and early-access header configurationDocs
@contentstack/cli-cm-importImport stacks and modules into ContentstackDocs
@contentstack/cli-cm-exportExport stacks and modules from ContentstackDocs
@contentstack/cli-cm-seedSeed a stack from a GitHub repositoryDocs
@contentstack/cli-cm-bootstrapBootstrap a new Contentstack projectDocs
@contentstack/cli-cm-export-to-csvExport entries, taxonomies, terms, and org users to CSVDocs
@contentstack/cli-cm-cloneClone a stack to another stackDocs
@contentstack/cli-migrationRun stack migration scriptsDocs
@contentstack/cli-cm-branchesBranch management — create, diff, and mergeDocs
@contentstack/cli-auditAudit and fix content type and entry issuesDocs
@contentstack/cli-bulk-operationsBulk operations across stack contentDocs

Installable Plugins

These are Contentstack-owned plugins not bundled in the default install. Add any of them with:

csdx plugins:install <plugin-name>
PluginDescriptionDocs
@contentstack/apps-cliBuild, deploy, and manage Contentstack appsDocs
contentstack-cli-tsgenGenerate TypeScript typings from a stack's content typesDocs
contentstack-cli-content-typeRetrieve and inspect content types in a stackDocs
@contentstack/cli-launchDeploy and manage Contentstack Launch projectsDocs
@contentstack/cli-cm-regex-validateValidate regex properties on content type and global fieldsDocs
@contentstack/cli-external-migrateMigrate content from an external source into Contentstack—
@contentstack/cli-cm-export-queryExport stack content using query filtersDocs

License

MIT

版本与发布记录

@contentstack/cli 共发布 226 个版本,首次发布于 2020/10/15;过去 12 个月发布了 63 个版本。

版本发布日期距今
2.0.2latest2026/10/071 个月前
1.69.0v1-x2026/10/061 个月前
2.0.12026/09/151 个月前
1.68.02026/08/132 个月前
2.0.02026/08/122 个月前
1.67.02026/08/053 个月前

其他发布通道:v1-beta → 1.60.0-beta.7,beta → 2.0.0-beta.30,v1-x → 1.69.0。

关于 @contentstack/cli 的常见问题

@contentstack/cli 是什么?

Command-line tool (CLI) to interact with Contentstack

如何安装 @contentstack/cli?

在项目目录运行 npm install @contentstack/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 csdx,可以用 npx csdx 直接运行。

@contentstack/cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@contentstack/cli 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@contentstack/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@contentstack/cli 可以商用吗?

@contentstack/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@contentstack/cli 的下载量有多少?

根据 npm 官方下载统计,@contentstack/cli 在 2026/10/11 – 2026/11/09 这 30 天内被下载 46,243 次,日均约 1,541 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@contentstack/cli 还在维护吗?

最新版本 2.0.2 发布于 2026/10/07(1 个月前);至今共发布 226 个版本,其中过去 12 个月发布了 63 个;首次发布于 2020/10/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。