@lykhoyda/pi-cursor-subscription
v1.5.1
Published
Cursor provider for Pi Coding Agent. Fork of @rahularya01/pi-cursor with privileged native exec off by default.
Maintainers
Readme
@lykhoyda/pi-cursor-subscription
Use your Cursor subscription models (Composer, Claude, GPT, Grok, and others) inside the Pi Coding Agent. This package registers a cursor provider that talks to Cursor's agent backend over HTTP/2 (Connect + Protobuf). No separate API key and no Cursor CLI subprocess per turn.
Fork of @rahularya01/pi-cursor 1.5.0 (based on upstream 1.4.34). Version bumps go through Changesets; a matching v* tag publishes @lykhoyda/pi-cursor-subscription to npm.
Unofficial. Not affiliated with Cursor / Anysphere. Community reverse-engineered wire details; Cursor can change protocols anytime. Use only on accounts you are allowed to access, and review the source before
/login cursor.
Requirements
| | |
| --------------------------- | ------------------------------------------------ |
| Pi Coding Agent / Pi AI | >= 0.80.0 |
| Bun | >= 1.4.0 (only supported runtime) |
| Cursor account | Signed in via app, CLI, or /login cursor below |
Install
pi install git:github.com/Lykhoyda/pi-cursor-subscriptionRestart Pi or run /reload. To update:
pi update git:github.com/Lykhoyda/pi-cursor-subscriptionQuick start
Sign in — if the Cursor app or CLI (
cursor/agent) is already logged in on this machine, credentials are picked up automatically. Otherwise:/login cursorChoose a model (examples; your account may differ):
/model cursor/composer-2.5Run
/cursor.modelsfor the live catalog.Chat. If something fails, run
/cursor.doctorfirst (token source, endpoint, last error).
Privileged native exec (default: off)
On the open Run RPC, this fork rejects Cursor-native shell, fetch, write, and delete execs unless you opt in. The model should use Pi MCP tools instead (with Pi's confirmation UI). Read, ls, and grep still run on the native exec channel.
Restore upstream 1.4.31+ behaviour only if you accept that risk:
export PI_CURSOR_NATIVE_EXEC=1See SECURITY.md for credential handling and URL allowlisting.
Authentication
Credentials resolve in order:
CURSOR_ACCESS_TOKEN- Pi OAuth store (
~/.pi/agent/auth.jsonfrom/login cursor) - Cursor CLI Keychain (
cursor-access-token/cursor-refresh-token) - Cursor IDE
globalStorage/state.vscdb(macOS, Linux, Windows, or WSL — current Windows user only on WSL)
/login cursor wins over harvested CLI/IDE tokens so another Cursor login on the machine does not silently override yours.
Opt out of Keychain / IDE / WSL harvest:
export PI_CURSOR_SYSTEM_CREDENTIALS=0Commands
| Command | Description |
| -------------------- | ------------------------------------------------- |
| /login cursor | Browser PKCE sign-in; refreshes the model catalog |
| /model cursor/<id> | Select a Cursor model |
| /cursor.models | List models, context windows, thinking levels |
| /cursor.models all | Include internal tab/chat variants |
| /cursor.usage | Usage quota TUI |
| /cursor.doctor | Sanitized diagnostics |
Reasoning effort (off … max) maps to Cursor's model variants. Restrict the picker in ~/.pi/agent/settings.json with enabledModels.
Troubleshooting
No API provider registered for api: cursor-native:pi update git:github.com/Lykhoyda/pi-cursor-subscriptionand/reload.- 401 / not logged in:
/login cursoror check/cursor.doctor(tokenSource). - Hung stream / wire errors:
/cursor.doctor(clientVersion,wireDrift); see AGENTS.md for env tuning (PI_CURSOR_CLIENT_VERSION, timeouts, debug flags). - Stale model list: Open
/modelto refresh, or clearPI_CURSOR_CACHE_DIR(default under~/.cache/pi-cursor).
Development
bun install
bun run checkArchitecture, module layout, and the full environment variable list live in AGENTS.md.
Attributions
Wire patterns from opencode-cursor and @pi-stef/cursor. Upstream: Rahularya01/pi-cursor.
