E2B_API_KEY and E2B_API_URL=https://api.styne.ai set (Switch from E2B). The base template has git.
Clone, change, commit
The first example needs no network and no account: it makes a bare repository inside the sandbox to act asorigin, so you
can run the whole loop and see every step. Replace that repository with your own remote in the next section.
origin, with its own hash:
Use your own repository and a token
Pass the token to the one command that needs it, as an environment variable of that command. It is never written into a URL, a git config or a file in the sandbox, and it is gone when the command ends. This block is shown, not run by the docs smoke: it needs your repository and your token.Keep the workspace between tasks
A workspace on a paused sandbox is exactly where you left it: files, branches and uncommitted changes. To start many tasks from one prepared clone, save it as a snapshot and start every task from the snapshot; see Timeouts, pause and resume and Evals and RL fan-out.Things to know
- Clone with
--depth 1for large repositories: it is quicker and uses less of the sandbox’s disk (51 GiB onbase). - The default working directory of a command is
/root, the home directory of thebasetemplate. Givecwdor an absolute path when it matters. - Output of
gitgoes to stderr for progress lines.commands.runreturns both; a non-zero exit raisesCommandExitExceptionin Python andCommandExitErrorin TypeScript.