lightbox

Coding agents preset

Bake a snapshot with copilot, gemini, codex, and pi preinstalled.

The codingAgentsPreset is a PresetConfig that installs four CLIs on top of oven/bun. Build it once, then boot sandboxes in 100 ms whenever you need an isolated agent environment.

// build.ts
import { buildSnapshot } from "@beamhop/lightbox";
import { codingAgentsPreset } from "@beamhop/lightbox/presets";

const config = codingAgentsPreset({ name: "lightbox" });

await buildSnapshot(config);
console.log(`\nSnapshot "${config.name}" ready.`);
// launch.ts
import { launchSandbox } from "@beamhop/lightbox";

const name = process.argv[2] ?? "lightbox-1";

const sb = await launchSandbox({
  snapshot: "lightbox",
  name,
  resources: { cpus: 2, memory: "2G" },
});
await sb.detach();  // keep running after this script exits

console.log(`\nSandbox "${name}" running.`);
// verify.ts — from a SEPARATE process
import { connectToSandbox } from "@beamhop/lightbox";

const sb = await connectToSandbox(process.argv[2] ?? "lightbox-1");
for (const cli of ["copilot", "gemini", "codex", "pi"]) {
  const r = await sb.shell(`command -v ${cli} && ${cli} --version 2>&1 | head -1`);
  process.stdout.write(`[${cli}] ${r.success ? "OK" : "FAIL"}: ${r.stdout().trim()}\n`);
}