1# Assistant Commands
2
3## Overview
4
5Slash commands enhance the assistant's capabilities. Begin by typing a `/` at the beginning of the line to see a list of available commands:
6
7- `/default`: Inserts the default prompt into the context
8- `/diagnostics`: Injects errors reported by the project's language server into the context
9- `/fetch`: Fetches the content of a webpage and inserts it into the context
10- `/file`: Inserts a single file or a directory of files into the context
11- `/now`: Inserts the current date and time into the context
12- `/prompt`: Adds a custom-configured prompt to the context ([see Prompt Library](./prompting#prompt-library))
13- `/symbols`: Inserts the current tab's active symbols into the context
14- `/tab`: Inserts the content of the active tab or all open tabs into the context
15- `/terminal`: Inserts a select number of lines of output from the terminal
16- `/selection`: Inserts the selected text into the context
17
18### Other Commands:
19
20- `/search`: Performs semantic search for content in your project based on natural language
21 - Not generally available yet, but some users may have access to it.
22
23> **Note:** Remember, commands are only evaluated when the context is created or when the command is inserted, so a command like `/now` won't continuously update, or `/file` commands won't keep their contents up to date.
24
25## `/default`
26
27Read more about `/default` in the [Prompting: Editing the Default Prompt](./prompting.md#default-prompt) section.
28
29Usage: `/default`
30
31## `/diagnostics`
32
33The `/diagnostics` command injects errors reported by the project's language server into the context. This is useful for getting an overview of current issues in your project.
34
35Usage: `/diagnostics [--include-warnings] [path]`
36
37- `--include-warnings`: Optional flag to include warnings in addition to errors.
38- `path`: Optional path to limit diagnostics to a specific file or directory.
39
40## `/file`
41
42The `/file` command inserts the content of a single file or a directory of files into the context. This allows you to reference specific parts of your project in your conversation with the assistant.
43
44Usage: `/file <path>`
45
46You can use glob patterns to match multiple files or directories.
47
48Examples:
49
50- `/file src/index.js` - Inserts the content of `src/index.js` into the context.
51- `/file src/*.js` - Inserts the content of all `.js` files in the `src` directory.
52- `/file src` - Inserts the content of all files in the `src` directory.
53
54## `/now`
55
56The `/now` command inserts the current date and time into the context. This can be useful letting the language model know the current time (and by extension, how old their current knowledge base is).
57
58Usage: `/now`
59
60## `/prompt`
61
62The `/prompt` command inserts a prompt from the prompt library into the context. It can also be used to nest prompts within prompts.
63
64Usage: `/prompt <prompt_name>`
65
66Related: `/default`
67
68## `/symbols`
69
70The `/symbols` command inserts the active symbols (functions, classes, etc.) from the current tab into the context. This is useful for getting an overview of the structure of the current file.
71
72Usage: `/symbols`
73
74## `/tab`
75
76The `/tab` command inserts the content of the active tab or all open tabs into the context. This allows you to reference the content you're currently working on.
77
78Usage: `/tab [tab_name|all]`
79
80- `tab_name`: Optional name of a specific tab to insert.
81- `all`: Insert content from all open tabs.
82
83Examples:
84
85- `/tab` - Inserts the content of the active tab.
86- `/tab "index.js"` - Inserts the content of the tab named "index.js".
87- `/tab all` - Inserts the content of all open tabs.
88
89## `/terminal`
90
91The `/terminal` command inserts a select number of lines of output from the terminal into the context. This is useful for referencing recent command outputs or logs.
92
93Usage: `/terminal [<number>]`
94
95- `<number>`: Optional parameter to specify the number of lines to insert (default is a 50).
96
97## `/selection`
98
99The `/selection` command inserts the selected text in the editor into the context. This is useful for referencing specific parts of your code.
100
101This is equivalent to the `assistant: quote selection` command ({#kb assistant::QuoteSelection}). See [Interacting with the Assistant](./assistant-panel.md#interacting-with-the-assistant)).
102
103Usage: `/selection`
104
105## Extensibility
106
107Additional slash commands can be provided by extensions.
108
109See [Extension: Slash Commands](../extensions/slash-commands.md) to learn how to create your own.