From 051ab58c50645a403e6de9b866f207dfb8da03c8 Mon Sep 17 00:00:00 2001 From: Brandon Keiji Date: Tue, 29 Apr 2025 02:11:07 +0000 Subject: [PATCH] refactor: cleanup references to sandbox prototype (#208) --- packages/cli/bin/sandbox.sh | 52 ------------------------------------- packages/cli/package.json | 3 +-- 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100755 packages/cli/bin/sandbox.sh diff --git a/packages/cli/bin/sandbox.sh b/packages/cli/bin/sandbox.sh deleted file mode 100755 index 7cfada0f..00000000 --- a/packages/cli/bin/sandbox.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -REGISTRY="us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers" # TODO: swap this to public registry before launch -IMAGE="gemini-code" -TAG="0.1.0-fakeversion" # TODO: make this more configurable -PROJECT=$(basename "$PWD") -WORKDIR=/sandbox/$PROJECT - -# use interactive tty mode and auto-remove container on exit -run_args=(-it --rm) - -# mount current directory as $WORKDIR inside container -run_args+=(-v "$PWD:$WORKDIR") - -# name container after image, plus numeric suffix to avoid conflicts -INDEX=0 -while docker ps -a --format "{{.Names}}" | grep -q "$IMAGE-$INDEX"; do - INDEX=$((INDEX + 1)) -done -run_args+=(--name "$IMAGE-$INDEX" --hostname "$IMAGE-$INDEX") - -# copy GEMINI_API_KEY -if [ -n "${GEMINI_API_KEY:-}" ]; then run_args+=(--env GEMINI_API_KEY="$GEMINI_API_KEY"); fi - -# copy GEMINI_CODE_MODEL -if [ -n "${GEMINI_CODE_MODEL:-}" ]; then run_args+=(--env GEMINI_CODE_MODEL="$GEMINI_CODE_MODEL"); fi - -# copy TERMINAL_TOOL to optionally revert to old terminal tool -if [ -n "${TERMINAL_TOOL:-}" ]; then run_args+=(--env TERMINAL_TOOL="$TERMINAL_TOOL"); fi - -# copy TERM and COLORTERM to try to maintain terminal setup -if [ -n "${TERM:-}" ]; then run_args+=(--env TERM="$TERM"); fi -if [ -n "${COLORTERM:-}" ]; then run_args+=(--env COLORTERM="$COLORTERM"); fi - -# set SANDBOX environment variable as container name -# this is the preferred mechanism to detect if inside container/sandbox -run_args+=(--env "SANDBOX=$IMAGE:$TAG-$INDEX") - -docker run "${run_args[@]}" --init --workdir "$WORKDIR" "$REGISTRY/$IMAGE:$TAG" \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index c2e8ba2c..0a5c327b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -5,8 +5,7 @@ "type": "module", "main": "dist/index.js", "bin": { - "gemini-code": "dist/index.js", - "gemini-code-sandbox": "bin/sandbox.sh" + "gemini-code": "dist/index.js" }, "image": "us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-cli", "scripts": {