@commercetools/cli-topic-integration-layer

中文文档
1.3.1发布于 2026/10/15MITTypeScriptES Module构建来源已验证近 30 天下载 4154

commercetools CLI plugin: integration-layer topic

原始使用文档
文档目录3 节
  1. Install
  2. Commands
  3. Develop

@commercetools/cli-topic-integration-layer

A commercetools CLI plugin that adds the integration-layer topic — the tooling for authoring, running, validating, publishing, and inspecting Commerce Integration Layer extensions.

It is published to the public npm registry and installed on demand as a runtime oclif plugin; it is never bundled into the base @commercetools/cli.

Install

npm install -g @commercetools/cli

# Opt in to the integration-layer topic (public npm — no auth needed)
commercetools plugins install @commercetools/cli-topic-integration-layer

# Log in once — mints the manage_project token the authenticated commands reuse
commercetools auth login --project-key <your-project-key>

Commands

commercetools integration-layer init [DIR]                  # scaffold an extensions monorepo [offline]

commercetools integration-layer extension build             # bundle src/extension.ts → dist [offline]
commercetools integration-layer extension serve             # local dev server; allowlist-gated fetch when online + logged in
commercetools integration-layer extension invoke-api-extension   # fire an API-Extension callback at the local bundle [offline], or --deployed via the IL

commercetools integration-layer explore                     # local GraphQL explorer over your deployed edge
commercetools integration-layer schema fetch                # the Project's core-subgraph SDL

commercetools integration-layer config list|get|set|unset   # per-project extension configuration

commercetools integration-layer allowlist list|add|remove|set   # hosts the extension's fetch may reach

commercetools integration-layer project-settings get|set          # project label, language, currency, country

commercetools integration-layer idp-login get|set|delete          # external OpenID Connect IdP for shopper login

commercetools integration-layer checkout-rules get|add|remove|set   # which Checkout Application serves which shopper

commercetools integration-layer field-visibility list|hide|show|set   # custom fields hidden from the public API

commercetools integration-layer --version                   # the installed plugin version [offline]

Add --all to build / serve / validate / push to merge every extension under ./extensions/* into the single bundle a Project deploys.

Authenticated commands present the token from commercetools auth login (a manage_project bearer) and derive the Commerce Integration Layer's hosts from your login Region; --integration-layer-url / INTEGRATION_LAYER_URL overrides the extensions edge.

Full reference — every command, flag, host, and CI usage and extension-authoring detail live in the commerce-integration-layer-extensions repository, which also holds ready-to-edit templates for each pattern.

Develop

This package lives in the commerce-integration-layer-extensions repo. From the repo root:

pnpm install
pnpm --filter @commercetools/cli-topic-integration-layer build       # tsc → dist/
pnpm --filter @commercetools/cli-topic-integration-layer test        # vitest
pnpm typecheck
pnpm lint

pnpm setup:cli    # build + `commercetools plugins link` this checkout

Changing the plugin? Add a changeset (pnpm changeset) in your PR — see Developing the plugin for the release flow.

版本与发布记录

@commercetools/cli-topic-integration-layer 共发布 19 个版本,首次发布于 2026/07/27;过去 12 个月发布了 19 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.3.1latest2026/10/1525 天前
1.3.02026/10/1526 天前
1.2.02026/10/1426 天前
1.1.02026/10/091 个月前
1.0.02026/09/241 个月前
0.11.02026/09/161 个月前

关于 @commercetools/cli-topic-integration-layer 的常见问题

@commercetools/cli-topic-integration-layer 是什么?

commercetools CLI plugin: integration-layer topic

如何安装 @commercetools/cli-topic-integration-layer?

在项目目录运行 npm install @commercetools/cli-topic-integration-layer,或使用 pnpm add / yarn add / bun add。

@commercetools/cli-topic-integration-layer 支持 TypeScript 吗?

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

@commercetools/cli-topic-integration-layer 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@commercetools/cli-topic-integration-layer 可以商用吗?

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

@commercetools/cli-topic-integration-layer 的下载量有多少?

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

@commercetools/cli-topic-integration-layer 还在维护吗?

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