@contentstack/cli-config

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

Contentstack CLI plugin for configuration

原始使用文档
文档目录19 节
  1. csdx config:get:base-branch
  2. csdx config:get:ea-header
  3. csdx config:get:early-access-header
  4. csdx config:get:log
  5. csdx config:get:proxy
  6. csdx config:get:rate-limit
  7. csdx config:get:region
  8. csdx config:remove:base-branch
  9. csdx config:remove:ea-header
  10. csdx config:remove:early-access-header
  11. csdx config:remove:proxy
  12. csdx config:remove:rate-limit
  13. csdx config:set:base-branch
  14. csdx config:set:ea-header
  15. csdx config:set:early-access-header
  16. csdx config:set:log
  17. csdx config:set:proxy
  18. csdx config:set:rate-limit
  19. csdx config:set:region [REGION]

@contentstack/cli-config

The config namespace contains all the commands that you will need to configure the CLI as per your requirements. Contentstack supports multiple regions. Configure the CLI documentation

License

Usage

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

Commands

csdx config:get:base-branch

Get current branch set for CLI

USAGE
  $ csdx config:get:base-branch

DESCRIPTION
  Get current branch set for CLI

EXAMPLES
  $ csdx config:get:base-branch

See code: src/commands/config/get/base-branch.ts

csdx config:get:ea-header

Display Early Access headers

USAGE
  $ csdx config:get:ea-header

DESCRIPTION
  Display Early Access headers

ALIASES
  $ csdx config:get:ea-header

EXAMPLES
  $ csdx config:get:ea-header

csdx config:get:early-access-header

Display Early Access headers

USAGE
  $ csdx config:get:early-access-header

DESCRIPTION
  Display Early Access headers

ALIASES
  $ csdx config:get:ea-header

EXAMPLES
  $ csdx config:get:early-access-header

See code: src/commands/config/get/early-access-header.ts

csdx config:get:log

Get logging configuration for CLI

USAGE
  $ csdx config:get:log

DESCRIPTION
  Get logging configuration for CLI

EXAMPLES
  $ csdx config:get:log

See code: src/commands/config/get/log.ts

csdx config:get:proxy

Get proxy configuration for CLI

USAGE
  $ csdx config:get:proxy

DESCRIPTION
  Get proxy configuration for CLI

EXAMPLES
  $ csdx config:get:proxy

See code: src/commands/config/get/proxy.ts

csdx config:get:rate-limit

Get rate-limit of organizations

USAGE
  $ csdx config:get:rate-limit

DESCRIPTION
  Get rate-limit of organizations

EXAMPLES
  $ csdx config:get:rate-limit

See code: src/commands/config/get/rate-limit.ts

csdx config:get:region

Get current region set for CLI

USAGE
  $ csdx config:get:region

DESCRIPTION
  Get current region set for CLI

EXAMPLES
  $ csdx config:get:region

See code: src/commands/config/get/region.ts

csdx config:remove:base-branch

Remove branch config for CLI

USAGE
  $ csdx config:remove:base-branch [-k <value>] [-y]

FLAGS
  -k, --stack-api-key=<value>  Stack API key.
  -y, --yes                    Force remove.

DESCRIPTION
  Remove branch config for CLI

EXAMPLES
  $ csdx config:remove:base-branch

  $ csdx config:remove:base-branch --stack-api-key <value>

See code: src/commands/config/remove/base-branch.ts

csdx config:remove:ea-header

Remove Early Access header

USAGE
  $ csdx config:remove:ea-header [--header-alias <value>] [-y]

FLAGS
  -y, --yes                   (optional) Force the removal of Early Access header configuration by skipping the
                              confirmation.
      --header-alias=<value>  (optional) Provide the Early Access header alias name.

DESCRIPTION
  Remove Early Access header

ALIASES
  $ csdx config:remove:ea-header

EXAMPLES
  $ csdx config:remove:ea-header

  $ csdx config:remove:ea-header --header-alias <value>

csdx config:remove:early-access-header

Remove Early Access header

USAGE
  $ csdx config:remove:early-access-header [--header-alias <value>] [-y]

FLAGS
  -y, --yes                   (optional) Force the removal of Early Access header configuration by skipping the
                              confirmation.
      --header-alias=<value>  (optional) Provide the Early Access header alias name.

DESCRIPTION
  Remove Early Access header

ALIASES
  $ csdx config:remove:ea-header

EXAMPLES
  $ csdx config:remove:early-access-header

  $ csdx config:remove:early-access-header --header-alias <value>

See code: src/commands/config/remove/early-access-header.ts

csdx config:remove:proxy

Remove proxy configuration from global config

USAGE
  $ csdx config:remove:proxy

DESCRIPTION
  Remove proxy configuration from global config

EXAMPLES
  $ csdx config:remove:proxy

See code: src/commands/config/remove/proxy.ts

csdx config:remove:rate-limit

Remove rate-limit of the organization

USAGE
  $ csdx config:remove:rate-limit [--org <value>]

FLAGS
  --org=<value>  Provide the organization UID

DESCRIPTION
  Remove rate-limit of the organization

EXAMPLES
  $ csdx config:remove:rate-limit --org <<org_uid>>

See code: src/commands/config/remove/rate-limit.ts

csdx config:set:base-branch

Set branch for CLI

USAGE
  $ csdx config:set:base-branch [-k <value>] [--base-branch <value>]

FLAGS
  -k, --stack-api-key=<value>  Stack API key
      --base-branch=<value>    Base branch (Target branch).

DESCRIPTION
  Set branch for CLI

EXAMPLES
  $ csdx config:set:base-branch

  $ csdx config:set:base-branch --stack-api-key <value> --base-branch <value>

See code: src/commands/config/set/base-branch.ts

csdx config:set:ea-header

Set Early Access header

USAGE
  $ csdx config:set:ea-header [--header-alias <value>] [--header <value>]

FLAGS
  --header=<value>        (optional) Provide the Early Access header value.
  --header-alias=<value>  (optional) Provide a name (alias) for this Early Access header.

DESCRIPTION
  Set Early Access header

ALIASES
  $ csdx config:set:ea-header

EXAMPLES
  $ csdx config:set:ea-header

  $ csdx config:set:ea-header --header <value> --header-alias <value>

csdx config:set:early-access-header

Set Early Access header

USAGE
  $ csdx config:set:early-access-header [--header-alias <value>] [--header <value>]

FLAGS
  --header=<value>        (optional) Provide the Early Access header value.
  --header-alias=<value>  (optional) Provide a name (alias) for this Early Access header.

DESCRIPTION
  Set Early Access header

ALIASES
  $ csdx config:set:ea-header

EXAMPLES
  $ csdx config:set:early-access-header

  $ csdx config:set:early-access-header --header <value> --header-alias <value>

See code: src/commands/config/set/early-access-header.ts

csdx config:set:log

Set logging configuration for CLI

USAGE
  $ csdx config:set:log [--level debug|info|warn|error] [--path <value>] [--show-console-logs]

FLAGS
  --level=<option>          Set the log level for the CLI. Defaults to "info" if not specified.
                            <options: debug|info|warn|error>
  --path=<value>            Specify the directory path where logs should be saved. Supports both relative and absolute
                            paths. Defaults to ~/.contentstack/logs if not specified.
  --[no-]show-console-logs  Enable console logging.

DESCRIPTION
  Set logging configuration for CLI

EXAMPLES
  $ csdx config:set:log

  $ csdx config:set:log --level debug

  $ csdx config:set:log --path ./logs

  $ csdx config:set:log --level debug --path ./logs --show-console-logs

  $ csdx config:set:log --no-show-console-logs

  $ csdx config:set:log --level warn --show-console-logs

  $ csdx config:set:log --path ~/custom/logs

  $ csdx config:set:log --path /var/log/contentstack

See code: src/commands/config/set/log.ts

csdx config:set:proxy

Set proxy configuration for CLI

USAGE
  $ csdx config:set:proxy --host <value> --port <value> --protocol http|https [--username <value>]

