daji-cursor-bridge
v0.1.1
Published
OpenAI-compatible HTTP bridge to Cursor agent CLI for DAJI
Readme
daji-cursor-bridge
OpenAI-compatible HTTP sidecar that forwards chat requests to the Cursor agent CLI.
Designed for DAJI WSL + Cursor Remote-WSL workflows.
Quick start
# Published (npm)
npx daji-cursor-bridge
# From monorepo (development)
node packages/daji-cursor-bridge/bin/daji-cursor-bridge.jsDefault listen address: http://127.0.0.1:8765
In DAJI TUI:
/cursorEndpoints
| Method | Path | Purpose |
|--------|------|---------|
| GET | /health | Liveness |
| GET | /v1/diagnostics | Bridge + agent status (DAJI probe) |
| GET | /v1/models | OpenAI-compatible model list |
| POST | /v1/chat/completions | Chat (supports stream: true SSE) |
Diagnostics example
{
"bridge": "cursor",
"version": "0.1.0",
"healthy": true,
"agent": {
"installed": true,
"logged_in": true,
"bin": "agent"
},
"capabilities": {
"chat_completions": true,
"prompt_via_stdin": true,
"tools": false,
"streaming": true
},
"issues": []
}When prompt_via_stdin is true, DAJI skips legacy message trimming for Cursor endpoints.
Environment
| Variable | Default | Description |
|----------|---------|-------------|
| PORT / DAJI_CURSOR_BRIDGE_PORT | 8765 | Listen port |
| DAJI_CURSOR_BRIDGE_HOST | 127.0.0.1 | Bind address |
| CURSOR_AGENT_BIN | agent | Cursor CLI binary |
| CURSOR_BRIDGE_PROMPT_VIA_STDIN | 1 | Pass prompts on stdin (avoids E2BIG) |
| DAJI_CURSOR_BRIDGE_MOCK | 0 | Mock agent for tests |
Development
cd packages/daji-cursor-bridge
npm test
node bin/daji-cursor-bridge.js --mockLegacy compatibility
Works as a drop-in replacement for cursor-api-proxy on port 8765.
Old proxy without /v1/diagnostics still works — DAJI falls back to /health + /v1/models.
See also: docs/planning/CURSOR_BRIDGE_PLUGIN_DESIGN.md
