技巧精选

用简单脚本确认claude二进制使用的Bun版本

Here's a better way of confirming the Bun version that's used by the "claude" binary:

精选理由

想确认claude用的Bun版本?照这个搞个脚本跑一下就行,不用翻文档。

AI 摘要

Simon Willison分享了一个技巧:通过预加载脚本打印出claude二进制捆绑的Bun版本。只需创建包含console.log("embedded bun:", Bun.version)的TypeScript脚本,设置环境变量BUN_OPTIONS="--preload=/tmp/bun-version.ts",然后运行claude --version即可看到版本号。当前显示为1.4.0,即Bun的Rust版canary版本。这个方法比手动查找更直接可靠。

原文 · Simon Willison

Here's a better way of confirming the Bun version that's used by the "claude" binary:

Here's a better way of confirming the Bun version that's used by the "claude" binary: AjanRaj @ajanraj25 you can also just preload a tiny script to print the bundled Bun version: cat > /tmp/bun-version.ts <<'EOF' console.log("embedded bun:", Bun.version); process.exit(0); EOF BUN_OPTIONS="--preload=/tmp/bun-version.ts" claude --version this shows 1.4.0, which is the Rust version of Bun currently in canary. 🔗 View Quoted Tweet 💬 3 🔄 0 ❤️ 5 👀 2497 📊 3 ⚡