Skip to main content
POST
https://api.relace.run
/
v1
/
repo
/
{repo_id}
/
agent
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_name": "relace-search",
    "agent_inputs": {
      "query": "Where in the project are global styles and UI components defined?"
    },
    "continue": false
  }'

event: started
data: {"prompt_id":"123e4567-e89b-12d3-a456-426614174000"}

event: agent
data: {"name":"relace-search","content":"I'll explore the codebase to understand where global styles and UI components are defined. Let me first get an overview of the project structure to identify relevant directories and files.\n\n"}

event: tool
data: {"name":"view_directory","path":"/repo"}

event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" -o -name \"*.less\" | head -20"}

event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*component*\" -o -name \"*ui*\" -o -name \"*style*\" | head -20"}

event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}

event: tool
data: {"name":"bash","command":"grep -r \"ThemeProvider\\|GlobalStyle\\|styled\\.\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}

event: agent
data: {"name":"relace-search","content":"Based on the initial exploration, I can see this appears to be a React project with a structured component system. Let me dive deeper into the key areas that would contain global styles and UI components.\n\n"}

event: tool
data: {"name":"view_directory","path":"/repo/src/components"}

event: tool
data: {"name":"view_file","path":"/repo/src/index.css"}

event: tool
data: {"name":"view_directory","path":"/repo/src/components/ui"}

event: tool
data: {"name":"view_file","path":"/repo/src/main.tsx"}

event: tool
data: {"name":"bash","command":"find /repo/src -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" | xargs ls -la"}

event: agent
data: {"name":"relace-search","content":"Let me also check for any theme-related files and the main app structure to better understand how global styles and UI components are organized.\n\n"}

event: tool
data: {"name":"bash","command":"find /repo -name \"*theme*\" -type f"}

event: tool
data: {"name":"view_file","path":"/repo/src/hooks/use-theme.tsx"}

event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\\|ThemeProvider\\|styled\\.\" /repo/src --include=\"*.tsx\" --include=\"*.ts\" | head -10"}

event: tool
data: {"name":"view_file","path":"/repo/src/App.tsx"}

event: tool
data: {"name":"bash","command":"ls -la /repo/src/components/"}

event: agent
data: {"name":"relace-search","content":"Based on my exploration of the codebase, I now have a clear understanding of where global styles and UI components are defined. Let me report back with my findings.\n\n"}

event: tool
data: {"name":"report_back","explanation":"Based on my exploration of the codebase, I've identified the key locations where global styles and UI components are defined:\n\n1. **Global Styles**: The global styles are defined in `/src/index.css`. ...","files":{"src/index.css":[[1,100]],"src/components/ui":[[1,100]],"src/hooks/use-theme.tsx":[[1,100]],"src/components/theme-toggle.tsx":[[1,50]],"src/App.tsx":[[1,20]]}}

event: done
data: {}

Path Parameters

repo_id
string
required
Repo ID

Request Body

agent_inputs
object
required
Input parameters for the agent

Response

The agent returns a Server-Sent Events (SSE) stream with real-time updates as parallel tool calls execute.

Event Types

started
event
Signals that the agent execution has begun
agent
event
Contains agent reasoning, analysis, and text responses
tool
event
Reports tool usage and execution results. Tools can include file operations, bash commands, directory views, and specialized operations like report_back.
done
event
Signals that the agent execution has completed successfully
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_name": "relace-search",
    "agent_inputs": {
      "query": "Where in the project are global styles and UI components defined?"
    },
    "continue": false
  }'

event: started
data: {"prompt_id":"123e4567-e89b-12d3-a456-426614174000"}

event: agent
data: {"name":"relace-search","content":"I'll explore the codebase to understand where global styles and UI components are defined. Let me first get an overview of the project structure to identify relevant directories and files.\n\n"}

event: tool
data: {"name":"view_directory","path":"/repo"}

event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" -o -name \"*.less\" | head -20"}

event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*component*\" -o -name \"*ui*\" -o -name \"*style*\" | head -20"}

event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}

event: tool
data: {"name":"bash","command":"grep -r \"ThemeProvider\\|GlobalStyle\\|styled\\.\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}

event: agent
data: {"name":"relace-search","content":"Based on the initial exploration, I can see this appears to be a React project with a structured component system. Let me dive deeper into the key areas that would contain global styles and UI components.\n\n"}

event: tool
data: {"name":"view_directory","path":"/repo/src/components"}

event: tool
data: {"name":"view_file","path":"/repo/src/index.css"}

event: tool
data: {"name":"view_directory","path":"/repo/src/components/ui"}

event: tool
data: {"name":"view_file","path":"/repo/src/main.tsx"}

event: tool
data: {"name":"bash","command":"find /repo/src -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" | xargs ls -la"}

event: agent
data: {"name":"relace-search","content":"Let me also check for any theme-related files and the main app structure to better understand how global styles and UI components are organized.\n\n"}

event: tool
data: {"name":"bash","command":"find /repo -name \"*theme*\" -type f"}

event: tool
data: {"name":"view_file","path":"/repo/src/hooks/use-theme.tsx"}

event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\\|ThemeProvider\\|styled\\.\" /repo/src --include=\"*.tsx\" --include=\"*.ts\" | head -10"}

event: tool
data: {"name":"view_file","path":"/repo/src/App.tsx"}

event: tool
data: {"name":"bash","command":"ls -la /repo/src/components/"}

event: agent
data: {"name":"relace-search","content":"Based on my exploration of the codebase, I now have a clear understanding of where global styles and UI components are defined. Let me report back with my findings.\n\n"}

event: tool
data: {"name":"report_back","explanation":"Based on my exploration of the codebase, I've identified the key locations where global styles and UI components are defined:\n\n1. **Global Styles**: The global styles are defined in `/src/index.css`. ...","files":{"src/index.css":[[1,100]],"src/components/ui":[[1,100]],"src/hooks/use-theme.tsx":[[1,100]],"src/components/theme-toggle.tsx":[[1,50]],"src/App.tsx":[[1,20]]}}

event: done
data: {}