@contentstack/cli-audit

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

Contentstack audit plugin

原始使用文档
文档目录4 节
  1. How to install this plugin
  2. How to use this plugin
  3. csdx cm:stacks:audit
  4. csdx cm:stacks:audit:fix

@contentstack/cli-audit

Audit plugin

How to install this plugin

$ csdx plugins:install @contentstack/cli-audit

How to use this plugin

$ npm install -g @contentstack/cli-audit
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/cli-audit/2.0.2 linux-x64 node-v22.23.3
$ csdx --help [COMMAND]
USAGE
  $ csdx COMMAND
...

Commands

csdx cm:stacks:audit

Perform audits and find possible errors in the exported Contentstack data

USAGE
  $ csdx cm:stacks:audit [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
    content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules|composable-studio...]
    [--columns <value>] [--sort <value>] [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output
    csv|json|yaml]

FLAGS
  --modules=<option>...  Provide the list of modules to be audited
                         <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-ru
                         les|composable-studio>
  --report-path=<value>  Path to store the audit reports

COMMON FLAGS
  -c, --config=<value>       Path of the external config
  -d, --data-dir=<value>     Path where the data is stored
      --show-console-output  Display the audit and audit fix result for individual modules

TABLE FLAGS
  --columns=<value>  Specify columns to display, comma-separated.
  --csv              Output results in CSV format.
  --filter=<value>   Filter rows by a column value (e.g., name=foo).
  --no-header        Hide table headers in output.
  --no-truncate      Prevent truncation of long text in columns.
  --output=<option>  Specify output format: csv, json, or yaml.
                     <options: csv|json|yaml>
  --sort=<value>     Sort the table by a column. Use "-" for descending.

DESCRIPTION
  Perform audits and find possible errors in the exported Contentstack data

EXAMPLES
  $ csdx cm:stacks:audit

  $ csdx cm:stacks:audit --report-path=<path>

  $ csdx cm:stacks:audit --report-path=<path> --csv

  $ csdx cm:stacks:audit --report-path=<path> --filter="name=<filter-value>"

  $ csdx cm:stacks:audit --report-path=<path> --modules=content-types --filter="name="<filter-value>"

See code: src/commands/cm/stacks/audit/index.ts

csdx cm:stacks:audit:fix

Perform audits and fix possible errors in the exported Contentstack data.

USAGE
  $ csdx cm:stacks:audit:fix [-c <value>] [-d <value>] [--show-console-output] [--report-path <value>] [--modules
    content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-rules|composable-studio...]
    [--copy-path <value> --copy-dir] [--fix-only
    reference|global_field|json:rte|json:extension|blocks|group|content_types...] [--columns <value>] [--sort <value>]
    [--filter <value>] [--csv] [--no-truncate] [--no-header] [--output csv|json|yaml]

FLAGS
  --copy-dir              Create backup from the original data.
  --copy-path=<value>     Provide the path to backup the copied data
  --fix-only=<option>...  Provide the list of fix options
                          <options: reference|global_field|json:rte|json:extension|blocks|group|content_types>
  --modules=<option>...   Provide the list of modules to be audited
                          <options: content-types|global-fields|entries|extensions|workflows|custom-roles|assets|field-r
                          ules|composable-studio>
  --report-path=<value>   Path to store the audit reports

COMMON FLAGS
  -c, --config=<value>       Path of the external config
  -d, --data-dir=<value>     Path where the data is stored
      --show-console-output  Display the audit and audit fix result for individual modules

TABLE FLAGS
  --columns=<value>  Specify columns to display, comma-separated.
  --csv              Output results in CSV format.
  --filter=<value>   Filter rows by a column value (e.g., name=foo).
  --no-header        Hide table headers in output.
  --no-truncate      Prevent truncation of long text in columns.
  --output=<option>  Specify output format: csv, json, or yaml.
                     <options: csv|json|yaml>
  --sort=<value>     Sort the table by a column. Use "-" for descending.

DESCRIPTION
  Perform audits and fix possible errors in the exported Contentstack data.

EXAMPLES
  $ csdx cm:stacks:audit:fix --copy-dir

  $ csdx cm:stacks:audit:fix --report-path=<path> --copy-dir

  $ csdx cm:stacks:audit:fix --report-path=<path> --copy-dir --csv

  $ csdx cm:stacks:audit:fix --fix-only=reference,global_field --copy-dir

  $ csdx cm:stacks:audit:fix --report-path=<path> --filter="name=<filter-value>"

  $ csdx cm:stacks:audit:fix --report-path=<path> --modules=content-types --filter="name="<filter-value>" --copy-dir --copy-path=<path>

See code: src/commands/cm/stacks/audit/fix.ts

版本与发布记录

@contentstack/cli-audit 共发布 77 个版本,首次发布于 2023/10/13;过去 12 个月发布了 38 个版本。

版本发布日期距今
2.0.2latest2026/10/061 个月前
1.22.0v1-x2026/10/061 个月前
2.0.12026/09/151 个月前
1.21.12026/08/132 个月前
2.0.02026/08/122 个月前
1.21.02026/08/053 个月前

其他发布通道:beta → 2.0.0-beta.16,v1-x → 1.22.0。

关于 @contentstack/cli-audit 的常见问题

@contentstack/cli-audit 是什么?

Contentstack audit plugin

如何安装 @contentstack/cli-audit?

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

@contentstack/cli-audit 支持 TypeScript 吗?

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

@contentstack/cli-audit 支持 ESM 还是 CommonJS?

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

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

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

@contentstack/cli-audit 可以商用吗?

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

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

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

@contentstack/cli-audit 还在维护吗?

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