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-model-unlocker

v1.0.1

Published

Unlock all AI models in Cursor editor on macOS by modifying the local configuration database

Downloads

13

Readme

Cursor Model Unlocker

解锁 Cursor 编辑器中的所有 AI 模型(macOS 平台)。

⚠️ 重要提示

  1. 这是一个临时解决方案,Cursor 可能随时更新其模型列表结构或验证机制,届时本工具可能失效。
  2. 本工具通过修改 Cursor 本地配置数据库来显示所有模型。虽然模型会在 UI 中显示,但服务端仍可能根据你的账户和地区进行限制
  3. 模型名称和配置结构可能会随 Cursor 版本更新而变化,如遇问题请提交 Issue 或 PR。
  4. 使用风险自负,本工具不保证任何功能的可用性。
  5. 仅适用于“已经开启 VPN/代理但模型列表仍未更新”的场景,如果没有代理,本工具无法绕过地区限制。
  6. 目前只支持 macOS,其他系统(Windows/Linux)暂不可用。

背景

部分中国用户在使用 Cursor 时,由于注册邮箱(如 QQ 邮箱)或账户注册地等原因,被 Cursor 服务端识别为中国用户。即使开启 VPN,仍然只能看到有限的模型(如 DeepSeek、Kimi 等),无法使用 Claude、GPT 等国际模型。

有一种推测是 Cursor 会基于账户信息与地区记录来决定模型列表,而不仅仅是 IP 地址;但官方并未公开具体机制。

本工具通过直接修改本地数据库中的模型列表缓存,让这些模型在 UI 中显示出来。配合 VPN 使用,可以正常调用这些模型。 如果完全没有代理,本工具无法生效;它的用途仅限于“代理/VPN 已经开启,但模型列表依旧没有刷新”的情况。

解锁的模型

运行本工具后,你将可以看到以下模型:

Claude 系列

  • Claude 4.5 Opus / Opus Thinking
  • Claude 4.5 Sonnet / Sonnet Thinking
  • Claude 4.5 Haiku / Haiku Thinking
  • Claude 4.1 Opus
  • Claude 4 Sonnet

GPT 系列

  • GPT-5.1 Codex Max(多个变体)
  • GPT-5.1(多个变体)
  • GPT-4.1
  • o3 / o3 Pro

Gemini 系列

  • Gemini 3 Pro
  • Gemini 2.5 Pro
  • Gemini 2.5 Flash

其他

  • Grok 4 / Grok Code
  • DeepSeek R1 / V3.1
  • Kimi K2

系统要求

  • macOS(已在 macOS 14+ 测试)
  • Node.js >= 16.0.0
  • 已安装 Cursor 编辑器

安装

git clone https://github.com/user/cursor-model-unlocker.git
cd cursor-model-unlocker
npm install

使用方法

重要:运行任何命令前,请先关闭 Cursor!

解锁所有模型

# 使用 npm 脚本
npm start

# 或直接运行
node index.js unlock

# 强制解锁(即使检测到 Cursor 正在运行)
node index.js unlock --force

查看当前模型列表

node index.js list

备份配置

node index.js backup

从备份恢复

node index.js restore

导出模型配置到文件

node index.js export ./my-models.json

从文件导入模型配置

node index.js import ./my-models.json

打包与发布

本地打包(npm 包)

  1. 安装依赖:npm install
  2. 更新版本号:npm version patch(或 minormajor,会自动生成 git tag)
  3. 打包:npm run package

命令会清空 dist/ 目录并在其中生成 cursor-model-unlocker-<version>.tgz,这个文件就是可以直接分发的 npm 包。你也可以上传该压缩包到 Release 页面,方便没有 npm 环境的用户下载。

生成无需 Node.js 的二进制

如果希望产物不依赖系统中预装的 Node.js,可使用 pkg 将脚本和 Node 运行时一起打包:

  1. npm install(首次需要安装 pkg 及其依赖)
  2. npm run build:binary

