npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cursor-to-api

v0.1.0

Published

One-command launcher for cursor-api-proxy: .env, Windows agent detection, health UI

Readme

cursor-to-api

Use your Cursor subscription as a local OpenAI-compatible HTTP API.

This is a launcher and test UI around cursor-api-proxy. It fixes the pain points of running the proxy directly:

  • Loads CURSOR_API_KEY from .env (bare npx cursor-api-proxy does not)
  • Auto-detects agent on Windows (%LOCALAPPDATA%\cursor-agent\)
  • Sets safe defaults (chat-only, force) so auth and trust work out of the box
  • Includes a browser test UI and doctor command

Not official. Community tool. Uses your Cursor subscription quota, not a separate OpenAI key.

Quick start

Prerequisites

  1. Cursor CLI (agent command)
  2. Node.js 18+
  3. Cursor API Key — Cursor Settings → API Keys

Install

npm install -g cursor-to-api
# or try without install:
npx cursor-to-api doctor

Configure

cp .env.example .env
# edit .env — set CURSOR_API_KEY=crsr_...

.env is read from (first match wins):

  1. Current working directory
  2. ~/.cursor-to-api/.env
  3. Package directory (development)

Run

cursor-to-api start    # proxy + test UI → http://127.0.0.1:3456
cursor-to-api proxy    # proxy only → http://127.0.0.1:8765/v1
cursor-to-api init --key crsr_xxx   # write ~/.cursor-to-api/.env
cursor-to-api doctor   # diagnose agent / key / proxy

Windows: double-click scripts/start.cmd after cloning the repo.

Use from any OpenAI client

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8765/v1",
    api_key="unused",
)

print(client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Hello"}],
).choices[0].message.content)

Modes

Pass header X-Cursor-Mode: ask|plan|agent or set CURSOR_BRIDGE_MODE in env.

| Mode | Behavior | |------|----------| | ask | Read-only exploration | | plan | Planning, read-only | | agent | Full agent — can edit files and run commands |

Architecture

OpenAI client (SDK / LiteLLM / LangChain / …)
    → POST /v1/chat/completions
    → cursor-api-proxy (:8765)   ← spawned by cursor-to-api
    → Cursor CLI (agent)
    → Cursor cloud models

cursor-to-api start also serves a test page on :3456 that proxies /api/proxy/* to the upstream API.

Why not npx cursor-api-proxy?

Direct npx cursor-api-proxy:

  • Does not load .env → authentication fails
  • On Windows, agent is often not on PATH → "Command not found: agent"
  • Workspace trust / --force must be configured manually

cursor-to-api handles all of that before spawning the proxy.

Environment variables

| Variable | Default | Description | |----------|---------|-------------| | CURSOR_API_KEY | — | Required (or agent login) | | CURSOR_BRIDGE_PORT | 8765 | Proxy listen port | | TEST_SERVER_PORT | 3456 | Test UI port | | CURSOR_BRIDGE_CHAT_ONLY_WORKSPACE | true if API key set | Sandbox workspace + --trust | | CURSOR_BRIDGE_FORCE | true | Skip workspace trust prompt | | CURSOR_AGENT_BIN | auto-detected | Override agent path |

See cursor-api-proxy docs for full bridge options.

Open source this repo

To publish as a standalone GitHub project:

cd tools/cursor-to-api
git init
git add .
git commit -m "Initial release: cursor-to-api launcher"
# create github.com/lzpzywoo/cursor-to-api
git remote add origin https://github.com/lzpzywoo/cursor-to-api.git
git push -u origin main
npm publish   # after npm login; update package.json repository/author

Update repository and author in package.json before publishing.

License

MIT — see LICENSE.

Related