curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/git" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{
"operation": "commit",
"args": {"message": "feat: add user validation"}
}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/git",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"operation": "commit",
"args": {"message": "feat: add user validation"},
},
)
data = response.json()
print(f"{data['operation']}: {data['success']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/git",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
operation: "commit",
args: { message: "feat: add user validation" },
}),
}
);
const data = await response.json();
console.log(`${data.operation}: ${data.success}`);
{
"operation": "commit",
"success": true,
"result": {
"sha": "a1b2c3d4e5f6",
"message": "feat: add user validation",
"files_changed": 3
}
}
Git
Git Operation
Execute a git operation in the sandbox
POST
/
api
/
sessions
/
{session_id}
/
git
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/git" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{
"operation": "commit",
"args": {"message": "feat: add user validation"}
}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/git",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"operation": "commit",
"args": {"message": "feat: add user validation"},
},
)
data = response.json()
print(f"{data['operation']}: {data['success']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/git",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
operation: "commit",
args: { message: "feat: add user validation" },
}),
}
);
const data = await response.json();
console.log(`${data.operation}: ${data.success}`);
{
"operation": "commit",
"success": true,
"result": {
"sha": "a1b2c3d4e5f6",
"message": "feat: add user validation",
"files_changed": 3
}
}
Executes a git operation in the session’s sandbox. Supports standard git operations like status, add, commit, push, pull, branch, checkout, diff, log, and create-pr.
Required scope:
sessions:write
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxBody
string
required
Git operation:
status, add, commit, push, pull, branch, checkout, diff, log, create-pr.object
Operation-specific arguments. For
commit: {message}. For checkout: {branch}. For create-pr: {title, body, base}.Response
string
Operation that was executed.
object
Operation-specific result data.
boolean
Whether the operation succeeded.
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/git" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{
"operation": "commit",
"args": {"message": "feat: add user validation"}
}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/git",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"operation": "commit",
"args": {"message": "feat: add user validation"},
},
)
data = response.json()
print(f"{data['operation']}: {data['success']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/git",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
operation: "commit",
args: { message: "feat: add user validation" },
}),
}
);
const data = await response.json();
console.log(`${data.operation}: ${data.success}`);
{
"operation": "commit",
"success": true,
"result": {
"sha": "a1b2c3d4e5f6",
"message": "feat: add user validation",
"files_changed": 3
}
}