cURL
curl --request POST \ --url http://localhost:4444/v1/workspace/read-source-code \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "path": "src/main.py", "range": "<unknown>" } '
{ "source_code": "<string>" }
Returns the contents of the specified file.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Path to the file, relative to the workspace root
"src/main.py"
Optional range within the file to read
Show child attributes
The end position of the range.
0-indexed character index within the line.
x >= 0
5
0-indexed line number.
10
The start position of the range.
Source code retrieved successfully