.agents/skills/local-env/SKILL.md
Start the local sandbox-api development environment with hot-reload. Use when developing or testing changes to the sandbox-api Go code locally.
npx skillsauth add blaxel-ai/sandbox dev-environmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The sandbox-api runs inside Docker with Air for hot-reload. Changes to Go files in sandbox-api/ are picked up automatically without restarting the container.
Install dev dependencies (one-time):
make dependencies
This installs:
air — hot-reload for Goswag — OpenAPI doc generationyq — YAML processor (via brew)Important: Before starting, kill any existing process on port 8080:
lsof -ti :8080 | xargs kill -9 2>/dev/null || true
docker-compose up dev
This starts the dev service defined in docker-compose.yaml, which:
docker/alpine.Dockerfile./sandbox-api and ./tmp as volumesSANDBOX_DEV_MODE=true8080 (sandbox-api) and 3010air for hot-reloadWait for this log line before testing:
Starting Sandbox API server on :8080
curl http://localhost:8080/health
Or test the filesystem endpoint:
curl http://localhost:8080/filesystem/~
If you want to skip Docker and run air directly on the host:
lsof -ti :8080 | xargs kill -9 2>/dev/null || true
make api
This runs air with SANDBOX_LOG_DIR=./tmp/log from the sandbox-api/ directory. Requires Go installed locally.
For testing the production-like image without hot-reload:
docker-compose up dev-slim
This builds from docker/slim.Dockerfile — no volume mounts, no hot-reload.
make test
Runs go test -v ./... from within sandbox-api/. These are fast in-process tests.
make docker-build
Builds blaxel/sandbox-api:latest. To run it:
make docker-run
Dev logs are written to ./tmp/log/ on the host (mounted from the container). Tail them with:
tail -f tmp/log/*.log
development
Regenerate the OpenAPI reference documentation after adding, modifying, or removing API endpoints in sandbox-api. Run this whenever handler signatures, route paths, or swag annotations change.
development
Run the sandbox-api integration tests against a live API instance. Use after making changes to sandbox-api to verify all endpoints still work correctly.
development
Run the full end-to-end test suite against a custom sandbox image deployed locally or on Blaxel. Use before merging significant changes to validate the complete sandbox-api binary, not just unit/integration tests.
testing
Deploy a Playwright sandbox (chromium or firefox) on Blaxel and run e2e tests against it. Use to validate that playwright hub images work end-to-end (browser connection, page navigation, DOM interaction) after changes.