@claudinite/setup

中文文档
1.1.0发布于 2026/10/23UNLICENSEDES Module零依赖构建来源已验证近 30 天下载 2013

Installs the Claudinite engine a repository pins and links .claudinite/bin/cn to it.

原始使用文档
文档目录6 节
  1. In an adopted repository
  2. Adopting a repository
  3. In GitHub Actions
  4. Updating
  5. When it fails
  6. Releasing

@claudinite/setup

Installs the Claudinite engine a repository pins, and links .claudinite/bin/cn to it.

npx --yes @claudinite/[email protected]

Run it in the repository (or pass --repo DIR). Then run .claudinite/bin/cn.

In an adopted repository

The installer reads engine.version and engine.manifest from .claudinite/settings.yaml. It downloads that release's manifest.json and this platform's binary from npm. If engine.releases names a GitHub repository, it reads that repository's releases instead. It then checks three things:

  • the manifest's sha512 against the engine.manifest pin;
  • the manifest's signature against the roots of the Claudinite key ceremony, which are in install.mjs;
  • the binary's sha256 against the manifest.

Verified files are cached read-only in ${XDG_CACHE_HOME:-~/.cache}/claudinite/<version>, and the cache folder must be mode 0700. Each run checks the cache again, so a warm run downloads nothing.

The engine version always comes from settings.yaml. The installer version you name after @ only fixes the code that downloads and checks it. Name an exact version: latest would run whatever is published next.

Adopting a repository

With no settings.yaml, the installer installs the latest @claudinite/cli, or the version given with --version. The download is checked against npm's integrity and the signature, so you can run cn adopt from it:

npx --yes @claudinite/[email protected] && .claudinite/bin/cn adopt <packs>

In GitHub Actions

      - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
        with:
          path: |
            ~/.cache/claudinite
            ~/.npm/_cacache
          key: cn-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.claudinite/settings.yaml') }}
          restore-keys: cn-${{ runner.os }}-${{ runner.arch }}-
      - run: npx --yes --prefer-offline @claudinite/[email protected]

Updating

npx --yes @claudinite/setup@1 update [--to V] [--engine-only | --packs-only] [--dry-run] [--json] [--strict]

update picks the engine to move to. That is the newest version a dist-tag of the repository's engine.channel points at (latest for stable, latest and staging for staging) that is newer than the pin, of the same major, and not deprecated, held or revoked. If engine.releases names a repository, it is that repository's latest release. --to names the exact version instead; it is the only way to an older version or a new major.

It downloads and checks that engine as above, runs its selftest --repo with no tokens in its environment, and then runs its cn update apply with the flags given. Apply writes the pin, the settings, the workflows and the packs into the working tree; review the diff and commit it. With nothing newer, the pinned engine runs update apply for the packs alone.

The exit code is apply's: 0 updated or up to date, 2 updated but --strict found a blocking finding. It exits 1 when it refused with nothing written, and 3 when it could not run.

When it fails

It removes .claudinite/bin/cn, so no other engine runs in its place. It explains why on stderr, prints one line on stdout telling a Claude session to stop and ask the person, and exits 1. Bad arguments exit 2.

HTTPS_PROXY and NO_PROXY are honoured. CLAUDINITE_REGISTRY, CLAUDINITE_GITHUB and CLAUDINITE_MAX_DOWNLOAD_BYTES change the registry, the GitHub host and the download cap (64 MiB).

Releasing

Raise version in package.json, merge, and dispatch the release workflow. Versions are immutable and change only when the install logic does.

Dispatching it with preview publishes <version>-preview.<run> under the preview dist-tag, with no git tag. @1 never resolves to a preview, so only a repository that names that exact version runs it.

版本与发布记录

@claudinite/setup 共发布 6 个版本,首次发布于 2026/10/20;过去 12 个月发布了 6 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.1.0latest2026/10/2318 天前
1.1.0-preview.3preview2026/10/2318 天前
1.0.22026/10/2119 天前
1.0.12026/10/2021 天前
1.0.02026/10/2021 天前
0.0.0-stage2026/10/2021 天前

关于 @claudinite/setup 的常见问题

@claudinite/setup 是什么?

Installs the Claudinite engine a repository pins and links .claudinite/bin/cn to it.

如何安装 @claudinite/setup?

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

@claudinite/setup 支持 TypeScript 吗?

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

@claudinite/setup 支持 ESM 还是 CommonJS?

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

@claudinite/setup 需要什么版本的 Node.js?

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

@claudinite/setup 可以商用吗?

@claudinite/setup 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@claudinite/setup 的下载量有多少?

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

@claudinite/setup 还在维护吗?

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