pi-cursor-oauth
v0.2.0
Published
Cursor OAuth provider extension for pi-coding-agent
Readme
pi-cursor-oauth
A pi extension that registers a cursor provider, supports Cursor browser OAuth, and forwards chat plus a limited set of Cursor exec calls through pi.
Features
- Registers a
cursorprovider with thecursor-chat-apitransport - Supports
/login cursorusing Cursor's browser OAuth flow - Uses
CURSOR_ACCESS_TOKENas the environment variable fallback - Ships a fallback model list so the provider is usable before live model sync
- Refreshes usable models from Cursor with
/cursor-sync-models - Resets cached Cursor conversation state with
/cursor-reset-conversation - Resets session-scoped Cursor state when pi sessions start, switch, or fork
Install
pi install npm:pi-cursor-oauthAuthenticate
Inside pi:
/login cursorOr provide a token directly:
export CURSOR_ACCESS_TOKEN=...Sync models
The extension starts with a bundled fallback model list and can refresh the currently usable Cursor model list on demand. When Cursor credentials are available, it also attempts a quiet model sync on session start and when the Cursor model is selected.
/cursor-sync-modelsThen pick a Cursor model with /model.
Commands
/cursor-sync-models- refresh the provider's model list from Cursor/cursor-reset-conversation- clear cached Cursor conversation state
Exec bridge
This extension includes a limited Cursor exec bridge.
Supported exec calls:
readlsgrepwithcontent,files_with_matches, andcountwritefor text contentdeleteshellshellStreamrequestContext
Bridge behavior notes:
- Exec streams are explicitly closed after tool completion so Cursor does not remain stuck on
working... - Unsupported interaction queries are answered immediately instead of being left pending
- Cursor exec activity is best-effort mirrored into a small pi TUI widget instead of extra conversation messages
- The pi TUI integration currently relies on a private internal-module/prototype patch into pi internals, so it is inherently brittle and may break across pi versions or internal layout changes
Current limitations:
- Binary
writevia raw bytes is not supported - Background shell spawning is not supported
writeShellStdinis not supporteddiagnosticsis not supportedfetchis not supported- Generic MCP tool calls and MCP resource operations are not supported
recordScreenis not supportedcomputerUseis not supported
Development
bun install
bun run check
bun run build