- cursor_position
- key
- type
- mouse_move
- left_click
- left_click_drag
- right_click
- middle_click
- double_click
- screenshot
curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"cursor_position"}'Response:
{
"type": "success",
"media_type": "text/plain",
"data": "Cursor position is: X=100, Y=200"
}curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"key", "text":"Return"}'Response:
{
"type": "success",
"media_type": "text/plain",
"data": "Key action executed successfully"
}curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"type", "text":"Hello World"}'Response:
{
"type": "success",
"media_type": "text/plain",
"data": "Type action executed successfully"
}curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"mouse_move", "coordinate":[100, 200]}'Response:
{
"type": "success",
"media_type": "text/plain",
"data": "Mouse move executed successfully"
}# Left Click
curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"left_click"}'
# Right Click
curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"right_click"}'
# Middle Click
curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"middle_click"}'
# Double Click
curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"double_click"}'
# Left Click Drag
curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"left_click_drag"}'curl -X POST http://localhost:8090/computer \
-H "Content-Type: application/json" \
-d '{"action":"screenshot"}'Response:
{
"type": "base64",
"media_type": "image/png",
"data": "base64_encoded_image_data..."
}- view
- create
- str_replace
- insert
- undo_edit
# View entire file
curl -X POST http://localhost:8090/edit \
-H "Content-Type: application/json" \
-d '{
"command": "view",
"path": "/path/to/file"
}'
# View specific line range
curl -X POST http://localhost:8090/edit \
-H "Content-Type: application/json" \
-d '{
"command": "view",
"path": "/path/to/file",
"view_range": [1, 10]
}'curl -X POST http://localhost:8090/edit \
-H "Content-Type: application/json" \
-d '{
"command": "create",
"path": "/path/to/file",
"file_text": "File content here"
}'curl -X POST http://localhost:8090/edit \
-H "Content-Type: application/json" \
-d '{
"command": "str_replace",
"path": "/path/to/file",
"old_str": "old text",
"new_str": "new text"
}'curl -X POST http://localhost:8090/edit \
-H "Content-Type: application/json" \
-d '{
"command": "insert",
"path": "/path/to/file",
"file_text": "text to insert",
"insert_line": 5
}'curl -X POST http://localhost:8090/edit \
-H "Content-Type: application/json" \
-d '{
"command": "undo_edit",
"path": "/path/to/file"
}'curl -X POST http://localhost:8090/bash \
-H "Content-Type: application/json" \
-d '{
"command": "ls -la"
}'Response:
{
"type": "success",
"media_type": "text/plain",
"data": "command_output_here"
}curl -X POST http://localhost:8090/bash \
-H "Content-Type: application/json" \
-d '{
"restart": true
}'Response:
{
"type": "success",
"media_type": "text/plain",
"data": "Bash session has been restarted"
}curl -X GET http://localhost:8090/healthResponse:
{
"type": "success",
"media_type": "text/plain",
"data": "Service is running"
}Notes:
- All responses follow a unified format:
{
"type": "success|error|base64",
"media_type": "text/plain|image/png",
"data": "Response data"
}- Error responses will include specific error information:
{
"type": "error",
"media_type": "text/plain",
"data": "Error description"
}- Port number 8090 is used in examples, please adjust according to your actual configuration.