生成的 dist/cursor-model-unlocker-macos-arm64dist/cursor-model-unlocker-macos-x64 已包含 Node 运行时以及 better-sqlite3 的原生模块,因此用户无需安装 Node.js,直接赋予执行权限即可:

chmod +x dist/cursor-model-unlocker-macos-arm64
./dist/cursor-model-unlocker-macos-arm64 unlock

目前仅针对 macOS (arm64/x64) 构建,如需其他平台可在 package.jsonbuild:binary 脚本中调整 pkg--targets

发布到 npm Registry

  1. 登录 npm 账号:npm login(首次发布需要在 npm 中创建 cursor-model-unlocker 包并设置为 public)
  2. 确认工作区干净、所有更改已推送
  3. 运行 npm version <patch|minor|major> 更新版本号
  4. 执行 npm run release

npm run release 会自动调用 npm run package 打包,并在当前版本号基础上发布到 npm(内部执行 npm publish --access public)。如果已经手动打包,也可以直接运行 npm publish --access public

建议在发布前再次跑通 npm startnode index.js list 等核心命令,确保打包内容正常。

工作原理

Cursor 将配置存储在 SQLite 数据库中,位置为:

~/Library/Application Support/Cursor/User/globalStorage/state.vscdb

可用模型列表存储在以下键中:

src.vs.platform.reactivestorage.browser.reactiveStorageServiceImpl.persistentStorage.applicationUser

本工具的工作流程:

  1. 创建数据库备份
  2. 读取当前配置
  3. availableDefaultModels2 替换为完整的模型列表
  4. 更新 featureModelConfigs 设置默认值
  5. 写回配置

备份位置

备份文件存储在:

~/.cursor-model-unlocker-backups/

工具会自动保留最近 10 个备份。

常见问题

"Cursor is running" 错误

运行工具前需要完全关闭 Cursor。可以使用以下命令强制关闭:

pkill -x "Cursor"

或者使用 --force 参数(不推荐)。

"Database not found" 错误

确保 Cursor 已安装且至少打开过一次。

模型显示了但无法使用

这是预期行为。虽然模型在本工具修改后会显示在 UI 中,但 Cursor 服务端仍可能根据以下因素限制访问:

  • 账户类型(Free/Pro/Business)
  • 注册邮箱域名(如 QQ 邮箱会被识别为中国用户)
  • IP 地址/地区

可能的解决方案:

  1. 使用 VPN(美国/欧洲节点)
  2. 使用国际邮箱(Gmail、Outlook)重新注册账号
  3. 联系 Cursor 官方请求更改账户地区
  4. 在 Cursor 设置中配置自己的 API Key

配合 VPN 使用

为了获得最佳效果,建议:

  1. 开启 VPN(选择美国或欧洲节点)
  2. 在 Cursor 中退出登录
  3. 运行本工具解锁模型
  4. 重新登录 Cursor
  5. 尝试使用 Claude/GPT 等模型

许可证

MIT

更新模型列表

如果 Cursor 更新了模型,你可以:

  1. 导出其他用户的完整模型配置:找一个能看到所有模型的账号,运行 node index.js export ./full-models.json 导出配置
  2. 导入到你的 Cursornode index.js import ./full-models.json
  3. 提交 PR 更新 models.js:帮助其他用户也能使用最新的模型列表

已知限制

  • 仅支持 macOS:Windows/Linux 的数据库路径不同,暂未支持
  • 临时方案:Cursor 更新后可能需要重新运行本工具
  • 需配合 VPN:模型显示后,调用时仍需要 VPN 才能正常访问
  • 模型列表可能过时:本工具内置的模型列表可能落后于 Cursor 最新版本

贡献

欢迎提交 Pull Request!特别是:

  • 更新 models.js 中的模型列表
  • 支持 Windows/Linux 平台
  • 修复 bug 或改进功能

相关链接


如果这个工具对你有帮助,请给个 Star ⭐