在opencode中使用cursor的API
使用的操作系统为 Windows 11
- 先在opencode官网( https://opencode.ai/ )安装CLI版:
npm i -g opencode-ai
- 安装完成后修改文件C:\Users\zhengjinpeng\.config\opencode\opencode.json,增加cursor插件
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["cursor-opencode-provider"],
"provider": {
"cursor": {
"npm": "cursor-opencode-provider",
"name": "Cursor",
"models": {}
}
}
}
- 打开cmd,输入
opencode auth login --provider cursor
然后会提供两种鉴权方式:1. 手动点击连接跳转登录;2. 输入key
然后就能在opencode中使用了:

如果cursor的API额度用完,输入/model,可以选择auto

浙公网安备 33010602011771号