@cratestack/cli

中文文档
0.19.3发布于 2026/11/10MIT零依赖构建来源已验证近 30 天下载 2802

Prebuilt cratestack-cli binary, fetched from GitHub Releases on install. No Rust toolchain required.

原始使用文档
文档目录4 节
  1. Install
  2. Supported platforms
  3. How it works
  4. License

@cratestack/cli

npm wrapper around cratestack-cli — the CrateStack .cstack schema validator and client/Studio code generator. Installing this package downloads the prebuilt cratestack binary matching your platform from the matching GitHub Release; no Rust toolchain required.

Install

npm install --global @cratestack/cli

Or run without installing:

npx @cratestack/cli --help

Supported platforms

macOS (x64, arm64), Linux (x64, arm64), Windows (x64). See cratestack-cli for the full command reference (check, generate-dart, generate-typescript, generate-wiremock, studio, migrate, diff, print-ir, contract).

How it works

The postinstall script (scripts/install.js) detects your OS/architecture, downloads the matching release archive plus its .sha256 checksum from GitHub Releases, verifies the checksum, and extracts the cratestack binary into bin/. The cratestack command then execs that binary.

Environment variables:

  • CRATESTACK_CLI_SKIP_DOWNLOAD=1 — skip the postinstall download (e.g. offline/vendored installs that provide the binary another way).
  • CRATESTACK_CLI_BINARY_PATH=/path/to/cratestack — run a specific binary instead of the one downloaded at install time.

If the download fails or your platform isn't yet supported, fall back to:

cargo binstall cratestack-cli
# or
cargo install cratestack-cli

License

MIT

版本与发布记录

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

版本发布日期距今
0.19.3latest2026/11/101 天前
0.19.22026/11/091 天前
0.19.12026/11/092 天前
0.19.02026/11/092 天前
0.18.12026/11/073 天前
0.18.02026/11/074 天前

关于 @cratestack/cli 的常见问题

@cratestack/cli 是什么?

Prebuilt cratestack-cli binary, fetched from GitHub Releases on install. No Rust toolchain required.

如何安装 @cratestack/cli?

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

@cratestack/cli 支持 TypeScript 吗?

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

@cratestack/cli 需要什么版本的 Node.js?

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

@cratestack/cli 可以商用吗?

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

@cratestack/cli 的下载量有多少?

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

@cratestack/cli 还在维护吗?

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