← Back to Plugins
Voice

Cursor Cli Native

evelioapc By evelioapc 👁 68 views ▲ 0 votes

OpenClaw CLI backend plugin that routes model calls through the local cursor-agent binary (Cursor subscription)

GitHub

Install

openclaw plugins install ./openclaw-cursor-cli-native

Configuration Example

{"type":"result","subtype":"success","is_error":false,"result":"...","session_id":"...","usage":{...}}

README

# openclaw-cursor-cli-native

An [OpenClaw](https://openclaw.ai) CLI backend plugin that routes model calls through the local `cursor-agent` binary, using your own Cursor subscription.

Unlike the community `@jeehou/openclaw-cursor-cli` plugin, this one is a minimal, dependency-free implementation built directly against OpenClaw's `CliBackendPlugin` SDK and non-streaming `--output-format json` mode — no build step, no extra runtime dependencies.

## How it works

`cursor-agent` (Cursor's official CLI) supports a headless, non-interactive mode:

```bash
cursor-agent --print --force --output-format json "your prompt"
```

which returns a single JSON object:

```json
{"type":"result","subtype":"success","is_error":false,"result":"...","session_id":"...","usage":{...}}
```

This plugin registers a CLI backend (`cursor-cli-native`) that shells out to `cursor-agent` with this exact invocation, extracts `result` as the model's reply and `session_id` for conversation continuity, and exposes it to OpenClaw as a normal model provider — usable like any other model, including as a fallback.

## Requirements

- OpenClaw >= 2026.3.24-beta.2
- [`cursor-agent`](https://cursor.com/docs/cli) installed and logged in with an active Cursor subscription

## Install `cursor-agent`

```bash
curl https://cursor.com/install -fsSL | bash
export PATH="$HOME/.local/bin:$PATH"
```

Login (works over SSH/headless — it's a polling login, no need to paste anything back):

```bash
NO_OPEN_BROWSER=1 cursor-agent login
```

Open the printed `https://cursor.com/loginDeepControl?...` URL in your local browser, sign in, and the CLI session completes on its own.

Verify:

```bash
cursor-agent status
```

## Install the plugin

From a local clone:

```bash
git clone https://github.com/evelioapc/openclaw-cursor-cli-native
openclaw plugins install ./openclaw-cursor-cli-native
```

Then allow the plugin in your OpenClaw config (`~/.openclaw/openclaw.json`):

```json
{
  "plugins": {
    "allow": ["cursor-cli-native"]
  }
}
```

Register at least one model so OpenClaw accepts it as an explicit `--model` override or fallback (list available Cursor model ids with `cursor-agent --list-models`):

```json
{
  "agents": {
    "defaults": {
      "models": {
        "cursor-cli-native/gpt-5.6-sol-medium": {}
      }
    }
  }
}
```

Restart the gateway:

```bash
systemctl --user restart openclaw-gateway   # if running as a systemd user service
```

## Usage

```bash
openclaw agent --agent main --message "hi" --model cursor-cli-native/gpt-5.6-sol-medium
```

Or add it as a fallback:

```json
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "openai/gpt-5.6-sol",
        "fallbacks": ["cursor-cli-native/gpt-5.6-sol-medium"]
      }
    }
  }
}
```

## Model ids

Any model id accepted by `cursor-agent --model <id>` works, prefixed with `cursor-cli-native/`. Run `cursor-agent --list-models` for the full, frequently-updated catalog (GPT, Claude, Gemini, Grok, Composer, Kimi, GLM, etc. — whatever your Cursor plan exposes).

## Known limitations

- Non-streaming only (v1): each turn runs `cursor-agent` once and waits for the full JSON result. No token-by-token streaming yet.
- Thinking/reasoning traces from Cursor are not surfaced.
- Each call consumes your Cursor subscription's usage quota.

## License

MIT
voice

Comments

Sign in to leave a comment

Loading comments...