### Install Dependencies and Start Server Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Installs required Python packages and starts the backend server in the background. ```bash uv run sbx exec sbx_todo123 "/home/user/.local/bin/uv pip install --system fastapi uvicorn pydantic" --timeout 120 uv run sbx exec sbx_todo123 "python main.py" --background --cwd /home/user/app/backend ``` -------------------------------- ### Install and Configure Sandbox CLI Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Setup the environment by installing dependencies and configuring the E2B API key. ```bash # Navigate to the CLI directory cd .claude/skills/agent-sandboxes/sandbox_cli # Install dependencies uv sync # Configure environment - create .env in project root with your E2B API key echo "E2B_API_KEY=sbx_your_api_key_here" >> ../../../../.env # Verify CLI is working uv run sbx --help ``` -------------------------------- ### Start Frontend Server Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Starts a Python HTTP server in the background within the specified sandbox to serve the frontend application. Ensure the sandbox ID and working directory are correct. ```bash uv run sbx exec sbx_todo123 "python -m http.server 5173" --background --cwd /home/user/app/frontend ``` -------------------------------- ### Start Browser for Agent 1 Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Starts a browser instance for Agent 1 on a unique port. Ensure the port is not used by other agents. ```bash uv run sbx browser start --port 9222 ``` -------------------------------- ### Start Browser for Agent 2 Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Starts a browser for Agent 2 on a distinct port, ensuring isolation from other agents. ```bash uv run sbx browser start --port 9223 ``` -------------------------------- ### Validation Examples Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_design_system_palette.md Example cURL commands for validating backend API endpoints. ```APIDOC ## Generate Harmony ```bash curl -X POST http://localhost:8000/api/generate/harmony \ -H "Content-Type: application/json" \ -d '{"brand_color":"#6366F1","harmony_type":"triadic"}' ``` ## Check Contrast ```bash curl -X POST http://localhost:8000/api/accessibility/contrast \ -H "Content-Type: application/json" \ -d '{"foreground":"#FFFFFF","background":"#6366F1"}' ``` ## Export CSS ```bash curl http://localhost:8000/api/palettes/1/export?format=css ``` ``` -------------------------------- ### GET /api/settings Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_nano_banana_simple.md Checks the status of the API key configuration. ```APIDOC ## GET /api/settings ### Description Retrieves the current API key status. ### Method GET ### Endpoint /api/settings ``` -------------------------------- ### Backend Logic Pseudocode Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/very_easy_counter.md Outlines the required logic for the GET and POST endpoints. ```text GET /api/count: - Query counter value from database - Return JSON with current value POST /api/count: - Accept action parameter (increment, decrement, or reset) - Update database accordingly - Return updated counter value ``` -------------------------------- ### Backend Testing with cURL Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/very_easy_calculator.md Provides example cURL commands to test the backend API endpoints. Includes fetching history, performing a calculation, and directly querying the SQLite database. ```bash # Backend test curl http://localhost:8000/api/history # Calculate curl -X POST http://localhost:8000/api/calculate \ -H "Content-Type: application/json" \ -d '{"expression":"5 + 3"}' # Verify database sqlite3 calculator.db "SELECT * FROM calculations" ``` -------------------------------- ### Get DOM Structure Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Retrieves the DOM structure in simplified or full HTML format. ```bash uv run sbx browser dom # Simplified DOM uv run sbx browser dom --full # Full HTML ``` -------------------------------- ### GET /static/images/{filename} Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_nano_banana_simple.md Serves a specific image file from the static storage. ```APIDOC ## GET /static/images/{filename} ### Description Serves the requested image file. ### Method GET ### Endpoint /static/images/{filename} ### Parameters #### Path Parameters - **filename** (string) - Required - The name of the image file to retrieve. ``` -------------------------------- ### Browser Automation Commands Source: https://context7.com/disler/agent-sandbox-skill/llms.txt A sequence of commands to start a browser, navigate to a URL, evaluate JavaScript, take a screenshot, and close the browser for validation purposes. ```bash uv run sbx browser start ``` ```bash uv run sbx browser nav https://5173-sbx_todo123.e2b.app ``` ```bash uv run sbx browser eval "document.readyState" ``` ```bash uv run sbx browser eval "document.querySelector('h1')?.textContent" ``` ```bash uv run sbx browser screenshot --path todo-app-validation.png ``` ```bash uv run sbx browser close ``` -------------------------------- ### Initialize New Sandboxes Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Create new sandboxes with specific configurations and templates. ```bash # Basic initialization with 30-minute timeout uv run sbx init --timeout 1800 # Output: ✓ Sandbox created successfully! # Sandbox ID: sbx_abc123def456 # Store this ID in your context for all subsequent commands # Initialize with specific template and environment variables uv run sbx init --template fullstack-vue-fastapi-node22 --timeout 43200 --name my-workflow --env API_KEY=secret --env DEBUG=true # Output: ✓ Sandbox created successfully! # Sandbox ID: sbx_xyz789ghi012 # Name: my-workflow # Template: fullstack-vue-fastapi-node22 # Available templates with resource tiers: # - fullstack-vue-fastapi-node22 (2 vCPU, 2GB RAM) - Simple apps (default) # - fullstack-vue-fastapi-node22-lite (2 vCPU, 4GB RAM) - Browser tests # - fullstack-vue-fastapi-node22-standard (4 vCPU, 4GB RAM) - Parallel builds # - fullstack-vue-fastapi-node22-heavy (4 vCPU, 8GB RAM) - Multi-browser # - fullstack-vue-fastapi-node22-max (8 vCPU, 8GB RAM) - Fastest execution ``` -------------------------------- ### Initialize Sandbox Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Initializes a new sandbox environment from a template. ```bash cd .claude/skills/agent-sandboxes/sandbox_cli uv run sbx init --template fullstack-vue-fastapi-node22 --timeout 43200 --name my-todo-app ``` -------------------------------- ### Create Project Structure Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Creates directories within the sandbox environment. ```bash uv run sbx files mkdir sbx_todo123 /home/user/app uv run sbx files mkdir sbx_todo123 /home/user/app/frontend uv run sbx files mkdir sbx_todo123 /home/user/app/backend ``` -------------------------------- ### GET /api/todos Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_todo_list.md Retrieve a list of all todo items. ```APIDOC ## GET /api/todos ### Description Retrieve all todo items from the system. ### Method GET ### Endpoint /api/todos ``` -------------------------------- ### Configure Environment Variable Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md Copy the sample environment file and add your E2B API key to the .env file. ```bash cp .env.sample .env E2B_API_KEY=sbx_... ``` -------------------------------- ### Get Cookies Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Retrieves browser cookies as a JSON array. ```bash uv run sbx browser cookies ``` -------------------------------- ### Bash Command for Documentation Prerequisite Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_nano_banana_simple.md This command instructs the user to read the prerequisite documentation for the Gemini Nano Banana model. ```bash Read ai_docs/gemini-3-nano-banana.md ``` -------------------------------- ### Create FastAPI Backend Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Writes the backend application code to the sandbox. ```bash uv run sbx files write sbx_todo123 /home/user/app/backend/main.py " from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel from typing import List import sqlite3 app = FastAPI() app.add_middleware( CORSMiddleware, allow_origins=['*'], allow_credentials=True, allow_methods=['*'], allow_headers=['*'], ) class Todo(BaseModel): id: int = None title: str completed: bool = False def init_db(): conn = sqlite3.connect('todos.db') conn.execute('CREATE TABLE IF NOT EXISTS todos (id INTEGER PRIMARY KEY, title TEXT, completed BOOLEAN)') conn.close() init_db() @app.get('/api/todos', response_model=List[Todo]) def get_todos(): conn = sqlite3.connect('todos.db') cursor = conn.execute('SELECT id, title, completed FROM todos') todos = [Todo(id=row[0], title=row[1], completed=bool(row[2])) for row in cursor.fetchall()] conn.close() return todos @app.post('/api/todos', response_model=Todo) def create_todo(todo: Todo): conn = sqlite3.connect('todos.db') cursor = conn.execute('INSERT INTO todos (title, completed) VALUES (?, ?)', (todo.title, todo.completed)) todo.id = cursor.lastrowid conn.commit() conn.close() return todo if __name__ == '__main__': import uvicorn uvicorn.run(app, host='0.0.0.0', port=8000) " ``` -------------------------------- ### GET /api/directories Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/medium_file_explorer.md Retrieves the root directory tree structure. ```APIDOC ## GET /api/directories ### Description Retrieves the root directory tree structure for the file explorer. ### Method GET ### Endpoint /api/directories ``` -------------------------------- ### Initialize Sandbox for Agent 1 Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Initializes a new sandbox for Agent 1 with a specified timeout. The sandbox ID should be captured in the agent's context memory, not shell variables. ```bash uv run sbx init --timeout 1800 ``` -------------------------------- ### GET /api/current Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_nano_banana_simple.md Retrieves the most recently generated image information. ```APIDOC ## GET /api/current ### Description Fetches the metadata for the current image stored in the system. ### Method GET ### Endpoint /api/current ``` -------------------------------- ### Get Accessibility Tree Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Retrieves a JSON snapshot of the accessibility tree. ```bash uv run sbx browser a11y ``` -------------------------------- ### Run Browser Testing Prompts Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md Executes browser UI testing workflows against a hosted sandbox URL. ```bash # Claude Code only - requires subagent support (parallel=true, headed=true) /generic-browser-test https://www.anthropic.com/news/claude-opus-4-5 prompts/browser-workflows/opus-4-5-release.md true true # Sandbox app browser tests (replace with actual sandbox URL) /generic-browser-test prompts/browser-workflows/easy_chart_sketch_browser_test.md true true /generic-browser-test prompts/browser-workflows/easy_decision_matrix_browser_test.md true true /generic-browser-test prompts/browser-workflows/easy_design_system_palette_browser_test.md true true /generic-browser-test prompts/browser-workflows/medium_chart_sketch_pro_browser_test.md true true # For other agentic coding tools, make sure subagents is false \generic-browser-test prompts/browser-workflows/easy_chart_sketch_browser_test.md false true ``` -------------------------------- ### Manage Sandbox Lifecycle Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Perform operations to create, connect, pause, resume, and monitor sandbox instances. ```bash # Create a new sandbox with auto-pause enabled uv run sbx sandbox create --template base --timeout 1800 --auto-pause --env PROJECT=myapp # Output: ✓ Sandbox created: sbx_create123 # Connect to an existing sandbox (also resumes paused sandboxes) uv run sbx sandbox connect sbx_abc123def456 # Output: ✓ Connected to sandbox: sbx_abc123def456 # Status: Running # Get detailed sandbox information including resource metrics uv run sbx sandbox info sbx_abc123def456 # Output: Table showing Sandbox ID, Template, State, Started At, Expires At, Time Remaining # Plus resource metrics: CPU usage, Memory (used/total), Disk (used/total) # Check if sandbox is running uv run sbx sandbox status sbx_abc123def456 # Output: ✓ Sandbox sbx_abc123def456 is running # Pause a sandbox (beta feature) - preserves state for up to 30 days uv run sbx sandbox pause sbx_abc123def456 # Output: ✓ Sandbox paused # Use 'connect' to resume # Extend sandbox lifetime by adding time to remaining duration uv run sbx sandbox extend-lifetime sbx_abc123def456 3600 # Add 1 hour uv run sbx sandbox extend-lifetime sbx_abc123def456 10800 # Add 3 hours uv run sbx sandbox extend-lifetime sbx_abc123def456 43200 # Add 12 hours # Output: ✓ Sandbox lifetime extended # Added: 1h # Previous remaining: 25m # New remaining: 1h 25m # List all running sandboxes uv run sbx sandbox list --limit 20 # Output: Table with Sandbox ID, Public URL, State, Template, Started At, Metadata # Get public hostname for an exposed port uv run sbx sandbox get-host sbx_abc123def456 --port 5173 # Output: ✓ Public URL: https://5173-sbx_abc123def456.e2b.dev # CRITICAL: Always use this command to get URLs, never construct them manually # Kill a sandbox (only when explicitly requested) uv run sbx sandbox kill sbx_abc123def456 # Output: ✓ Sandbox killed ``` -------------------------------- ### GET /api/history Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/very_easy_calculator.md Retrieves the full list of past calculations stored in the database. ```APIDOC ## GET /api/history ### Description Retrieves all calculation history records from the database. ### Method GET ### Endpoint /api/history ### Response #### Success Response (200) - **id** (integer) - Unique identifier - **expression** (string) - The calculated expression - **result** (float) - The result of the calculation - **timestamp** (string) - The time the calculation was performed #### Response Example [ { "id": 1, "expression": "5 + 3", "result": 8, "timestamp": "2023-10-27T10:00:00Z" } ] ``` -------------------------------- ### Automate Browser Tasks Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Initialize and control a headless Chromium browser for UI automation and testing. ```bash uv run sbx browser init ``` ```bash uv run sbx browser start ``` ```bash uv run sbx browser start --headed ``` ```bash uv run sbx browser start --port 9223 ``` ```bash uv run sbx browser start --mobile ``` -------------------------------- ### GET /api/directories/{id} Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/medium_file_explorer.md Retrieves details for a specific directory, including its children. ```APIDOC ## GET /api/directories/{id} ### Description Get directory details with children. ### Method GET ### Endpoint /api/directories/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the directory. ``` -------------------------------- ### Python API Integration for Image Generation Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_nano_banana_simple.md Demonstrates how to use the google-genai library to generate an image from a prompt and save it locally. Ensure the API key is correctly configured. ```python from google import genai from google.genai import types client = genai.Client(api_key=settings.api_key) response = client.models.generate_content( model=model, contents=[prompt], config=types.GenerateContentConfig( response_modalities=['IMAGE'], image_config=types.ImageConfig( aspect_ratio=aspect_ratio ) ) ) # Save single image for part in response.parts: if part.inline_data is not None: image = part.as_image() image.save("static/images/current.png") ``` -------------------------------- ### Navigate to URL Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Navigates the browser to a specified URL. ```bash uv run sbx browser nav https://5173-sbx_abc123.e2b.app ``` -------------------------------- ### Run Simple Agent Sandbox Task Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md Use the \sandbox command followed by a prompt to execute a simple task within an agent sandbox. ```bash \sandbox ``` -------------------------------- ### GET /api/files/{id}/content Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/medium_file_explorer.md Retrieves the content of a specific file for preview purposes. ```APIDOC ## GET /api/files/{id}/content ### Description Get file content (for preview). ### Method GET ### Endpoint /api/files/{id}/content ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the file. ``` -------------------------------- ### Read Nano Banana Documentation Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/medium_nano_banana_generator.md Command to access the specific documentation file for the Nano Banana API. ```bash Read ai_docs/gemini-3-nano-bannana.md ``` -------------------------------- ### GET /api/search Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/medium_file_explorer.md Searches for files and folders based on a query string and optional file type filter. ```APIDOC ## GET /api/search ### Description Search files and folders. ### Method GET ### Endpoint /api/search ### Parameters #### Query Parameters - **q** (string) - Required - The search query string. - **type** (string) - Optional - The file type to filter by. ``` -------------------------------- ### Run Complex Agent Sandbox Workflow Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md Use the \plan-build-host-test command for complex tasks, providing the prompt and a workflow ID. ```bash \plan-build-host-test ``` -------------------------------- ### Validate API Endpoints via cURL Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_design_system_palette.md Example cURL commands to test harmony generation, accessibility contrast checks, and CSS export functionality. ```bash # Generate harmony curl -X POST http://localhost:8000/api/generate/harmony \ -H "Content-Type: application/json" \ -d '{"brand_color":"#6366F1","harmony_type":"triadic"}' # Check contrast curl -X POST http://localhost:8000/api/accessibility/contrast \ -H "Content-Type: application/json" \ -d '{"foreground":"#FFFFFF","background":"#6366F1"}' # Export CSS curl http://localhost:8000/api/palettes/1/export?format=css ``` -------------------------------- ### API Endpoint for Getting a Specific Decision Source: https://github.com/disler/agent-sandbox-skill/blob/main/prompts/full_stack/sonnet/easy_decision_matrix.md Fetches a single decision along with its associated options, criteria, and scores. Use this to load and display a detailed decision. ```http GET /api/decisions/{id} - Get decision with options, criteria, scores ``` -------------------------------- ### Execute Very Hard Prompts Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md Runs the plan-build-host-test workflow for various complex project prompts. ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/codex/very_hard_analytics_ops_monitoring_hub.md)" "very_hard_analytics_ops_monitoring_hub" \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/codex/very_hard_iot_fleet_maintenance_console.md)" "very_hard_iot_fleet_maintenance_console" \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/codex/very_hard_micro_betting_odds_lab.md)" "very_hard_micro_betting_odds_lab" \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/codex/very_hard_personal_investing_allocator.md)" "very_hard_personal_investing_allocator" \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/codex/very_hard_scriptwriter_automation_workbench.md)" "very_hard_scriptwriter_automation_workbench" \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/sonnet/very_hard_knowledge_base.md)" "very_hard_knowledge_base" \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/sonnet/very_hard_system_monitor.md)" "very_hard_system_monitor" ``` -------------------------------- ### Get Public URL Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Retrieves the public URL for a service running on a specific port within a sandbox. Always use `get-host` to ensure correct URL construction. ```bash uv run sbx sandbox get-host sbx_todo123 --port 5173 ``` -------------------------------- ### Access Sandbox CLI Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md Manual CLI usage for debugging and inspection of sandbox environments. ```bash # From .claude/skills/agent-sandboxes/sandbox_cli/ uv run sbx --help ``` -------------------------------- ### Navigate to URL for Agent 2 Source: https://context7.com/disler/agent-sandbox-skill/llms.txt Directs Agent 2's browser to its corresponding sandbox URL. Use unique ports for each agent's browser. ```bash uv run sbx browser nav https://5173-sbx_agent2_xyz.e2b.app --port 9223 ``` -------------------------------- ### Manual CLI Commands Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md Direct CLI commands for debugging and inspection of sandboxes. ```APIDOC ## uv run sbx exec ### Description Executes a command within a specific sandbox. ### Parameters - **sandbox_id** (string) - Required - The target sandbox ID. - **command** (string) - Required - The shell command to execute. ## uv run sbx files ls ### Description Lists files within a specific directory in the sandbox. ### Parameters - **sandbox_id** (string) - Required - The target sandbox ID. - **path** (string) - Required - The directory path to list. ``` -------------------------------- ### Execute Very Easy Prompts with Agent Sandboxes Source: https://github.com/disler/agent-sandbox-skill/blob/main/README.md These commands execute predefined 'very easy' prompts for various applications using different models and workflow IDs. ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/codex/very_easy_guestbook.md)" "very_easy_guestbook" ``` ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/codex/very_easy_url_shortener.md)" "very_easy_url_shortener" ``` ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/gemini/very_easy_counter.md)" "very_easy_counter" ``` ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/gemini/very_easy_poll_maker.md)" "very_easy_poll_maker" ``` ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/sonnet/very_easy_calculator.md)" "very_easy_calculator" ``` ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/sonnet/very_easy_counter.md)" "very_easy_counter" ``` ```bash \agent-sandboxes:plan-build-host-test "$(cat prompts/full_stack/sonnet/very_easy_greeter.md)" "very_easy_greeter" ```