seamless sandboxing (just set GEMINI_CODE_SANDBOX=true in .env) (#76)

This commit is contained in:
Olcan 2025-04-21 07:50:18 -07:00 committed by GitHub
parent bfb064024e
commit 39bdedab9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 89 additions and 28 deletions

View file

@ -1,18 +0,0 @@
#!/bin/bash
set -euo pipefail
IMAGE=gemini-code-sandbox
CLI_DIST=/usr/local/share/npm-global/lib/node_modules/\@gemini-code/cli
WORKDIR=/sandbox/$(basename "$PWD")
# use docker if installed, otherwise try to use podman instead
if command -v docker &> /dev/null; then
CMD=docker
elif command -v podman &> /dev/null; then
CMD=podman
else
echo "ERROR: docker or podman must be installed"
exit 1
fi
$CMD run -it --rm -v"$PWD:$WORKDIR" --workdir "$WORKDIR" "$IMAGE" node "$CLI_DIST"