-
Notifications
You must be signed in to change notification settings - Fork 2.4k
docs: slash commands topic #6333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+180
−55
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eae6e02
move slash commands
dianed-square ec65784
tweaks
dianed-square a5d90ca
Update documentation/docs/guides/context-engineering/slash-commands.md
dianed-square 477dfe2
Update documentation/docs/guides/context-engineering/slash-commands.md
dianed-square 263401d
Update documentation/docs/guides/context-engineering/slash-commands.md
dianed-square b6b7ce1
add topic content cards
dianed-square File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
documentation/docs/guides/context-engineering/slash-commands.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| --- | ||
| sidebar_position: 4 | ||
| title: Custom Slash Commands | ||
| sidebar_title: Slash Commands | ||
| description: "Create custom shortcuts to quickly apply reusable instructions in any goose chat session" | ||
| --- | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
| import { PanelLeft, Terminal } from 'lucide-react'; | ||
|
|
||
| Custom slash commands are personalized shortcuts to run [recipes](/docs/guides/recipes). If you have a recipe that runs a daily report, you can create a custom slash command to invoke that recipe from within a session: | ||
|
|
||
| ``` | ||
| /daily-report | ||
| ``` | ||
|
|
||
|
|
||
| ## Create Slash Commands | ||
|
|
||
| Assign a custom command to a recipe. | ||
|
|
||
| <Tabs groupId="interface"> | ||
| <TabItem value="ui" label="goose Desktop" default> | ||
| 1. Click the <PanelLeft className="inline" size={16} /> button in the top-left to open the sidebar | ||
| 2. Click `Recipes` in the sidebar | ||
| 3. Find the recipe you want to use and click the <Terminal className="inline" size={16} /> button | ||
| 4. In the modal that pops up, type your custom command (without the leading `/`) | ||
| 5. Click `Save` | ||
|
|
||
| The command appears under the recipe in your `Recipes` menu. For recipes that aren't in your Recipe Library, follow the `goose CLI` steps. | ||
|
|
||
| </TabItem> | ||
| <TabItem value="cli" label="goose CLI"> | ||
|
|
||
| Configure slash commands in your [configuration file](/docs/guides/config-files). List the command (without the leading `/`) along with the path to the recipe file on your computer: | ||
|
|
||
| ```yaml title="~/.config/goose/config.yaml" | ||
| slash_commands: | ||
| - command: "run-tests" | ||
| recipe_path: "/path/to/recipe.yaml" | ||
| - command: "daily-report" | ||
| recipe_path: "/Users/me/.local/share/goose/recipes/report.yaml" | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ## Use Slash Commands | ||
|
|
||
| In any chat session, type your custom command with a leading slash at the start of your message: | ||
|
|
||
| <Tabs groupId="interface"> | ||
| <TabItem value="ui" label="goose Desktop" default> | ||
|
|
||
| ``` | ||
| /run-tests | ||
| ``` | ||
|
|
||
| :::tip Available Commands | ||
| Typing `/` in goose Desktop shows a popup menu with the available slash commands. | ||
| ::: | ||
|
|
||
| </TabItem> | ||
| <TabItem value="cli" label="goose CLI"> | ||
|
|
||
| ```sh | ||
| Context: ●○○○○○○○○○ 5% (9695/200000 tokens) | ||
| ( O)> /run-tests | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| You can pass one parameter after the command (if needed). Quotation marks are optional: | ||
|
|
||
| ``` | ||
| /translator where is the library | ||
| ``` | ||
|
|
||
| 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. | ||
|
|
||
| ## Limitations | ||
|
|
||
| - Slash commands accept only one [parameter](/docs/guides/recipes/recipe-reference#parameters). Any additional parameters in the recipe must have default values. | ||
angiejones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Command names are case-insensitive (`/Bug` and `/bug` are treated as the same command). | ||
| - Command names must be unique and contain no spaces. | ||
| - You cannot use names that conflict with [built-in CLI slash commands](/docs/guides/goose-cli-commands#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. | ||
angiejones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Additional Resources | ||
|
|
||
| import ContentCardCarousel from '@site/src/components/ContentCardCarousel'; | ||
|
|
||
| <ContentCardCarousel | ||
| items={[ | ||
| { | ||
| type: 'topic', | ||
| title: 'Recipes', | ||
| description: 'Check out the Recipes guide for more docs, tools, and resources to help you master goose recipes.', | ||
| linkUrl: '/goose/docs/guides/recipes' | ||
| }, | ||
| { | ||
| type: 'topic', | ||
| title: 'Research → Plan → Implement Patterns', | ||
| description: 'See how slash commands make it easy to integrate instructions into interactive RPI workflows.', | ||
| linkUrl: '/goose/docs/tutorials/rpi' | ||
| } | ||
| ]} | ||
| /> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.