@backstep/cli

中文文档
1.0.14发布于 2026/11/07MITES Module零依赖近 30 天下载 2271

bs, the backstep CLI. Every command runs on the live project.

原始使用文档

@backstep/cli

bs, the command line for backstep. Every command runs on your live project.

npx @backstep/cli pull c0ffee   # set up ./c0ffee; asks for the project's secret once
cd c0ffee
npx bs stub Reef.Snorkeler.fullName
npx bs run Reef.Snorkeler.fullName

Run bs help for every command. It needs Node 22 or later.

bs is an MCP client of your project's server at https://backstep.dev/<id>/bs/mcp: besides pull and stub, its commands are that server's tools, e.g. bs relink for Index__Index__relink. Any MCP client can connect to the same URL, with the secret as a bearer token or through OAuth.

No folder? Name the project and secret instead, from anywhere: BACKSTEP_PROJECT=<id> BACKSTEP_SECRET=<secret> npx @backstep/cli refs, or --project and --secret. Everything works that way except bs stub, which writes a file.

<projectId>/
  project.json        the project's id, and its server if not backstep.dev
  .secret             its secret; keep it out of git (bs pull writes a .gitignore)
  project/            a folder per package, starting with the project's own
    .backstep/        snapshots of the live index and types: don't edit
    snorkeler/fullName.ts   your code, one file per code slot
  • Packages: bs change Billing create adds a billing/ folder.
  • Snapshots: never edit a .backstep folder; change the index with bs change.
  • The server is https://backstep.dev. --url or BACKSTEP_URL points elsewhere, and BACKSTEP_SECRET can hold the secret instead of .secret.

版本与发布记录

@backstep/cli 共发布 16 个版本,首次发布于 2026/10/31;过去 12 个月发布了 16 个版本。

版本发布日期距今
1.0.14latest2026/11/071 天前
1.0.132026/11/071 天前
1.0.122026/11/071 天前
1.0.112026/11/062 天前
1.0.102026/11/035 天前
1.0.92026/10/318 天前

关于 @backstep/cli 的常见问题

@backstep/cli 是什么?

bs, the backstep CLI. Every command runs on the live project.

如何安装 @backstep/cli?

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

@backstep/cli 支持 TypeScript 吗?

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

@backstep/cli 支持 ESM 还是 CommonJS?

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

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

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

@backstep/cli 可以商用吗?

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

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

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

@backstep/cli 还在维护吗?

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