Skip to content

haliphax-openclaw/cursor-acp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This project does not support persistent sessions. Development halted indefinitely. See #1. ⚠️

Cursor ACP Wrapper

A Node.js wrapper script for integrating the Cursor AI development agent with OpenClaw's ACP (Agent Control Protocol) runner (acpx).

Purpose

The wrapper intercepts the standard input/output streams between OpenClaw and the Cursor agent binary (/home/node/.local/bin/agent acp) to transparently manage:

  • Authentication: Injects a cursor_login authentication payload before establishing a new session.
  • Session Mapping: Intercepts session/load and session/new requests, seamlessly tracking and mapping OpenClaw's requested sessionId to Cursor's internally generated sessionId.
  • Message Queuing: Buffers incoming prompts until the session initialization finishes.

Logging

Debugging output (traffic dumps like IN_FROM_ACPX, OUT_TO_CURSOR) is optional and disabled by default.

To enable logging, you must set the CURSOR_ACP_WRAPPER_LOG environment variable to the absolute path of the desired log file (e.g., /tmp/cursor-acp.log).

Usage

This script is meant to be configured as the command for the cursor agent in your ~/.acpx/config.json. You can optionally supply the env block to enable logging.

{
  "defaultAgent": "cursor",
  "defaultPermissions": "approve-all",
  "agents": {
    "cursor": {
      "command": "/path/to/cursor-acp-wrapper/cursor-acp-wrapper.js",
      "runtime": "acp",
      "description": "Cursor AI development agent (Wrapped)",
      "env": {
        "CURSOR_ACP_WRAPPER_LOG": "/tmp/cursor-acp.log"
      }
    }
  }
}

Make sure the script is executable:

chmod +x cursor-acp-wrapper.js

License

This project is licensed under the Public Domain (Unlicense).

Contributors