[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116501":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":29,"discoverSource":30},116501,"gke-sandboxes","comp-work\u002Fgke-sandboxes","comp-work","Self-hosted workspace sandboxes on GKE with gVisor and filesystem snapshots.",null,"TypeScript",156,14,75,2,0,3,33,17,69.33,"Apache License 2.0",false,"main",true,[],"2026-11-23 02:49:00","2026-11-23 18:53:58","# gke-sandboxes\n\nGive each cloud agent its own Linux sandbox, in your own Google Cloud project. A sandbox runs commands and keeps files. Put it to sleep while the user is away, and open the same ID later to get the files back.\n\nA 2 vCPU \u002F 4 GB sandbox costs about **1.9¢ for each hour it is awake**, cluster overhead included. Daytona and E2B list 16.6¢ for the same hour. A sleeping sandbox costs only its storage.\n\n\u003Cpicture>\n  \u003Csource media=\"(max-width: 600px)\" srcset=\"docs\u002Fassets\u002Frunning-sandbox.png\">\n  \u003Cimg src=\"docs\u002Fassets\u002Frunning-sandbox-wide.png\" width=\"100%\" alt=\"Cost in US cents for each hour a 2 vCPU and 4 GB sandbox is awake, at about 4% CPU. gke-sandboxes costs an estimated 1.9¢, the whole cluster bill divided by the hours its sandboxes are awake (1×). At list price for compute, Modal 3.5¢ (1.8×), Fly.io 9.2¢ (4.7×), Vercel Sandbox 9.5¢ (4.9×), Daytona 16.6¢ (8.5×), and E2B 16.6¢ (8.5×). Managed disk and plan fees are extra.\">\n\u003C\u002Fpicture>\n\n## Set it up\n\nPaste this into Claude Code, Cursor, Codex or another coding agent:\n\n```text\nSet up gke-sandboxes in my Google Cloud project. Follow these instructions step by step:\nhttps:\u002F\u002Fraw.githubusercontent.com\u002Fcomp-work\u002Fgke-sandboxes\u002Fmain\u002Fskills\u002Fsetup-gke-sandboxes\u002FSKILL.md\n```\n\nThe agent deploys the cluster with Terraform, runs the verifier, and shows you how to connect your backend. Or [deploy it by hand](docs\u002Fdeploy.md).\n\nThen use it from your backend, on Node.js 22+ or Bun:\n\n```sh\nnpm install @getenergy\u002Fgke-sandboxes\n```\n\n```ts\nimport { GkeSandboxes, KubernetesApi } from '@getenergy\u002Fgke-sandboxes';\n\nconst sandboxes = new GkeSandboxes(new KubernetesApi(clusterUrl, getGoogleAccessToken), {\n  namespace: 'sandboxes',\n  serviceAccount: 'sandbox',\n  image: 'docker.io\u002Flibrary\u002Fdebian:bookworm-slim',\n});\n\n\u002F\u002F Creates the sandbox, returns the running one, or wakes it from its snapshot.\nconst { sandbox } = await sandboxes.acquire('session-42', AbortSignal.timeout(300_000));\nconst { exitCode, result } = await sandbox.process.executeCommand('echo hello');\nawait sandboxes.sleep(sandbox.id);\n```\n\n[Full client guide](docs\u002Fclient.md)\n\n## Features\n\n- **Sleep and wake.** A sleeping sandbox is a snapshot in Cloud Storage and uses no CPU or memory. Opening its ID wakes it with its files.\n- **Idle sandboxes sleep on their own.** A sweeper puts a sandbox to sleep after five minutes without use.\n- **Isolated.** Each sandbox is its own gVisor pod, with incoming traffic blocked and no access to your cloud credentials.\n- **Your image.** Use any container image with a POSIX shell.\n- **Commands and files.** Run commands with timeouts and streamed output. Upload and download files.\n- **Memory guard.** A runaway program is ended before it takes the whole sandbox down.\n- **Warm pool.** Keep a few sandboxes ready so a new session starts in under half a second.\n- **Preview links.** An example proxy serves a sandbox’s web server through signed links that expire.\n- **Hooks.** Callbacks report every operation’s timing and failures to your own logging.\n\n[Client guide](docs\u002Fclient.md) · [Operating limits](docs\u002Flimits.md)\n\n## How it compares\n\nCosts are for one sandbox at 2 vCPU and 4 GB. Managed providers are at list prices for compute and storage only. Timings used 4 vCPU and 8 GB.\n\n#### Cost while awake\n\nEvery bar in the chart above prices the same mostly idle sandbox, at the 0.076 vCPU that Energy’s running sandboxes averaged, about 4% of 2 vCPU. Daytona, E2B and Fly.io charge for the full size while it runs. Vercel charges for the CPU in use and all of the memory. Modal charges for what is used. The GKE figure is a whole cluster bill divided by its sandboxes: 520 awake at 56 to a machine, with two spare machines, node disks, system nodes, the cluster fee and snapshot storage. It needs that scale. A small cluster still pays for its minimum machines. Over a 730-hour month awake, 1.9¢ an hour is $14.22. Packed tighter on C4D machines, the GKE compute estimate falls to about $7.80 a month, or 1.1¢ an hour.\n\n#### Cost while asleep\n\nA sleeping sandbox is a snapshot in Cloud Storage. Machines you keep running still appear on your bill.\n\n\u003Cimg src=\"docs\u002Fassets\u002Fmonthly-cost.png\" width=\"100%\" alt=\"Storage for 20 GB retained for 730 hours. GKE snapshot about $0.37, Vercel Sandbox snapshot $1.60 on Pro, Daytona archived container $0, E2B paused sandbox $0 extra on Pro. Plan fees and infrastructure are excluded.\">\n\n#### Start and wake\n\nMedians. The GKE start time is with two sandboxes kept ready; without one it is about 2.7 s. The other providers were timed by Sandbox Bench from a different region, so read the rows as neighbors, not a ranking. GKE wakes slower than most, and slower still with many files: about 6.5 s at 25,000 files.\n\n\u003Cimg src=\"docs\u002Fassets\u002Fsandbox-lifecycle.png\" width=\"100%\" alt=\"Median fresh start, snapshot save and start from snapshot for GKE and ten managed configurations. All timings are in the table below.\">\n\n#### Speed once running\n\nBuilding Better Auth took 67 s on a C4D machine with one sandbox, and 81 s on a machine packed with 95 idle ones. We have no build timings for the managed providers.\n\n#### What sleep keeps\n\ngke-sandboxes restores files, not running processes. E2B can keep memory through sleep.\n\n#### When a managed provider fits better\n\nThe trade is that you run the cluster: capacity, upgrades and recovery are yours. A managed provider is the better choice if you need only a handful of sandboxes, running processes that survive sleep, GPUs, or a VM kernel per sandbox.\n\n[Full comparison, with sources and method](docs\u002Fcomparison.md)\n","gke-sandboxes 是一个在 Google Kubernetes Engine（GKE）上自托管轻量级 Linux 工作区沙箱的开源方案，支持 gVisor 隔离与文件系统快照。核心功能包括沙箱的按需唤醒\u002F休眠（休眠时仅消耗存储费用）、基于空闲超时的自动睡眠、进程级资源隔离、内存用量保护、预热池加速启动，以及文件上传\u002F下载和命令执行能力。适用于 AI 编程助手（如 Claude、Cursor）、云原生 IDE 后端、自动化代码评测、安全沙箱化 CLI 执行等需要低成本、高隔离性、状态持久化临时计算环境的场景。","2026-11-24 04:53:42","CREATED_QUERY"]