@braintrust/bt

中文文档
0.29.0发布于 2026/11/05Apache-2.0零依赖构建来源已验证近 30 天下载 5945

The Braintrust command line interface

原始使用文档

Braintrust CLI (bt)

Install the CLI globally:

npm install -g @braintrust/bt
bt --version

Or add it to a project:

npm install --save-dev @braintrust/bt
npx bt --help

Run without adding a project dependency:

npx @braintrust/bt --help

Use @braintrust/bt@<version> to select a specific stable CLI release. The CLI is distributed separately from the braintrust JavaScript SDK. See the CLI documentation for commands and configuration.

Installation behavior

The package installs the matching @braintrust/bt-* binary as an optional dependency. Prebuilt binaries are available for macOS arm64/x64, Linux glibc arm64/x64, Linux musl x64, and Windows arm64/x64. bt eval currently supports Linux and macOS only.

If optional dependencies are omitted, the postinstall script attempts to download the matching binary from the public npm registry. The fallback binary is verified against a SHA-256 checksum shipped with this package before it is installed. Download, checksum, and file-write failures fail installation with a nonzero exit code. Unsupported platforms and missing release metadata also fail installation. The launcher reports an error if no binary is available when invoked. When install scripts are disabled, optional dependencies must be installed for the CLI to work.

Optional dependenciesInstall scriptsResult
EnabledEnabledUse the platform package; no fallback download.
EnabledDisabledUse the platform package.
DisabledEnabledDownload and verify the fallback binary.
DisabledDisabledInstallation succeeds, but running bt reports the missing binary.

If both features were disabled, reinstall with npm install --include=optional @braintrust/bt (add --global for a global installation). When moving a project between operating systems or architectures, reinstall dependencies on the destination instead of copying node_modules.

The launcher and installer retain two compatibility overrides from the JavaScript SDK:

  • BT_BINARY_PATH selects an existing executable instead of the packaged binary and skips the postinstall download.
  • BT_SKIP_DOWNLOAD=1 disables the postinstall fallback download.

These apply before the native CLI runs; native CLI configuration remains available through its flags and environment variables.

Update and uninstall

Update a global installation:

npm install -g @braintrust/bt@latest

For a project installation, use npm install --save-dev @braintrust/bt@latest. Use npm to update npm installations; bt update is for official installer installations.

Uninstall globally with npm uninstall -g @braintrust/bt, or from a project with npm uninstall @braintrust/bt.

版本与发布记录

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

版本发布日期距今
0.29.0latest2026/11/053 天前
0.28.12026/10/309 天前
0.28.02026/10/2910 天前
0.27.22026/10/2712 天前
0.27.12026/10/2118 天前
0.27.02026/10/2118 天前

其他发布通道:bootstrap → 0.0.1。

关于 @braintrust/bt 的常见问题

@braintrust/bt 是什么?

The Braintrust command line interface

如何安装 @braintrust/bt?

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

@braintrust/bt 支持 TypeScript 吗?

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

@braintrust/bt 可以商用吗?

@braintrust/bt 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@braintrust/bt 的下载量有多少?

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

@braintrust/bt 还在维护吗?

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