Read this when you need to clone a GitHub repository and run tests or commands in the repo context.
Clone this GitHub repo and run its tests
Test this repository in a sandbox
Clone and build this project
cd .claude/skills/agent-sandboxes/sandbox_cli
grep "E2B_API_KEY" ../../../../.envRepositories may take longer to clone and test, so increase the timeout:
uv run sbx init --timeout 900
# YOU capture and remember: sandbox_id = "sbx_repo123test"uv run sbx exec sbx_repo123test "git clone https://github.com/user/repo /home/user/repo"Use --cwd to run commands in the repository directory:
uv run sbx exec sbx_repo123test "pip install -r requirements.txt && pytest" --cwd /home/user/repo --shell --timeout 300Key flags:
--cwd /home/user/repo- Run in the repo directory--shell- Enable shell features for&&--timeout 300- Give tests enough time to complete
uv run sbx sandbox kill sbx_repo123test- Use longer timeout when initializing (--timeout 900 or more)
- Clone to
/home/user/directory for easy access - Use
--cwdflag to run commands in specific directories (better thancd) - Use
--shellwhen chaining commands with&& - Increase timeout for long-running tests with
--timeout - Git is pre-installed in E2B sandboxes
- Always clean up the sandbox when done