curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/owner/repo", "branch": "main"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"repo_url": "https://github.com/owner/repo",
"branch": "main",
},
)
data = response.json()
print(f"Cloned to {data['path']} on branch {data['branch']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
repo_url: "https://github.com/owner/repo",
branch: "main",
}),
}
);
const data = await response.json();
console.log(`Cloned to ${data.path} on branch ${data.branch}`);
{
"session_id": "ses_abc123",
"repo_url": "https://github.com/owner/repo",
"branch": "main",
"path": "/home/user/repo"
}
Git
Clone Repository
Clone a git repository into the sandbox
POST
/
api
/
sessions
/
{session_id}
/
clone-repo
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/owner/repo", "branch": "main"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"repo_url": "https://github.com/owner/repo",
"branch": "main",
},
)
data = response.json()
print(f"Cloned to {data['path']} on branch {data['branch']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
repo_url: "https://github.com/owner/repo",
branch: "main",
}),
}
);
const data = await response.json();
console.log(`Cloned to ${data.path} on branch ${data.branch}`);
{
"session_id": "ses_abc123",
"repo_url": "https://github.com/owner/repo",
"branch": "main",
"path": "/home/user/repo"
}
Clones a git repository into the session’s sandbox. Supports public repos and private repos when a GitHub App installation or user token is configured.
Required scope:
sessions:write
Path Parameters
Headers
Body
Response
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/owner/repo", "branch": "main"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"repo_url": "https://github.com/owner/repo",
"branch": "main",
},
)
data = response.json()
print(f"Cloned to {data['path']} on branch {data['branch']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
repo_url: "https://github.com/owner/repo",
branch: "main",
}),
}
);
const data = await response.json();
console.log(`Cloned to ${data.path} on branch ${data.branch}`);
{
"session_id": "ses_abc123",
"repo_url": "https://github.com/owner/repo",
"branch": "main",
"path": "/home/user/repo"
}