Files
skillshare/scripts/sandbox_playground_shell.sh
T
Willie 570195d1a2 feat: enhance skill template, improve search UX, and harden playground
- new: redesign SKILL.md template based on Anthropic's skill-building
  guide — description now includes WHAT+WHEN trigger format, step-based
  instructions (Gather/Execute/Validate), examples, and troubleshooting
- search: prompt for keyword when run without arguments instead of
  auto-browsing popular skills
- playground: default shell to $HOME (/sandbox-home) and mount source
  as read-only to prevent accidental host file modifications
2026-02-09 21:43:10 +08:00

22 lines
708 B
Bash
Executable File

#!/usr/bin/env bash
# Enter the running Docker playground or execute a command inside it.
set -euo pipefail
source "$(dirname "$0")/_sandbox_common.sh"
SERVICE="sandbox-playground"
require_docker
cd "$PROJECT_ROOT"
if [[ -z "$(docker compose -f "$COMPOSE_FILE" --profile playground ps -q "$SERVICE")" ]]; then
echo "Playground is not running. Start it first:"
echo " ./scripts/sandbox_playground_up.sh"
exit 1
fi
if [[ $# -gt 0 ]]; then
docker compose -f "$COMPOSE_FILE" --profile playground exec -w /sandbox-home --user "$(id -u):$(id -g)" "$SERVICE" bash -c "$*"
else
docker compose -f "$COMPOSE_FILE" --profile playground exec -w /sandbox-home --user "$(id -u):$(id -g)" "$SERVICE" bash
fi