fix: fix bun install bug

This commit is contained in:
Nathan Flurry 2026-02-02 16:25:53 -08:00
parent 553f249836
commit 048dcc5693
17 changed files with 354 additions and 22 deletions

View file

@ -6,9 +6,18 @@ icon: "rocket"
<Steps>
<Step title="Install skill (optional)">
```bash
npx skills add rivet-dev/skills -s sandbox-agent
```
<Tabs>
<Tab title="npx">
```bash
npx skills add rivet-dev/skills -s sandbox-agent
```
</Tab>
<Tab title="bunx">
```bash
bunx skills add rivet-dev/skills -s sandbox-agent
```
</Tab>
</Tabs>
</Step>
<Step title="Set environment variables">
@ -88,6 +97,14 @@ icon: "rocket"
```
</Tab>
<Tab title="bunx">
Run without installing globally.
```bash
bunx @sandbox-agent/cli server --no-token --host 0.0.0.0 --port 2468
```
</Tab>
<Tab title="npm i -g">
Install globally, then run.
@ -97,17 +114,41 @@ icon: "rocket"
```
</Tab>
<Tab title="Build from source">
If you're running from source instead of the installed CLI.
<Tab title="bun add -g">
Install globally, then run.
```bash
cargo run -p sandbox-agent -- server --no-token --host 0.0.0.0 --port 2468
bun add -g @sandbox-agent/cli
# Allow Bun to run postinstall scripts for native binaries (required for SandboxAgent.start()).
bun pm -g trust @sandbox-agent/cli-linux-x64 @sandbox-agent/cli-darwin-arm64 @sandbox-agent/cli-darwin-x64 @sandbox-agent/cli-win32-x64
sandbox-agent server --no-token --host 0.0.0.0 --port 2468
```
</Tab>
<Tab title="Node.js (local)">
For local development, use `SandboxAgent.start()` to automatically spawn and manage the server as a subprocess.
```bash
npm install sandbox-agent
```
```typescript
import { SandboxAgent } from "sandbox-agent";
const client = await SandboxAgent.start();
```
</Tab>
<Tab title="TypeScript (local)">
<Tab title="Bun (local)">
For local development, use `SandboxAgent.start()` to automatically spawn and manage the server as a subprocess.
```bash
bun add sandbox-agent
# Allow Bun to run postinstall scripts for native binaries (required for SandboxAgent.start()).
bun pm trust @sandbox-agent/cli-linux-x64 @sandbox-agent/cli-darwin-arm64 @sandbox-agent/cli-darwin-x64 @sandbox-agent/cli-win32-x64
```
```typescript
import { SandboxAgent } from "sandbox-agent";
@ -116,6 +157,14 @@ icon: "rocket"
This installs the binary and starts the server for you. No manual setup required.
</Tab>
<Tab title="Build from source">
If you're running from source instead of the installed CLI.
```bash
cargo run -p sandbox-agent -- server --no-token --host 0.0.0.0 --port 2468
```
</Tab>
</Tabs>
Binding to `0.0.0.0` allows the server to accept connections from any network interface, which is required when running inside a sandbox where clients connect remotely.