- ~/Code/ 统一代码目录、nvm/cfg 加载、Git 署名等共识 - 写入 SOUL.md 焊进 system prompt,每次对话自动生效 [小糯]
49 lines
771 B
Markdown
49 lines
771 B
Markdown
# 10. Cursor Agent (Coding Agent)
|
|
|
|
## 检查
|
|
|
|
```bash
|
|
cursor-agent --version
|
|
eval "$(cfg env)" && echo $CURSOR_API_KEY | head -c 10
|
|
```
|
|
|
|
✅ 达标:`cursor-agent` 可用,`CURSOR_API_KEY` 已配置
|
|
|
|
## 前置
|
|
|
|
- 已完成 01 (Node.js & nvm)
|
|
- 已完成 03 (cfg CLI) — API key 存入 cfg
|
|
|
|
## 安装
|
|
|
|
### 1. 安装 cursor-agent
|
|
|
|
```bash
|
|
curl -fsSL https://www.cursor.com/agent/install.sh | bash
|
|
```
|
|
|
|
### 2. 获取 API Key
|
|
|
|
向主人 (沙洲) 索取 Cursor API Key。拿到后存入 cfg:
|
|
|
|
```bash
|
|
cfg set CURSOR_API_KEY '拿到的key' --secret
|
|
```
|
|
|
|
### 3. 配置 YOLO 模式
|
|
|
|
编辑 `~/.cursor/cli-config.json`,设置:
|
|
|
|
```json
|
|
{
|
|
"approvalMode": "none"
|
|
}
|
|
```
|
|
|
|
## 验证
|
|
|
|
```bash
|
|
cursor-agent --version
|
|
eval "$(cfg env)" && echo $CURSOR_API_KEY | head -c 10
|
|
```
|