Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 2.11 KB

File metadata and controls

57 lines (46 loc) · 2.11 KB
summary read_when
Cursor provider data sources: browser cookies or stored session; usage + billing via cursor.com APIs.
Debugging Cursor usage parsing
Updating Cursor cookie import or session storage
Adjusting Cursor provider UI/menu behavior

Cursor provider

Cursor is web-only. Usage is fetched via browser cookies or a stored WebKit session.

Data sources + fallback order

  1. Cached cookie header (preferred)

    • Stored after successful browser import.
    • Keychain cache: com.steipete.codexbar.cache (account cookie.cursor).
  2. Browser cookie import

    • Cookie order from provider metadata (default: Safari → Chrome → Firefox).
    • Domain filters: cursor.com, cursor.sh.
    • Cookie names required (any one counts):
      • WorkosCursorSessionToken
      • __Secure-next-auth.session-token
      • next-auth.session-token
  3. Stored session cookies (fallback)

    • Captured by the "Add Account" WebKit login flow.
    • Login teardown uses WebKitTeardown to avoid Intel WebKit crashes.
    • Stored at: ~/Library/Application Support/CodexBar/cursor-session.json.

Manual option:

  • Preferences → Providers → Cursor → Cookie source → Manual.
  • Paste the Cookie: header from a cursor.com request.

API endpoints

  • GET https://cursor.com/api/usage-summary
    • Plan usage (included), on-demand usage, billing cycle window.
  • GET https://cursor.com/api/auth/me
    • User email + name.
  • GET https://cursor.com/api/usage?user=ID
    • Legacy request-based plan usage (request counts + limits).

Cookie file paths

  • Safari: ~/Library/Cookies/Cookies.binarycookies
  • Chrome/Chromium forks: ~/Library/Application Support/Google/Chrome/*/Cookies
  • Firefox: ~/Library/Application Support/Firefox/Profiles/*/cookies.sqlite

Snapshot mapping

  • Primary: plan usage percent (included plan).
  • Secondary: on-demand usage percent (individual usage).
  • Provider cost: on-demand usage USD (limit when known).
  • Reset: billing cycle end date.

Key files

  • Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift
  • Sources/CodexBar/CursorLoginRunner.swift (login flow)