Skip to main content

保存 Recipes

本指南介绍当你后续还需要再次使用 recipe 时,如何保存、组织、导入和查找 goose recipes。

Desktop UI vs CLI
  • goose Desktop 提供可视化的 Recipe Library,用来浏览和管理已保存的 recipes
  • goose CLI 把 recipes 存成文件,并通过路径或环境变量查找它们

理解 Recipe 存储

在保存 recipe 之前,先理解 recipe 可以存放在哪里,以及这会如何影响它的可用范围。

Recipe 存储位置

类型位置可用范围适合场景
全局~/.config/goose/recipes/所有项目和会话个人工作流、通用 recipe
本地YOUR_WORKING_DIRECTORY/.goose/recipes/仅当前项目可见项目专属流程、团队共享 recipe

适合使用全局存储的情况:

  • 你希望 recipe 在所有项目里都能使用
  • 它是个人工作流或通用 recipe
  • 主要由你自己使用

适合使用本地存储的情况:

  • recipe 只适用于某个特定项目
  • 你在团队里协作,希望项目成员共享同一套 recipe
  • recipe 依赖项目专属文件或配置

保存 Recipes

保存新 Recipe:

  1. 若要从当前会话创建 recipe,请先参考创建 Recipe
  2. 进入 Recipe Editor 后,点击 Save Recipe 将其保存到 Recipe Library

保存已修改的 Recipe:

如果你已经在使用某个 recipe,并想把修改后的版本保存下来:

  1. 发送第一条消息后,点击应用底部的 按钮
  2. 修改 instructions、prompt 或其他字段
  3. 点击 Save Recipe
info

如果你修改 recipe 后使用了新名称保存,系统会生成一个新的 recipe 和新链接。原来的 recipe 仍可通过 Recipe Library 或旧链接继续运行。

如果你编辑 recipe 时没有改名,Recipe Library 里的版本会被更新,但原始链接仍然可以继续打开旧版本。

导入 Recipes

你可以通过 deeplink 或 recipe 文件导入 recipe:

  1. 点击左上角的 打开侧边栏
  2. 在侧边栏里点击 Recipes
  3. 点击 Import Recipe
  4. 选择导入方式:
    • 通过链接导入:在 Recipe Deeplink 区域粘贴recipe 链接
    • 通过文件导入:在 Recipe File 区域点击 Choose File,选择 recipe 文件后点击 Open
  5. 点击 Import Recipe,将 recipe 的副本保存到你的 Recipe Library
Recipe 文件格式

goose Desktop 接受 .yaml.yml.json 文件,但 CLI 只支持 .yaml.json。如果你希望同时兼容 Desktop 和 CLI,最好不要使用 .yml 扩展名。

所有 recipe 文件都遵循相同的 schema 结构

查找可用 Recipes

进入 Recipe Library:

  1. 点击左上角的 打开侧边栏
  2. 点击 Recipes 打开 Recipe Library
  3. 浏览你当前可用的 recipes,列表中会显示:
    • Recipe 标题与描述
    • 最近修改时间
    • 它是全局存储还是本地存储
Desktop 与 CLI 的 recipe 发现方式不同

Desktop 的 Recipe Library 只展示你显式保存或导入过的 recipes。它不会像 CLI 那样自动扫描文件系统中的 recipe 文件。

使用已保存的 Recipes

  1. 点击左上角的 打开侧边栏
  2. 点击 Recipes
  3. 在 Recipe Library 中找到目标 recipe
  4. 选择以下操作之一:
    • 点击 Use 立即运行
    • 点击 Preview 先查看详情,再点击 Load Recipe 运行