spawn/cli/package.json
A 3e5cd2d076
fix: spawn fails with bun not found after install (#1748)
* fix: add ~/.bun/bin to shell rc files so spawn finds bun after install

The install script was only adding ~/.local/bin to shell profile files
(bashrc/zshrc/bash_profile), but not ~/.bun/bin. Since the spawn binary
uses #!/usr/bin/env bun as its shebang, bun must be in PATH for spawn
to work. After exec $SHELL, only dirs in rc files are available.

Now ensure_in_path() patches shell rc files for both ~/.local/bin (for
spawn) and ~/.bun/bin (for bun), and correctly checks both when deciding
whether to show "Run spawn" vs "exec $SHELL" instructions.

Fixes #1747

Agent: code-health
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: quote dir in fish_add_path to prevent command injection

Address security review feedback on PR #1748 — unquoted ${dir} in
fish command string could allow injection if HOME/BUN_INSTALL env
vars contain metacharacters.

Agent: code-health
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-22 13:41:27 -08:00

24 lines
596 B
JSON

{
"name": "@openrouter/spawn",
"version": "0.6.14",
"type": "module",
"bin": {
"spawn": "cli.js"
},
"scripts": {
"dev": "bun run src/index.ts",
"build": "bun build src/index.ts --outfile cli.js --target bun --minify --packages bundle",
"compile": "bun build src/index.ts --compile --outfile spawn",
"lint": "biome lint src/",
"test": "bun test",
"test:watch": "bun test --watch"
},
"dependencies": {
"@clack/prompts": "^1.0.0",
"picocolors": "^1.1.1"
},
"devDependencies": {
"@biomejs/biome": "^2.4.3",
"@types/bun": "^1.3.8"
}
}