Skip to content

Feat: add Cursor cli and Gemini cli#18

Open
jsmjsm wants to merge 6 commits intoatalovesyou:mainfrom
jsmjsm:feat-cursor-gemini-cli
Open

Feat: add Cursor cli and Gemini cli#18
jsmjsm wants to merge 6 commits intoatalovesyou:mainfrom
jsmjsm:feat-cursor-gemini-cli

Conversation

@jsmjsm
Copy link

@jsmjsm jsmjsm commented Feb 17, 2026

No description provided.

jsmjsm and others added 6 commits February 16, 2026 16:14
Extend the API proxy to route requests to three CLI backends
(Claude, Cursor agent, Gemini) based on model name prefix,
so openclaw bot can use any of them via the same OpenAI-compatible
endpoint.

New files:
- src/subprocess/cursor.ts   – CursorSubprocess (agent -p, stdin prompt)
- src/subprocess/gemini.ts   – GeminiSubprocess (gemini -p)
- src/subprocess/factory.ts  – resolveBackend() + createSubprocess()
- src/types/common.ts        – shared ContentDeltaEvent / ResultEvent

Modified:
- ClaudeSubprocess now emits standardised events
- routes.ts is backend-agnostic (uses factory + common events)
- /v1/models lists all three backends
- standalone.ts verifies & reports all available CLIs on startup
- Plugin entry point registers all backends for Clawdbot

Co-authored-by: Cursor <cursoragent@cursor.com>
- Handle array-format message content (e.g. [{type:"text", text:"..."}])
  that OpenClaw and other clients send, instead of only plain strings
- Add gemini/ prefix routing in factory (alongside gemini-cli/)
- Update OpenAIChatMessage type to accept string | content-part array

Co-authored-by: Cursor <cursoragent@cursor.com>
Rewrite documentation to cover all three backends, model routing,
OpenClaw configuration, and updated architecture diagram.

Co-authored-by: Cursor <cursoragent@cursor.com>
OpenClaw custom providers can't use "/" in model IDs, so add
dash-format aliases (e.g. cursor-opus-4.6, gemini-cli-gemini-2.5-pro)
alongside the existing slash-format. Both the /v1/models endpoint and
the backend resolver now handle either convention.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document both the simpler openai-provider setup (slash-format IDs)
and the custom cli-proxy provider (dash-format IDs). Add verification
steps, per-agent config, rate-limit fallback tips, and troubleshooting
for the [object Object] content issue.

Co-authored-by: Cursor <cursoragent@cursor.com>
Without this flag, Cursor agent in headless (-p) mode cannot execute
shell commands (e.g. python) because it waits for user confirmation
that never comes. The --yolo flag (alias for --force) auto-approves
all tool executions, matching Gemini CLI's -y behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant