Local API
The standalone daemon exposes a REST API and WebSocket at http://localhost:3847.
REST Endpoints
Get Status
http
GET /api/v1/statusReturns daemon status, connected IDEs, and system info.
List Connected IDEs
http
GET /api/v1/idesList CLI Sessions
http
GET /api/v1/clisSend Command
http
POST /api/v1/command
Content-Type: application/json
{
"type": "send_chat",
"target": "standalone:ide:cursor_12345",
"payload": {
"message": "Fix the login bug"
}
}Available Command Types
| Command | Description |
|---|---|
send_chat | Send a message to the AI agent |
read_chat | Read current chat messages |
screenshot | Capture IDE screenshot |
list_chats | List available chat sessions |
new_chat | Start a new chat session |
switch_chat | Switch to a different chat |
set_mode | Change agent mode |
change_model | Switch AI model |
WebSocket
Connect to ws://localhost:3847/ws for real-time updates:
javascript
const ws = new WebSocket('ws://localhost:3847/ws');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Update:', data);
};Authentication
By default, the local API has no authentication. To enable:
bash
npx @adhdev/daemon-standalone --token mysecretThen include the token in requests:
bash
curl -H "Authorization: Bearer mysecret" \
http://localhost:3847/api/v1/status