E2B icon

E2B

Run commands and manage E2B sandboxes and snapshots

Git → Add

AI-generated

Summary

Stage specified files in a git repository inside an E2B sandbox for the next commit.

Inputs

  • Sandbox ID (required) — ID of the sandbox containing the git repository to operate on.
  • Repository Path (required) — Path within the sandbox to the git repository.
  • Files — Comma-separated list of files to stage. Use "." to stage all changes.
  • Timeout — Timeout in seconds for the operation (default is 300 seconds).

Output shape

a single item with a JSON object describing the result of the git add command, including execution success, exit code, stdout, stderr, the sandboxId, repositoryPath, and the list of staged files.

The output JSON includes detailed information about the command execution. If "files" is ".", all changes in the repository are staged. The operation may throw errors if the git add command fails.

Examples

Example 1: Stage all changes in the repository at a given path inside the specified sandbox

Provide the Sandbox ID, Repository Path, and set Files to "." to stage all changes.

Links

Discussion