noteTb: 287
This data as json
| id | user_id | content | tags | created_at | updated_at | enable | pinned | folder_id | comment | position | visibility |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 287 | 1 1 | win系统安装goose经验 作者:Goose 版本:1.0 # 背景 在 Windows Server(Administrator 用户)上安装和配置 goose CLI,使用 DeepSeek API 作为后端模型。 # 安装步骤 ## 1. 下载安装 从 GitHub Releases 下载 Windows 版本: https://github.com/aaif-goose/goose/releases 下载 `goose-x86_64-pc-windows-msvc.zip`,解压后将 `goose.exe` 放到: ``` C:\Users\Administrator\.local\bin\ ``` ## 2. 验证安装 ```powershell C:\Users\Administrator\.local\bin\goose --version ``` 输出:1.33.1 ## 3. 添加 PATH(可选) ```powershell $env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH" ``` 永久添加需编辑 $PROFILE 文件。 ## 4. 配置 API Key(环境变量方式) ```powershell [System.Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "你的DeepSeek密钥", "User") [System.Environment]::SetEnvironmentVariable("OPENAI_HOST", "https://api.deepseek.com", "User") [System.Environment]::SetEnvironmentVariable("GOOSE_MODEL", "deepseek-v4-flash", "User") ``` ## 5. 配置文件路径 ``` C:\Users\Administrator\AppData\Roaming\Block\goose\config\config.yaml ``` # 踩坑记录 ## ❌ 坑1:Thinking Mode 导致报错 **现象**:使用 `deepseek-v4-flash` 或 `deepseek-v4-pro` 时,goose 调用工具后报 400 错误: ``` Request failed: Bad request (400): The `reasoning_content` in the thinking mode must be passed back to the API. ``` **原因**:DeepSeek V4 系列的 thinking mode 在工具调用后,要求把 `reasoning_content` 原样传回,但 goose 按 OpenAI 标准格式实现,没有处理这个 DeepSeek 自定义的扩展字段。 **解决**:换用旧版模型 `deepseek-chat`(不带 thinking mode),问题消失。 ```yaml GOOSE_MODEL: deepseek-chat # 代替 deepseek-v4-flash ``` ⚠️ 注意:`deepseek-chat` 将于 2026/07/24 废弃,届时需要找到替代方案。 ## ❌ 坑2:Custom Providers 配置不全 **现象**:走 `goose configure` → Custom Providers 一路点完,配置文件中只写了 `provider: openai`,缺少 model、API Key、Host 等信息。 **原因**:Custom Providers 的交互菜单问了很多问题(是否需认证、是否支持流式、是否需自定义头等),但最终写入配置文件的内容不完整。 **解决**:手动编辑 config.yaml,或者直接设环境变量 `OPENAI_API_KEY` + `OPENAI_HOST`。 ## ❌ 坑3:PATH 没加,找不到 goose 命令 **现象**:输入 `goose` 提示找不到命令。 **解决**:用完整路径 `C:\Users\Administrator\.local\bin\goose` 运行,或加 PATH。 # 最终配置 ```yaml provider: openai model: deepseek-chat ``` 环境变量: - OPENAI_API_KEY = DeepSeek 的 API Key - OPENAI_HOST = https://api.deepseek.com # 已知问题 - deepseek-v4-flash/pro 因 thinking mode 兼容问题无法使用 - 需在 2026/07/24 前找到替代方案(换 OpenRouter、换其他模型、或等 goose 更新) | ["goose", "Windows", "安装", "经验", "DeepSeek"] | 2026-05-13 15:51:12 | 2026-05-13 15:51:12 | T | F | 25 25 | 0 | public |