Local env

From blaxel-ai/sandbox · View interactive version

Local env is an AI agent skill from the GitHub repository blaxel-ai/sandbox. Start the local sandbox-api development environment with hot-reload. Use when developing or testing changes to the sandbox-api Go code locally.

How to use this skill

Skill file

Start the Local Dev Environment

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.

Prerequisites

Install dev dependencies (one-time):

make dependencies

This installs:


Start the Dev Server

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:

Wait for this log line before testing:

Starting Sandbox API server on :8080

Verify It's Running

curl http://localhost:8080/health

Or test the filesystem endpoint:

curl http://localhost:8080/filesystem/~

Alternative: Run Without Docker (Faster Iteration)

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.


Slim Dev Image (No Source Mount)

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.


Run Unit Tests

make test

Runs go test -v ./... from within sandbox-api/. These are fast in-process tests.


Build the Docker Image

make docker-build

Builds blaxel/sandbox-api:latest. To run it:

make docker-run

Logs

Dev logs are written to ./tmp/log/ on the host (mounted from the container). Tail them with:

tail -f tmp/log/*.log
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.