curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search?query=TODO&path=/src" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search",
headers={"Authorization": "Bearer runtm_xxx"},
params={"query": "TODO", "path": "/src"},
)
for result in response.json()["results"]:
print(f"{result['path']}:")
for m in result["matches"]:
print(f" L{m['line']}: {m['content']}")
const params = new URLSearchParams({ query: "TODO", path: "/src" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { results } = await response.json();
results.forEach((r) => {
console.log(`${r.path}:`);
r.matches.forEach((m) => console.log(` L${m.line}: ${m.content}`));
});
{
"results": [
{
"path": "/src/index.ts",
"matches": [
{ "line": 12, "content": "// TODO: add error handling" },
{ "line": 45, "content": "// TODO: implement caching" }
]
}
]
}
Files
Search Files
Search for files by content in the sandbox
GET
/
api
/
sessions
/
{session_id}
/
files
/
search
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search?query=TODO&path=/src" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search",
headers={"Authorization": "Bearer runtm_xxx"},
params={"query": "TODO", "path": "/src"},
)
for result in response.json()["results"]:
print(f"{result['path']}:")
for m in result["matches"]:
print(f" L{m['line']}: {m['content']}")
const params = new URLSearchParams({ query: "TODO", path: "/src" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { results } = await response.json();
results.forEach((r) => {
console.log(`${r.path}:`);
r.matches.forEach((m) => console.log(` L${m.line}: ${m.content}`));
});
{
"results": [
{
"path": "/src/index.ts",
"matches": [
{ "line": 12, "content": "// TODO: add error handling" },
{ "line": 45, "content": "// TODO: implement caching" }
]
}
]
}
Searches for files matching a query string within the sandbox. Returns matching files with line-level match details.
Required scope:
sessions:read
Path Parameters
Query Parameters
Headers
Response
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search?query=TODO&path=/src" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search",
headers={"Authorization": "Bearer runtm_xxx"},
params={"query": "TODO", "path": "/src"},
)
for result in response.json()["results"]:
print(f"{result['path']}:")
for m in result["matches"]:
print(f" L{m['line']}: {m['content']}")
const params = new URLSearchParams({ query: "TODO", path: "/src" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/files/search?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { results } = await response.json();
results.forEach((r) => {
console.log(`${r.path}:`);
r.matches.forEach((m) => console.log(` L${m.line}: ${m.content}`));
});
{
"results": [
{
"path": "/src/index.ts",
"matches": [
{ "line": 12, "content": "// TODO: add error handling" },
{ "line": 45, "content": "// TODO: implement caching" }
]
}
]
}