Skip to main content
POST
Executes a git operation inside the sandbox’s workspace - typically used by background agents to push their work and open a pull request after completing a task. The session must be in running state. Required scope: sessions:write

Path Parameters

string
required
The session ID.

Headers

string
required
Bearer token. Example: Bearer runtm_xxx

Body

string
required
One of: status, commit, push, pull, sync, create_branch, switch_branch, list_branches, create_pr, create_branch_and_pr, init_repo.
string
default:"/home/user"
Directory containing the git repository inside the sandbox.
string
Commit message - required when operation is commit.
string
Branch name - for create_branch / switch_branch.
Search filter for list_branches.
string
Pull request title - required for create_pr and create_branch_and_pr.
string
Pull request body.
string
Base branch for the PR. Defaults to the repository’s default branch.
string
Session ID to derive the branch name from when using create_branch_and_pr.

Response

boolean
Whether the operation succeeded.
string
The operation that was attempted.
string | null
Stdout/stderr from git.
string | null
Error message if success is false.
Status-specific fields populated when relevant:
boolean
For status: whether working_dir is a git repo.
string
Current branch name.
string
Repo’s default branch.
boolean
Whether there are uncommitted changes.
integer
Commits ahead of upstream.
integer
Commits behind upstream.
string
GitHub owner/repo (after init_repo or when remote is set).
string
HTTPS URL of the GitHub repo.
string
URL of the created PR (after create_pr / create_branch_and_pr).
integer
PR number.
string
Branch that was created (for create_branch_and_pr).
array
List of branch names (for list_branches).