Elffuss BraidHub

kikocis/continue public

9875eaa07e45 · 9.1 KiBRawPermalink
1---
2title: "Context Providers"
3description: "Context Providers allow you to type '@' and see a dropdown of content that can all be provided to the model as context."
4---
5
6Context Providers allow you to type '@' and see a dropdown of content that can all be provided to the model as context.
7
8![Context Items](/images/customize/images/context-provider-example-0c96ff77286fa970b23dddfdc1fa986a.png)
9
10## Built-in Context Providers
11
12You can add any built-in context-providers in your config file as shown below:
13
14### `@File`
15
16Reference any file in your current workspace.
17
18<Tabs>
19 <Tab title="YAML">
20 ```yaml config.yaml
21 context:
22 - provider: file
23 ```
24 </Tab>
25 <Tab title="JSON (Deprecated)">
26 ```json config.json
27 {
28 "contextProviders": [
29 {
30 "name": "file"
31 }
32 ]
33 }
34 ```
35 </Tab>
36</Tabs>
37
38### `@Code`
39
40Reference specific functions or classes from throughout your project.
41
42<Tabs>
43 <Tab title="YAML">
44 ```yaml config.yaml
45 context:
46 - provider: code
47 ```
48 </Tab>
49 <Tab title="JSON (Deprecated)">
50 ```json config.json
51 {
52 "contextProviders": [
53 {
54 "name": "code"
55 }
56 ]
57 }
58 ```
59 </Tab>
60</Tabs>
61
62### `@Git Diff`
63
64Reference all of the changes you've made to your current branch. This is useful if you want to summarize what you've done or ask for a general review of your work before committing.
65
66<Tabs>
67 <Tab title="YAML">
68 ```yaml config.yaml
69 context:
70 - provider: diff
71 ```
72 </Tab>
73 <Tab title="JSON (Deprecated)">
74 ```json config.json
75 {
76 "contextProviders": [
77 {
78 "name": "diff"
79 }
80 ]
81 }
82 ```
83 </Tab>
84</Tabs>
85
86### `@Current File`
87
88Reference the currently open file.
89
90<Tabs>
91 <Tab title="YAML">
92 ```yaml config.yaml
93 context:
94 - provider: currentFile
95 ```
96 </Tab>
97 <Tab title="JSON (Deprecated)">
98 ```json config.json
99 {
100 "contextProviders": [
101 {
102 "name": "currentFile"
103 }
104 ]
105 }
106 ```
107 </Tab>
108</Tabs>
109
110### `@Terminal`
111
112Reference the last command you ran in your IDE's terminal and its output.
113
114<Tabs>
115 <Tab title="YAML">
116 ```yaml config.yaml
117 context:
118 - provider: terminal
119 ```
120 </Tab>
121 <Tab title="JSON (Deprecated)">
122 ```json config.json
123 {
124 "contextProviders": [
125 {
126 "name": "terminal"
127 }
128 ]
129 }
130 ```
131 </Tab>
132</Tabs>
133
134### `@Open`
135
136Reference the contents of all of your open files. Set `onlyPinned` to `true` to only reference pinned files.
137
138<Tabs>
139 <Tab title="YAML">
140 ```yaml config.yaml
141 context:
142 - provider: open
143 params:
144 onlyPinned: true
145 ```
146 </Tab>
147 <Tab title="JSON (Deprecated)">
148 ```json config.json
149 {
150 "contextProviders": [
151 {
152 "name": "open",
153 "params": {
154 "onlyPinned": true
155 }
156 }
157 ]
158 }
159 ```
160 </Tab>
161</Tabs>
162
163### `@Clipboard`
164
165Reference recent clipboard items
166
167<Tabs>
168 <Tab title="YAML">
169 ```yaml config.yaml
170 context:
171 - provider: clipboard
172 ```
173 </Tab>
174 <Tab title="JSON (Deprecated)">
175 ```json config.json
176 {
177 "contextProviders": [
178 {
179 "name": "clipboard"
180 }
181 ]
182 }
183 ```
184 </Tab>
185</Tabs>
186
187### `@Tree`
188
189Reference the structure of your current workspace.
190
191<Tabs>
192 <Tab title="YAML">
193 ```yaml config.yaml
194 context:
195 - provider: tree
196 ```
197 </Tab>
198 <Tab title="JSON (Deprecated)">
199 ```json config.json
200 {
201 "contextProviders": [
202 {
203 "name": "tree"
204 }
205 ]
206 }
207 ```
208 </Tab>
209</Tabs>
210
211### `@Problems`
212
213Get Problems from the current file.
214
215<Tabs>
216 <Tab title="YAML">
217 ```yaml config.yaml
218 context:
219 - provider: problems
220 ```
221 </Tab>
222 <Tab title="JSON (Deprecated)">
223 ```json config.json
224 {
225 "contextProviders": [
226 {
227 "name": "problems"
228 }
229 ]
230 }
231 ```
232 </Tab>
233</Tabs>
234
235### `@Debugger`
236
237Reference the contents of the local variables in the debugger. Currently only available in VS Code.
238
239<Tabs>
240 <Tab title="YAML">
241 ```yaml config.yaml
242 context:
243 - provider: debugger
244 params:
245 stackDepth: 3
246 ```
247 </Tab>
248 <Tab title="JSON (Deprecated)">
249 ```json config.json
250 {
251 "contextProviders": [
252 {
253 "name": "debugger",
254 "params": {
255 "stackDepth": 3
256 }
257 }
258 ]
259 }
260 ```
261 </Tab>
262</Tabs>
263
264Uses the top _n_ levels (defaulting to 3) of the call stack for that thread.
265
266### `@Repository Map`
267
268Reference the outline of your codebase. By default, signatures are included along with file in the repo map.
269
270`includeSignatures` params can be set to false to exclude signatures. This could be necessary for large codebases and/or to reduce context size significantly. Signatures will not be included if indexing is disabled.
271
272<Tabs>
273 <Tab title="YAML">
274 ```yaml config.yaml
275 context:
276 - provider: repo-map
277 params:
278 includeSignatures: false # default true
279 ```
280 </Tab>
281 <Tab title="JSON (Deprecated)">
282 ```json config.json
283 {
284 "contextProviders": [
285 {
286 "name": "repo-map",
287 "params": {
288 "includeSignatures": false // default true
289 }
290 }
291 ]
292 }
293 ```
294 </Tab>
295</Tabs>
296
297Provides a list of files and the call signatures of top-level classes, functions, and methods in those files. This helps the model better understand how a particular piece of code relates to the rest of the codebase.
298
299In the submenu that appears, you can select either `Entire codebase`, or specify a subfolder to generate the repostiory map from.
300
301This context provider is inpsired by [Aider's repository map](https://aider.chat/2023/10/22/repomap.html).
302
303### `@Operating System`
304
305Reference the architecture and platform of your current operating system.
306
307<Tabs>
308 <Tab title="YAML">
309 ```yaml config.yaml
310 context:
311 - provider: os
312 ```
313 </Tab>
314 <Tab title="JSON (Deprecated)">
315 ```json config.json
316 {
317 "contextProviders": [
318 {
319 "name": "os"
320 }
321 ]
322 }
323 ```
324 </Tab>
325</Tabs>
326
327### `@HTTP`
328
329The HttpContextProvider makes a POST request to the url passed in the configuration. The server must return 200 OK with a ContextItem object or an array of ContextItems.
330
331<Tabs>
332 <Tab title="YAML">
333 ```yaml config.yaml
334 context:
335 - provider: http
336 params:
337 url: "https://api.example.com/v1/users"
338 ```
339 </Tab>
340 <Tab title="JSON (Deprecated)">
341 ```json config.json
342 {
343 "contextProviders": [
344 {
345 "name": "http",
346 "params": {
347 "url": "https://api.example.com/v1/users"
348 }
349 }
350 ]
351 }
352 ```
353 </Tab>
354</Tabs>
355
356The receiving URL should expect to receive the following parameters:
357
358POST parameters
359
360```json
361{ query: string, fullInput: string}
362```
363
364The response 200 OK should be a JSON object with the following structure:
365
366Response
367
368```
369[ { "name": "", "description": "", "content": "" }]// OR{ "name": "", "description": "", "content": ""}
370```
371
372### Model Context Protocol
373
374The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a standard proposed by Anthropic to unify prompts, context, and tool use. Continue supports any MCP server with the MCP context provider. Read their [quickstart](https://modelcontextprotocol.io/quickstart) to learn how to set up a local server and then set up your configuration like this:
375
376<Tabs>
377 <Tab title="YAML">
378 ```yaml config.yaml
379 mcpServers:
380 - name: My MCP Server
381 command: uvx
382 args:
383 - mcp-server-sqlite
384 - --db-path
385 - /Users/NAME/test.db
386 ```
387 </Tab>
388 <Tab title="JSON (Deprecated)">
389 ```json config.json
390 {
391 "experimental": {
392 "modelContextProtocolServers": [
393 {
394 "transport": {
395 "type": "stdio",
396 "command": "uvx",
397 "args": ["mcp-server-sqlite", "--db-path", "/Users/NAME/test.db"]
398 }
399 }
400 ]
401 }
402 }
403 ```
404 </Tab>
405</Tabs>
406
407You'll then be able to type "@" and see "MCP" in the context providers dropdown.
408
409## Deprecated Context Providers
410
411<Note>
412 To provide conext beyond the built-in context providers, we now recommend using [MCP Servers](/customization/mcp-tools)
413</Note>
414
415View the [deprecated context providers](/reference/deprecated-context-providers) for documentation on:
416
417- [`@Codebase`](/reference/deprecated-codebase) - Use the [codebase awareness guide](/guides/codebase-documentation-awareness) instead
418- [`@Folder`](/reference/deprecated-codebase) - Use the [codebase awareness guide](/guides/codebase-documentation-awareness) instead
419- [`@Docs`](/reference/deprecated-docs) - Use the [documentation awareness guide](/guides/codebase-documentation-awareness) instead
420- `@Greptile` - Query Greptile index
421- `@Commits` - Reference git commits
422- `@Discord` - Reference Discord messages
423- `@Jira` - Reference Jira issues
424- `@Gitlab Merge Request` - Reference GitLab MRs
425- `@Google` - Google search results
426- `@Database` - Database schemas
427- `@Issue` - GitHub issues
428- `@Url` - URL content
429- `@Search` - Codebase search
430- `@Web` - Web search results