Open
Conversation
Add support for the Cursor CLI (`agent`) as a fourth AI provider alongside Anthropic (Claude), OpenAI (Codex), and OpenCode. Changes: - src/lib/types.ts: Add CURSOR_MODEL_IDS mapping and cursor settings type - src/lib/config.ts: Add resolveCursorModel(), auto-detect cursor provider - src/lib/invoke.ts: Add cursor provider branch with JSON output parsing, --continue session support, and fallback for first-run - src/lib/agent.ts: Copy AGENTS.md as .cursor/rules/agents.mdc and keep teammate info in sync for Cursor workspaces - tinyclaw.sh: Add cursor case to provider/model display and switching - lib/agents.sh: Add Cursor to agent add/provider menus with model selection - lib/setup-wizard.sh: Add Cursor to initial setup and additional agent flows The Cursor CLI requires installation (`curl https://cursor.com/install -fsS | bash`) and authentication (`agent login` or CURSOR_API_KEY env var). Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Cursor CLI (
agent) as a fourth AI provider, alongside Anthropic (Claude), OpenAI (Codex), and OpenCode.This lets users leverage their existing Cursor subscription within TinyClaw — useful for teams that already have Cursor Pro/Business seats and want to use them for autonomous agent workflows.
What's included
TypeScript integration (
src/lib/):types.ts—CURSOR_MODEL_IDSmapping andcursorsettings typeconfig.ts—resolveCursorModel()resolver and auto-detect for cursor providerinvoke.ts— Full provider branch: JSON output parsing,--continuesession support,--forcefor non-interactive mode, graceful fallback when no previous session existsagent.ts— CopiesAGENTS.mdas.cursor/rules/agents.mdcso Cursor agents get the same context as Claude agents, with teammate info kept in syncShell scripts:
tinyclaw.sh—provider cursorcommand for global switching, model displaylib/agents.sh— Cursor option inagent addandagent providermenuslib/setup-wizard.sh— Cursor in initial setup and additional agent flowsHow it works
The Cursor CLI's non-interactive mode (
agent -p "prompt" --output-format json --force) returns a single JSON object with a.resultfield. The integration:CURSOR_MODEL_IDS(supports shorthand likesonnet,opus,auto)--model,--workspace, and optionally--continue--continuePrerequisites
Users need the Cursor CLI installed and authenticated:
Test plan
npx tsc --noEmit)tinyclaw setup— select Cursor as provider, verify settings.jsontinyclaw agent add— create a Cursor agent, verify provider/modeltinyclaw agent provider <id> cursor --model auto— switch existing agent.cursor/rules/agents.mdcis created in agent workspace--continueworks for subsequent messages (session persistence)Made with Cursor