FLAGS
  --host=<value>       (required) Proxy host address
  --port=<value>       (required) Proxy port number
  --protocol=<option>  (required) [default: http] Proxy protocol (http or https)
                       <options: http|https>
  --username=<value>   Proxy username (optional)

DESCRIPTION
  Set proxy configuration for CLI

EXAMPLES
  $ csdx config:set:proxy --host 127.0.0.1 --port 3128

  $ csdx config:set:proxy --host proxy.example.com --port 8080 --protocol https

  $ csdx config:set:proxy --host proxy.example.com --port 8080 --username user

See code: src/commands/config/set/proxy.ts

csdx config:set:rate-limit

Set rate-limit for CLI

USAGE
  $ csdx config:set:rate-limit [--org <value>] [--utilize <value>] [--limit-name <value>...] [--default]

FLAGS
  --default                Reset to default rate limit
  --limit-name=<value>...  [Optional] Provide the limit names separated by commas ['limit', 'getLimit', 'bulkLimit']
  --org=<value>            Provide the organization UID
  --utilize=<value>        [default: 50] Provide the utilization percentages for rate limit, separated by commas

DESCRIPTION
  Set rate-limit for CLI

EXAMPLES
  $ csdx config:set:rate-limit --org <<org_uid>>

  $ csdx config:set:rate-limit --org <<org_uid>> --utilize 70,80 --limit-name getLimit,limit

  $ csdx config:set:rate-limit --org <<org_uid>> --default

See code: src/commands/config/set/rate-limit.ts

csdx config:set:region [REGION]

Set region for CLI

USAGE
  $ csdx config:set:region [REGION] [--cda <value> --cma <value> --ui-host <value> --name <value>] [--developer-hub
    <value>] [--personalize <value>] [--launch <value>] [--studio <value>] [--cs-assets <value>] [--auth-api <value>]

ARGUMENTS
  [REGION]  Name for the region

FLAGS
  --auth-api=<value>       Custom host to set for Auth API
  --cda=<value>            Custom host to set for content delivery API, if this flag is added then cma, ui-host and name
                           flags are required
  --cma=<value>            Custom host to set for content management API, , if this flag is added then cda, ui-host and
                           name flags are required
  --cs-assets=<value>      Custom host to set for Contentstack Assets API
  --developer-hub=<value>  Custom host to set for Developer hub API
  --launch=<value>         Custom host to set for Launch API
  --name=<value>           Name for the region, if this flag is added then cda, cma and ui-host flags are required
  --personalize=<value>    Custom host to set for Personalize API
  --studio=<value>         Custom host to set for Studio API
  --ui-host=<value>        Custom UI host to set for CLI, if this flag is added then cda, cma and name flags are
                           required

DESCRIPTION
  Set region for CLI

EXAMPLES
  $ csdx config:set:region

  $ csdx config:set:region AWS-NA

  $ csdx config:set:region AWS-EU

  $ csdx config:set:region AWS-AU

  $ csdx config:set:region AZURE-NA

  $ csdx config:set:region AZURE-EU

  $ csdx config:set:region GCP-NA

  $ csdx config:set:region GCP-EU

  $ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India"

  $ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url>

  $ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --personalize <custom_personalize_url>

  $ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --launch <custom_launch_url>

  $ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --studio <custom_studio_url>

  $ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --cs-assets <cs_assets_url>

  $ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --studio <custom_studio_url> --cs-assets <cs_assets_url>

See code: src/commands/config/set/region.ts

版本与发布记录

@contentstack/cli-config 共发布 89 个版本,首次发布于 2022/08/11;过去 12 个月发布了 38 个版本。

版本发布日期距今
2.0.2latest2026/10/061 个月前
1.21.4v1-x2026/10/061 个月前
1.21.32026/09/291 个月前
2.0.12026/09/151 个月前
1.21.22026/08/132 个月前
2.0.02026/08/122 个月前

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

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

@contentstack/cli-config 是什么?

Contentstack CLI plugin for configuration

如何安装 @contentstack/cli-config?

在项目目录运行 npm install @contentstack/cli-config,或使用 pnpm add / yarn add / bun add。

@contentstack/cli-config 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/contentstack__cli-config 是否存在。

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

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

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

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

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

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

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

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