From 49b5db29b34bba2dcef68ae82d6843c520bab93c Mon Sep 17 00:00:00 2001 From: Brandon Keiji Date: Wed, 7 May 2025 14:46:47 +0000 Subject: [PATCH] feat: add build:sandbox and build:all npm scripts (#274) --- README.md | 2 +- package.json | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e0c2ef5..82d71888 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Chances are you will need to manually address errors output. You can also try `n ## Sandboxing -To enable sandboxing, set `GEMINI_CODE_SANDBOX=true|docker|podman|` in your environment or `.env` file. Once enabled, `npm run build` will build a minimal container ("sandbox") image and `npm start` will launch inside a fresh instance of that container. Requires the specified command (or if `true` then either `docker` or `podman`) to be available on host machine. +To enable sandboxing, set `GEMINI_CODE_SANDBOX=true|docker|podman|` in your environment or `.env` file. Once enabled, `npm run build:all` will build a minimal container ("sandbox") image and `npm start` will launch inside a fresh instance of that container. Requires the specified command (or if `true` then either `docker` or `podman`) to be available on host machine. The sandbox (container) mounts the current directory with read-write access and is started/stopped/removed automatically as you start/stop Gemini Code. You can tell you are inside the sandbox with the `cwd` being reported as `/sandbox/`. Files created within the sandbox should be automatically mapped to your user/group on host machine. diff --git a/package.json b/package.json index 14ba7580..c6a2b76c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "packages/*" ], "scripts": { - "build": "BUILD_SANDBOX=1 scripts/build.sh", + "build": "scripts/build.sh", + "build:sandbox": "scripts/build_sandbox.sh", + "build:all": "npm run build && npm run build:sandbox", "clean": "scripts/clean.sh", "test": "npm run test --workspaces", "start": "NODE_ENV=development scripts/start.sh",