curl --request POST \
--url https://app.codealive.ai/api/tools/grep_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "TaskExecutor",
"data_sources": [
"CodeAlive-AI/agent-framework"
]
}
'import requests
url = "https://app.codealive.ai/api/tools/grep_search"
payload = {
"query": "TaskExecutor",
"data_sources": ["CodeAlive-AI/agent-framework"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'TaskExecutor', data_sources: ['CodeAlive-AI/agent-framework']})
};
fetch('https://app.codealive.ai/api/tools/grep_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.codealive.ai/api/tools/grep_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'TaskExecutor',
'data_sources' => [
'CodeAlive-AI/agent-framework'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.codealive.ai/api/tools/grep_search"
payload := strings.NewReader("{\n \"query\": \"TaskExecutor\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.codealive.ai/api/tools/grep_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"TaskExecutor\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/grep_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"TaskExecutor\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"results": [
{
"kind": "file",
"dataSource": {
"type": "Repository",
"id": "665f1c2ab3e77d0c9a1b4d21",
"name": "agent-framework"
},
"identifier": "CodeAlive-AI/agent-framework::src/executor.py",
"location": {
"path": "src/executor.py",
"range": {
"start": {
"line": 42,
"character": 6
},
"end": {
"line": 42,
"character": 18
}
}
},
"startLine": 42,
"endLine": 88,
"score": 1,
"contentByteSize": 2048,
"matchCount": 2,
"summary": "Executes queued tasks with retry and telemetry.",
"matches": [
{
"lineNumber": 42,
"startColumn": 7,
"endColumn": 18,
"lineText": "class TaskExecutor:",
"contextLines": [
{
"lineNumber": 41,
"lineText": "@instrumented"
},
{
"lineNumber": 42,
"lineText": "class TaskExecutor:"
},
{
"lineNumber": 43,
"lineText": " def run(self, task):"
}
]
}
]
}
]
},
"rendered": "<grep_search_results count=\"1\">\n <result identifier=\"CodeAlive-AI/agent-framework::src/executor.py\" path=\"src/executor.py\" source=\"agent-framework\" match_count=\"2\" />\n</grep_search_results>\nFetch relevant identifiers with fetch_artifacts or read local files before drawing conclusions."
}Grep search
Searches indexed code for exact literal text or a regular expression (set regex to true). First choice when you already know an exact symbol name, string literal, error message, route, or configuration key, and for exhaustive “find every usage” sweeps. It complements semantic_search: embeddings underrepresent rare short tokens such as acronyms (JWT, OIDC), so run grep_search on the exact token alongside a semantic query rather than instead of it.
curl --request POST \
--url https://app.codealive.ai/api/tools/grep_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "TaskExecutor",
"data_sources": [
"CodeAlive-AI/agent-framework"
]
}
'import requests
url = "https://app.codealive.ai/api/tools/grep_search"
payload = {
"query": "TaskExecutor",
"data_sources": ["CodeAlive-AI/agent-framework"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'TaskExecutor', data_sources: ['CodeAlive-AI/agent-framework']})
};
fetch('https://app.codealive.ai/api/tools/grep_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.codealive.ai/api/tools/grep_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'TaskExecutor',
'data_sources' => [
'CodeAlive-AI/agent-framework'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.codealive.ai/api/tools/grep_search"
payload := strings.NewReader("{\n \"query\": \"TaskExecutor\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.codealive.ai/api/tools/grep_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"TaskExecutor\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/grep_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"TaskExecutor\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"results": [
{
"kind": "file",
"dataSource": {
"type": "Repository",
"id": "665f1c2ab3e77d0c9a1b4d21",
"name": "agent-framework"
},
"identifier": "CodeAlive-AI/agent-framework::src/executor.py",
"location": {
"path": "src/executor.py",
"range": {
"start": {
"line": 42,
"character": 6
},
"end": {
"line": 42,
"character": 18
}
}
},
"startLine": 42,
"endLine": 88,
"score": 1,
"contentByteSize": 2048,
"matchCount": 2,
"summary": "Executes queued tasks with retry and telemetry.",
"matches": [
{
"lineNumber": 42,
"startColumn": 7,
"endColumn": 18,
"lineText": "class TaskExecutor:",
"contextLines": [
{
"lineNumber": 41,
"lineText": "@instrumented"
},
{
"lineNumber": 42,
"lineText": "class TaskExecutor:"
},
{
"lineNumber": 43,
"lineText": " def run(self, task):"
}
]
}
]
}
]
},
"rendered": "<grep_search_results count=\"1\">\n <result identifier=\"CodeAlive-AI/agent-framework::src/executor.py\" path=\"src/executor.py\" source=\"agent-framework\" match_count=\"2\" />\n</grep_search_results>\nFetch relevant identifiers with fetch_artifacts or read local files before drawing conclusions."
}Authorizations
Body
Response
Success envelope. obj.results[] adds grep specifics: matchCount and matches[] with lineNumber, column range, and lineText; rendered is a <grep_search_results> XML block. Repairable failures (missing or invalid arguments, ambiguous or unknown data sources) also return HTTP 200 with obj.error = { code, message, retry, try } and a rendered <tool_error> block; repair the arguments and retry.
Was this page helpful?