This file is auto-generated from metadata in
examples/*.py. Do not edit this file manually. Runuv run python scripts/generate_examples_md.pyinstead.
Runnable examples live in examples/.
- Blueprint with Build Context
- Devbox From Blueprint (Run Command, Shutdown)
- Devbox Snapshot and Resume
- Devbox Tunnel (HTTP Server Access)
- MCP Hub + Claude Code + GitHub
- Secrets with Devbox and Agent Gateway
Use case: Create a blueprint using the object store to provide docker build context files, then verify files are copied into the image. Uses the async SDK.
Tags: blueprint, object-store, build-context, devbox, cleanup, async
- Create a temporary directory with sample application files
- Upload the directory to object storage as build context
- Create a blueprint with a Dockerfile that copies the context files
- Create a devbox from the blueprint
- Verify the files were copied into the image
- Shutdown devbox and delete blueprint and storage object
RUNLOOP_API_KEY
uv run python -m examples.blueprint_with_build_contextuv run pytest -m smoketest tests/smoketests/examples/Source: examples/blueprint_with_build_context.py
Use case: Create a devbox from a blueprint, run a command, fetch logs, validate output, and cleanly tear everything down.
Tags: devbox, blueprint, commands, logs, cleanup
- Create a blueprint
- Fetch blueprint build logs
- Create a devbox from the blueprint
- Execute a command in the devbox
- Fetch devbox logs
- Validate exit code, stdout, and logs
- Shutdown devbox and delete blueprint
RUNLOOP_API_KEY
uv run python -m examples.devbox_from_blueprint_lifecycleuv run pytest -m smoketest tests/smoketests/examples/Source: examples/devbox_from_blueprint_lifecycle.py
Use case: Create a devbox, snapshot its disk, resume from the snapshot, and demonstrate that changes in the original devbox do not affect the clone. Uses the async SDK.
Tags: devbox, snapshot, resume, cleanup, async
- Create a devbox
- Write a file to the devbox
- Create a disk snapshot
- Create a new devbox from the snapshot
- Modify the file on the original devbox
- Verify the clone has the original content
- Shutdown both devboxes and delete the snapshot
RUNLOOP_API_KEY
uv run python -m examples.devbox_snapshot_resumeuv run pytest -m smoketest tests/smoketests/examples/Source: examples/devbox_snapshot_resume.py
Use case: Create a devbox with a tunnel, start an HTTP server, and access the server from the local machine through the tunnel. Uses the async SDK.
Tags: devbox, tunnel, networking, http, async
- Create a devbox with tunnel configuration
- Start an HTTP server inside the devbox
- Make an HTTP request from the local machine through the tunnel
- Validate the response
- Shutdown the devbox
RUNLOOP_API_KEY
uv run python -m examples.devbox_tunneluv run pytest -m smoketest tests/smoketests/examples/Source: examples/devbox_tunnel.py
Use case: Connect Claude Code running in a devbox to GitHub tools through MCP Hub without exposing raw GitHub credentials to the devbox.
Tags: mcp, devbox, github, commands, cleanup
- Create an MCP config for GitHub
- Store GitHub token as a Runloop secret
- Launch a devbox with MCP Hub wiring
- Install Claude Code and register MCP endpoint
- Run a Claude prompt through MCP tools
- Shutdown devbox and clean up cloud resources
RUNLOOP_API_KEYGITHUB_TOKEN (GitHub PAT with repo scope)ANTHROPIC_API_KEY
GITHUB_TOKEN=ghp_xxx ANTHROPIC_API_KEY=sk-ant-xxx uv run python -m examples.mcp_github_toolsuv run pytest -m smoketest tests/smoketests/examples/Source: examples/mcp_github_tools.py
Use case: Use a normal secret for sensitive app data in the devbox and agent gateway for upstream API credentials that should never be exposed to the agent.
Tags: secrets, devbox, agent-gateway, credentials, environment-variables, cleanup
- Create a secret for application data that should be available inside the devbox
- Create a separate secret for an upstream API credential
- Create an agent gateway config for an upstream API
- Launch a devbox with one secret injected directly and the credential wired through agent gateway
- Verify the devbox can read MAGIC_NUMBER while the upstream API credential is replaced with gateway values
- Shutdown the devbox and delete the gateway config and both secrets
RUNLOOP_API_KEY
uv run python -m examples.secrets_with_devboxuv run pytest -m smoketest tests/smoketests/examples/Source: examples/secrets_with_devbox.py