接入 goose
goose 是 Block 开源的 AI 智能体。
方式一 · 让 goose 自己配置(推荐)
把下面的提示复制给 goose:
text
帮我安装知言家 AI Coding 伴侣的 goose Open Plugins 插件。读取 https://zyhome.run/docs/integrations/goose.txt 并按步骤执行。插件必须放到 %USERPROFILE%\.agents\plugins\zy-home\;发现重复或冲突时先问我,不要覆盖其他插件。完成后告诉我创建了哪些文件、是否需要重启 goose。方式二 · 手动安装
goose 通过用户级 Open Plugins 插件同步任务状态。
1. 创建插件目录并下载脚本
powershell
$PluginDir = Join-Path $env:USERPROFILE '.agents\plugins\zy-home'
$HooksDir = Join-Path $PluginDir 'hooks'
$ScriptsDir = Join-Path $PluginDir 'scripts'
New-Item -ItemType Directory -Path $HooksDir,$ScriptsDir -Force | Out-Null
Invoke-WebRequest `
-Uri 'https://zyhome.run/docs/integrations/zy-home-hook.ps1' `
-OutFile (Join-Path $ScriptsDir 'zy-home-hook.ps1')2. 创建插件清单
新建 %USERPROFILE%\.agents\plugins\zy-home\plugin.json:
json
{
"name": "zy-home",
"version": "1.0.0",
"description": "知言家 AI Coding 伴侣任务状态同步"
}3. 创建 Hook 配置
新建 %USERPROFILE%\.agents\plugins\zy-home\hooks\hooks.json:
json
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}/scripts/zy-home-hook.ps1\" -Profile goose -Event start",
"timeout": 8
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}/scripts/zy-home-hook.ps1\" -Profile goose -Event stop",
"timeout": 8
}
]
}
]
}
}检查 %USERPROFILE%\.config\goose\settings.json,确保 disabledPlugins 中没有 zy-home。也要检查当前项目的 .agents\plugins\,同名插件只保留一份。
4. 重启 goose
完全退出 goose 后重新打开。goose 会在启动时发现用户级插件。
验证
- 确认三个文件都在
%USERPROFILE%\.agents\plugins\zy-home\的对应位置。 - 重启 goose 并发送一条普通消息。
- 确认驱动出现来源为 goose 的任务,设备进入处理中。
- 本轮结束后,确认任务进入完成状态。
注意事项
- 这是 Open Plugins 目录,不是 goose 的普通工具配置。
- 只配置
UserPromptSubmit和Stop;工具、文件和 Shell 事件不会创建知言家任务。 - Hook 失败时 goose 会继续执行,脚本也不会发送 Prompt 或工具内容。
速查
| 项目 | 路径或动作 |
|---|---|
| 转发脚本来源 | zy-home-hook.ps1 |
| 插件目录 | %USERPROFILE%\.agents\plugins\zy-home\ |
| 必需文件 | plugin.json、hooks\hooks.json、scripts\zy-home-hook.ps1 |
| 完成后 | 完全退出并重新打开 goose |
