Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion documentation/docs/guides/recipes/recipe-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ The `extensions` field allows you to specify which Model Context Protocol (MCP)
| `name` | String | Unique name for the extension |
| `cmd` | String | Command to run the extension |
| `args` | Array | List of arguments for the command |
| `env_keys` | Array | (Optional) Names of environment variables required by the extension |
| `timeout` | Number | Timeout in seconds |
| `bundled` | Boolean | (Optional) Whether the extension is bundled with Goose |
| `description` | String | Description of what the extension does |
Expand All @@ -163,9 +164,35 @@ extensions:
cmd: uvx
args:
- 'mcp_presidio@latest'
description: "For searching logs using Presidio"

- type: stdio
name: github-mcp
cmd: github-mcp-server
args: []
env_keys:
- GITHUB_PERSONAL_ACCESS_TOKEN
timeout: 60
description: "GitHub MCP extension for repository operations"
```

### Extension Secrets

This feature is only available through the CLI.

If a recipe uses an extension that requires a secret, Goose can prompt users to provide the secret when running the recipe:

1. When a recipe is loaded, Goose scans all extensions (including those in sub-recipes) for `env_keys` fields
2. If any required environment variables are missing from the secure keyring, Goose prompts the user to enter them
3. Values are stored securely in the system keyring and reused for subsequent runs

To update a stored secret, remove it from the system keyring and run the recipe again to be re-prompted.

:::info
This feature is designed to prompt for and securely store secrets (such as API keys), but `env_keys` can include any environment variable needed by the extension (such as API endpoints, configuration values, etc.).

Users can press `ESC` to skip entering a variable if it's optional for the extension.
:::

## Settings

The `settings` field allows you to configure the AI model and provider settings for the recipe. This overrides the default configuration when the recipe is executed.
Expand Down Expand Up @@ -370,6 +397,20 @@ Advanced template features include:
Default content
{% endblock %}
```
- `indent()` template filter

### indent() Filter For Multi-Line Values

Use the `indent()` filter to ensure multi-line parameter values are properly indented and can be resolved as valid JSON or YAML format. This example uses `{{ raw_data | indent(2) }}` to specify an indentation of two spaces when passing data to a sub-recipe:

```yaml
sub_recipes:
- name: "analyze"
path: "./analyze.yaml"
values:
content: |
{{ raw_data | indent(2) }}

@lifeizhou-ap lifeizhou-ap Aug 5, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! thanks for adding this in!

{{ raw_data | indent(2) }} mabye have more indent to align with the content

      content: |
        {{ raw_data | indent(2) }}

```

## Built-in Parameters

Expand Down
3 changes: 2 additions & 1 deletion documentation/docs/guides/recipes/session-recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,11 @@ You can turn your current Goose session into a reusable recipe that includes the

</TabItem>
</Tabs>
:::info Privacy & Isolation
:::info Privacy, Isolation, & Secrets
- Each person gets their own private session
- No data is shared between users
- Your session won't affect the original recipe creator's session
- The CLI can prompt users for required [extension secrets](/docs/guides/recipes/recipe-reference#extension-secrets)
:::

</TabItem>
Expand Down
6 changes: 3 additions & 3 deletions documentation/docs/guides/recipes/sub-recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ Sub-recipe sessions run in isolation - they don't share conversation history, me

### Parameter Handling

Sub-recipes receive parameters in two ways:
Parameters received by sub-recipes can be used in prompts and instructions using `{{ parameter_name }}` syntax. Sub-recipes receive parameters in two ways:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sub-recipes, they can run by itself.
So if they have their own params and used as sub-recipe, we can pass in the main recipe via

values:
      content:  content_value

There is another usage, the parameter value can be passed via session context so that the user does not have to specify.

I am sorry if I have confused you. I'll create some example recipe and share with you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 Replaced "automatic inheritance" with "context-based parameters"


1. **Pre-set values**: Fixed parameter values defined in the `values` field are automatically provided and cannot be overridden at runtime
2. **Automatic parameter inheritance**: Sub-recipes automatically have access to all parameters passed to the main recipe at runtime.

Pre-set values take precedence over inherited parameters. If both the main recipe and `values` field provide the same parameter, the `values` version is used.

:::info Template Variables
Parameters received by sub-recipes can be used in prompts and instructions using `{{ parameter_name }}` syntax.
:::tip
Use the `indent()` filter to maintain valid YAML format when passing multi-line parameter values to sub-recipes, for example: `{{ content | indent(2) }}`. See [Template Support](/docs/guides/recipes/recipe-reference#template-support) for more details.
:::

## Examples
Expand Down
4 changes: 3 additions & 1 deletion documentation/docs/tutorials/recipes-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ goose run --recipe trip.yaml

## Extensions

Goose recipes have a section where you can specify which extensions Goose can use during execution. Goose will only use the ones you specify.
Goose recipes have a section where you can specify which [extensions](/docs/guides/recipes/recipe-reference#extensions) Goose can use during execution. Goose will only use the ones you specify.

Let's say we want to make sure we have good weather during our Europe trip. We can just add a weather extension (this example uses the [weather-mcp-server](https://github.com/TuanKiri/weather-mcp-server) by TuanKiri under the MIT License) to our recipe, modify the prompt a bit and now Goose will check the weather before adding a city to our trip.

Expand All @@ -53,6 +53,8 @@ extensions:
args: []
timeout: 300
description: "Weather data for trip planning"
env_keys:
- WEATHER_API_KEY
```

## Parameters
Expand Down