Sandbox Labs
Running & Debugging Code
Execute code, use the terminal, read execution output, and debug with hints and Shadow Pair.
Learn how to run and debug your code in the Tedlab Academy sandbox.
Running Code
Click Run code in the editor toolbar. The cloud sandbox runs your lab entrypoint and streams output to the Execution trace panel.
Cloud IaC labs
For cloud and network tracks, add `.tf` files to your workspace and click Run code to run `terraform init`, `validate`, and `plan` automatically. If the lab provides `verify.sh` (or another `.sh` entrypoint), that script runs after Terraform. You can also run CLI commands directly in the Terminal tab.
Viewing Output
Stdout, stderr, and structured errors appear in the execution trace. Failed runs include messages to help you locate the issue.
Terminal workflow
Use the Terminal tab for interactive commands — install packages, run dev servers, or invoke `terraform` and cloud CLIs manually. The shell starts in `/home/user/workspace`, matching the files you edited.
Preview workflow
After `npm run dev` (or similar) is listening inside the VM, open Preview to load the forwarded URL in an embedded frame.
Debugging tips
Add `console.log()` (or print statements in Python labs) to trace execution. Use Stuck? Get a nudge for Socratic hints, or open Shadow Pair for conversational help.
Step-through debugger
A step-through debugger is not available yet. Use logging, the terminal, execution output, and the AI assistants for now.
Error Messages
Read error messages carefully—they usually reference the failing command or runtime error returned by the sandbox.
