# @contentstack/cli-config 中文文档

规范地址：https://npmcn.com/package/%40contentstack/cli-config/

版本：2\.0\.2
npm 元数据更新时间：2026-10-06T09:15:35.375Z
中文译文更新时间：2026-11-10T16:47:10.497Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40contentstack/cli-config
原文对照：https://npmcn.com/package/%40contentstack/cli-config/?lang=original
项目主页：https://github.com/contentstack/cli
源码仓库：https://github.com/contentstack/cli

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：114 kB，55 个文件
- TypeScript 类型：未声明
- Node.js 要求：\>=22\.0\.0
- 运行依赖：5 个
- 首次发布：2022-08-11T11:10:41.878Z
- 最新版本发布：2026-10-06T09:15:35.174Z
- 近 30 天下载量：45403（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：89（近 12 个月 38 个）

## 中文简介

配置的内存 CLI 插件

## 安装

```sh
npm install @contentstack/cli-config
```

也可以使用：`pnpm add @contentstack/cli-config`、`yarn add @contentstack/cli-config`、`bun add @contentstack/cli-config`

## README

# @ contentstack/ cli- config

配置命名空间包含您需要的所有命令, 以便按照您的要求配置 CLI 。 内容tack支持多个区域. [配置 CLI 文件](https://www.contentstack.com/docs/headless-cms/configure-the-cli)

[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE)

-   [@ contentstack/ cli- config](https://npmcn.com/package/%40contentstack/cli-config/#readme-contentstackcli-config)
-   [使用量](https://npmcn.com/package/%40contentstack/cli-config/#readme-usage)
-   [图标](https://npmcn.com/package/%40contentstack/cli-config/#readme-commands)

# 使用量

```sh-session
$ 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
...
```

# 图标

-   [`csdx config:get:base-branch`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configgetbase-branch)
-   [`csdx config:get:ea-header`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configgetea-header)
-   [`csdx config:get:early-access-header`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configgetearly-access-header)
-   [`csdx config:get:log`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configgetlog)
-   [`csdx config:get:proxy`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configgetproxy)
-   [`csdx config:get:rate-limit`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configgetrate-limit)
-   [`csdx config:get:region`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configgetregion)
-   [`csdx config:remove:base-branch`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configremovebase-branch)
-   [`csdx config:remove:ea-header`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configremoveea-header)
-   [`csdx config:remove:early-access-header`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configremoveearly-access-header)
-   [`csdx config:remove:proxy`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configremoveproxy)
-   [`csdx config:remove:rate-limit`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configremoverate-limit)
-   [`csdx config:set:base-branch`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configsetbase-branch)
-   [`csdx config:set:ea-header`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configsetea-header)
-   [`csdx config:set:early-access-header`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configsetearly-access-header)
-   [`csdx config:set:log`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configsetlog)
-   [`csdx config:set:proxy`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configsetproxy)
-   [`csdx config:set:rate-limit`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configsetrate-limit)
-   [`csdx config:set:region [REGION]`](https://npmcn.com/package/%40contentstack/cli-config/#readme-csdx-configsetregion-region)

## `csdx config:get:base-branch`

获取当前 CLI 的分支设置

```
USAGE
  $ csdx config:get:base-branch

DESCRIPTION
  Get current branch set for CLI

EXAMPLES
  $ csdx config:get:base-branch
```

_参见代码 : [src/commands/config/get/base-branch.ts (中文(简体) )](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/base-branch.ts)_

## `csdx config:get:ea-header`

显示早期访问信头

```
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`

显示早期访问信头

```
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
```

_参见代码 : [src/commands/config/get/ear-access-header.ts 互联网档案馆的存檔,存档日期2013-12-02](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/early-access-header.ts)_

## `csdx config:get:log`

获取 CLI 的日志配置

```
USAGE
  $ csdx config:get:log

DESCRIPTION
  Get logging configuration for CLI

EXAMPLES
  $ csdx config:get:log
```

_参见代码 : [sc/命令/配置/get/log.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/log.ts)_

## `csdx config:get:proxy`

获取 CLI 的代理配置

```
USAGE
  $ csdx config:get:proxy

DESCRIPTION
  Get proxy configuration for CLI

EXAMPLES
  $ csdx config:get:proxy
```

_参见代码 : [src/commands/config/get/proxy.ts (简体中文)](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/proxy.ts)_

## `csdx config:get:rate-limit`

获取组织的费率限制

```
USAGE
  $ csdx config:get:rate-limit

DESCRIPTION
  Get rate-limit of organizations

EXAMPLES
  $ csdx config:get:rate-limit
```

_参见代码 : [src/commands/config/get/rate-limit.ts (简体中文)](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/rate-limit.ts)_

## `csdx config:get:region`

为 CLI 设定当前区域

```
USAGE
  $ csdx config:get:region

DESCRIPTION
  Get current region set for CLI

EXAMPLES
  $ csdx config:get:region
```

_参见代码 : [sc/命令/配置/get/region.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/region.ts)_

## `csdx config:remove:base-branch`

删除 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>
```

_参见代码 : [src/commands/config/remove/base-branch.ts 互联网档案馆的存檔,存档日期2013-12-02](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/base-branch.ts)_

## `csdx config:remove:ea-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`

删除早期访问信头

```
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>
```

_参见代码 : [src/commands/config/remove/早期访问标题.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/early-access-header.ts)_

## `csdx config:remove:proxy`

从全局配置中删除代理配置

```
USAGE
  $ csdx config:remove:proxy

DESCRIPTION
  Remove proxy configuration from global config

EXAMPLES
  $ csdx config:remove:proxy
```

_参见代码 : [src/commands/config/remove/proxy.ts (中文(简体) )](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/proxy.ts)_

## `csdx config:remove:rate-limit`

删除组织的费率限制

```
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>>
```

_参见代码 : [src/commands/config/remove/rate-limit.ts 互联网档案馆的存檔,存档日期2013-12-02](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/rate-limit.ts)_

## `csdx config:set:base-branch`

为 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>
```

_参见代码 : [src/commands/config/ set/base-branch.ts (中文(简体) )](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/base-branch.ts)_

## `csdx config:set:ea-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`

设置早期访问信头

```
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>
```

_参见代码 : [src/commands/config/ set/ear-access-header.ts 页面存档备份,存于互联网档案馆](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/early-access-header.ts)_

## `csdx config:set:log`

设置 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
```

_参见代码 : [src/commands/config/ set/log.ts (中文(简体) )](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/log.ts)_

## `csdx config:set:proxy`

设置 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
```

_参见代码 : [src/commands/config/ set/proxy.ts (中文(简体) )](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/proxy.ts)_

## `csdx config:set:rate-limit`

设定 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
```

_参见代码 : [src/commands/config/set/rate-limit.ts (简体中文)](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/rate-limit.ts)_

## `csdx config:set:region [REGION]`

设定 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>
```

_参见代码 : [src/命令/配置/ set/ region.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/region.ts)_

## 常见问题

### @contentstack/cli-config 是什么？

配置的内存 CLI 插件

### 如何安装 @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 和提交记录判断。

