diff --git a/documentation/docs/guides/config-files.md b/documentation/docs/guides/config-files.md index 7d0246070f03..906896761378 100644 --- a/documentation/docs/guides/config-files.md +++ b/documentation/docs/guides/config-files.md @@ -145,6 +145,17 @@ GOOSE_SEARCH_PATHS: These paths are prepended to the system PATH when running extension commands, ensuring your custom tools are found without modifying your global PATH. +## Recipe Command Configuration +You can optionally set up [custom slash commands](/docs/guides/recipes/session-recipes.md#custom-recipe-commands) to run recipes that you create. List the command (without the leading `/`) along with the path to the recipe: + +```yaml +slash_commands: + - command: "run-tests" + recipe_path: "/path/to/recipe.yaml" + - command: "daily-standup" + recipe_path: "/Users/me/.local/share/goose/recipes/standup.yaml" +``` + ## Configuration Priority Settings are applied in the following order of precedence: diff --git a/documentation/docs/guides/goose-cli-commands.md b/documentation/docs/guides/goose-cli-commands.md index 49713f271b10..894446f5c6ec 100644 --- a/documentation/docs/guides/goose-cli-commands.md +++ b/documentation/docs/guides/goose-cli-commands.md @@ -571,7 +571,7 @@ Once you're in an interactive session (via `goose session` or `goose run --inter - **`/prompt [--info] [key=value...]`** - Get prompt info or execute a prompt - **`/prompts [--extension ]`** - List all available prompts, optionally filtered by extension - **`/recipe [filepath]`** - Generate a recipe from the current conversation and save it to the specified filepath (must end with .yaml). If no filepath is provided, it will be saved to ./recipe.yaml -- **`/summarize`** - Summarize the current conversation to reduce context length while preserving key information +- **`/compact`** - Compact and summarize the current conversation to reduce context length while preserving key information - **`/t`** - Toggle between `light`, `dark`, and `ansi` themes. [More info](#themes). - **`/t `** - Set theme directly (light, dark, ansi) @@ -592,6 +592,7 @@ Once you're in an interactive session (via `goose session` or `goose run --inter # Clear the current conversation history /clear ``` +You can also create [custom slash commands for running recipes](/docs/guides/recipes/session-recipes.md#custom-recipe-commands) in goose Desktop or the CLI. --- diff --git a/documentation/docs/guides/recipes/session-recipes.md b/documentation/docs/guides/recipes/session-recipes.md index 444b071339dd..26f87f56d267 100644 --- a/documentation/docs/guides/recipes/session-recipes.md +++ b/documentation/docs/guides/recipes/session-recipes.md @@ -6,7 +6,7 @@ description: "Share a goose session setup (including tools, goals, and instructi import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -import { PanelLeft, Bot, SquarePen, Link, Calendar } from 'lucide-react'; +import { PanelLeft, Bot, SquarePen, Link, Calendar, Terminal } from 'lucide-react'; Sometimes you finish a task in goose and realize, "Hey, this setup could be useful again." Maybe you have curated a great combination of tools, defined a clear goal, and want to preserve that flow. Or maybe you're trying to help someone else replicate what you just did without walking them through it step by step. @@ -428,6 +428,55 @@ You can turn your current goose session into a reusable recipe that includes the +## Custom Recipe Commands +Create shortcuts to quickly run recipes in any goose chat session. Type a custom command like `/daily-report` to instantly apply that recipe's instructions. + + + + 1. Click the button in the top-left to open the sidebar + 2. Click `Recipes` + 3. Find the recipe you want to edit and click the button + 4. In the modal that pops up, type your custom command (without the leading `/`) into the text box + 5. Click `Save`. + + Once you assign a custom command, the `Recipes` menu displays that command in purple text under the recipe's creation date. Typing `/` into the goose Desktop chat window shows a popup menu with the available recipe commands. + +To run the recipe, type your custom command with a leading slash into any chat session in the desktop app: +``` +/run-tests +``` + + + + + Custom slash commands are configured in your goose [configuration file](/docs/guides/config-files.md). List the command (without the leading `/`) along with the path to the recipe: + +```yaml title="~/.config/goose/config.yaml" +slash_commands: + - command: "run-tests" + recipe_path: "/path/to/recipe.yaml" + - command: "daily-standup" + recipe_path: "/Users/me/.local/share/goose/recipes/standup.yaml" + ``` + + To run the recipe, type your custom command with a leading slash into any goose chat session: + ```sh + Context: ●○○○○○○○○○ 5% (9695/200000 tokens) + ( O)> /run-tests + ``` + + + +When you run a recipe using a slash command, the recipe's instructions and prompt fields are sent to your model and loaded into the conversation, but not displayed in chat. The model responds using the recipe's context and instructions just as if you opened it directly. + +:::info +- Custom Recipe commands don't support parameters or arguments. +- Command names are case-insensitive (`/Bug` and `/bug` are treated as the same command). +- Commands must be unique and contain no spaces. +- You cannot use names that conflict with [built-in CLI slash commands](/docs/guides/goose-cli-commands.md#slash-commands) like `/recipe`, `/compact`, or `/help`. +- If the recipe file is missing or invalid, the command will be treated as regular text sent to the model. +::: + ## Validate Recipe