Elffuss BraidHub

kikocis/continue public

dfc814e4318e · 9.0 KiBRawPermalink
1---
2title: "Context Providers"
3description: "Context Providers allow you to type '@' and see a dropdown of content that can all be fed to the LLM as context. Every context provider is a plugin, which means if you want to reference some source of information that you don't see here, you can request (or build!) a new context provider."
4---
5
6As an example, say you are working on solving a new GitHub Issue. You type '@Issue' and select the one you are working on. Continue can now see the issue title and contents. You also know that the issue is related to the files 'readme.md' and 'helloNested.py', so you type '@readme' and '@hello' to find and select them. Now these 3 "Context Items" are displayed inline with the rest of your input.
7
8![Context Items](/images/customize/images/context-provider-example-0c96ff77286fa970b23dddfdc1fa986a.png)
9
10## How Do Context Blocks Work?
11
12You can add context providers to assistants using [`context` blocks](/hub/blocks/block-types#context). Explore available context blocks in [the hub](https://hub.continue.dev/explore/context).
13
14## Built-in Context Providers
15
16You can add any built-in context-providers in your config file as shown below:
17
18### @File Context Provider – Reference Files in Your Workspace
19
20Reference any file in your current workspace.
21
22- YAML
23- JSON
24
25config.yaml
26
27```
28context: - provider: file
29```
30
31config.json
32
33```json
34{ "contextProviders": [{ "name": "file" }] }
35```
36
37### @Code Context Provider – Reference Functions and Classes
38
39Reference specific functions or classes from throughout your project.
40
41- YAML
42- JSON
43
44config.yaml
45
46```
47context: - provider: code
48```
49
50config.json
51
52```json
53{ "contextProviders": [{ "name": "code" }] }
54```
55
56### @Git Diff Context Provider – Reference Branch Changes
57
58Reference 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.
59
60- YAML
61- JSON
62
63config.yaml
64
65```
66context: - provider: diff
67```
68
69config.json
70
71```json
72{ "contextProviders": [{ "name": "diff" }] }
73```
74
75### @Current File Context Provider – Reference the Active File
76
77Reference the currently open file.
78
79- YAML
80- JSON
81
82config.yaml
83
84```
85context: - provider: currentFile
86```
87
88config.json
89
90```json
91{ "contextProviders": [{ "name": "currentFile" }] }
92```
93
94### @Terminal Context Provider – Reference Last Terminal Command and Output
95
96Reference the last command you ran in your IDE's terminal and its output.
97
98- YAML
99- JSON
100
101config.yaml
102
103```
104context: - provider: terminal
105```
106
107config.json
108
109```json
110{ "contextProviders": [{ "name": "terminal" }] }
111```
112
113### @Docs Context Provider – Reference Documentation Site Content
114
115Reference the contents from any documentation site.
116
117- YAML
118- JSON
119
120config.yaml
121
122```
123context: - provider: docs
124```
125
126config.json
127
128```json
129{ "contextProviders": [{ "name": "docs" }] }
130```
131
132Note that this will only enable the `@Docs` context provider.
133
134To use it, you need to add a documentation site to your config file. See the [docs](/customize/overview#documentation-context) page for more information.
135
136### @Open Context Provider – Reference All Open Files or Pinned Files
137
138Reference the contents of all of your open files. Set `onlyPinned` to `true` to only reference pinned files.
139
140- YAML
141- JSON
142
143config.yaml
144
145```
146context:
147 - provider: open
148 params:
149 onlyPinned: true
150```
151
152config.json
153
154```json
155{ "contextProviders": [{ "name": "open", "params": { "onlyPinned": true } }] }
156```
157
158### @Web Context Provider – Reference Relevant Web Pages
159
160Reference relevant pages from across the web, automatically determined from your input.
161
162Optionally, set `n` to limit the number of results returned (default 6).
163
164- YAML
165- JSON
166
167config.yaml
168
169```
170context:
171 - provider: web
172 params:
173 n: 5
174```
175
176config.json
177
178```json
179{ "contextProviders": [{ "name": "web", "params": { "n": 5 } }] }
180```
181
182### @Codebase Context Provider – Reference Relevant Codebase Snippets
183
184Reference the most relevant snippets from your codebase.
185
186- YAML
187- JSON
188
189config.yaml
190
191```
192context:
193 - provider: codebase
194```
195
196config.json
197
198```json
199{ "contextProviders": [{ "name": "codebase" }] }
200```
201
202Read more about indexing and retrieval [here](/customize/overview#codebase-context).
203
204### @Folder Context Provider – Reference Code from a Specific Folder
205
206Uses the same retrieval mechanism as `@Codebase`, but only on a single folder.
207
208- YAML
209- JSON
210
211config.yaml
212
213```
214context: - provider: folder
215```
216
217config.json
218
219```json
220{ "contextProviders": [{ "name": "folder" }] }
221```
222
223### @Search Context Provider – Reference Code Search Results
224
225Reference the results of codebase search, just like the results you would get from VS Code search.
226
227- YAML
228- JSON
229
230config.yaml
231
232```
233context:
234 - provider: search
235 params:
236 maxResults: 100 # optional, defaults to 200
237```
238
239config.json
240
241```json
242{ "contextProviders": [ { "name": "search", "params": { "maxResults": 100 // optional, defaults to 200 } } ]}
243```
244
245This context provider is powered by [ripgrep](https://github.com/BurntSushi/ripgrep).
246
247### @Url Context Provider – Reference Content from a URL
248
249Reference the markdown converted contents of a given URL.
250
251- YAML
252- JSON
253
254config.yaml
255
256```
257context:
258 - provider: url
259```
260
261config.json
262
263```json
264{ "contextProviders": [{ "name": "url" }] }
265```
266
267### @Clipboard Context Provider – Reference Clipboard Items
268
269Reference recent clipboard items
270
271- YAML
272- JSON
273
274config.yaml
275
276```
277context:
278 - provider: clipboard
279```
280
281config.json
282
283```json
284{ "contextProviders": [{ "name": "clipboard" }] }
285```
286
287### @Tree Context Provider – Reference Workspace File Structure
288
289Reference the structure of your current workspace.
290
291- YAML
292- JSON
293
294config.yaml
295
296```
297context:
298 - provider: tree
299```
300
301config.json
302
303```json
304{ "contextProviders": [{ "name": "tree" }] }
305```
306
307### @Problems Context Provider – Reference Problems in the Current File
308
309Get Problems from the current file.
310
311- YAML
312- JSON
313
314config.yaml
315
316```
317context:
318 - provider: problems
319```
320
321config.json
322
323```json
324{ "contextProviders": [{ "name": "problems" }] }
325```
326
327### @Debugger Context Provider – Reference Debugger Local Variables
328
329Reference the contents of the local variables in the debugger. Currently only available in VS Code.
330
331- YAML
332- JSON
333
334config.yaml
335
336```
337context:
338 - provider: debugger
339 params:
340 stackDepth: 3
341```
342
343config.json
344
345```json
346{ "contextProviders": [{ "name": "debugger", "params": { "stackDepth": 3 } }] }
347```
348
349Uses the top _n_ levels (defaulting to 3) of the call stack for that thread.
350
351### @Repository Map Context Provider – Reference Codebase Outline and Signatures
352
353Reference the outline of your codebase. By default, signatures are included along with file in the repo map.
354
355`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.
356
357- YAML
358- JSON
359
360config.yaml
361
362```
363context:
364 - provider: repo-map
365 params:
366 includeSignatures: false # default true
367```
368
369config.json
370
371```json
372{ "contextProviders": [ { "name": "repo-map", "params": { "includeSignatures": false // default true } } ]}
373```
374
375Provides 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.
376
377In the submenu that appears, you can select either `Entire codebase`, or specify a subfolder to generate the repository map from.
378
379This context provider is inspired by [Aider's repository map](https://aider.chat/2023/10/22/repomap.html).
380
381### @Operating System Context Provider – Reference System Architecture and Platform
382
383Reference the architecture and platform of your current operating system.
384
385- YAML
386- JSON
387
388config.yaml
389
390```
391context:
392 - provider: os
393```
394
395config.json
396
397```json
398{ "contextProviders": [{ "name": "os" }] }
399```
400
401### Using the Model Context Protocol (MCP) in Continue
402
403The [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:
404
405- YAML
406- JSON
407
408config.yaml
409
410```
411mcpServers:
412 - name: My MCP Server
413 command: uvx
414 args:
415 - mcp-server-sqlite
416 - --db-path
417 - /Users/NAME/test.db
418```
419
420config.json
421
422```json
423{
424 "experimental": {
425 "modelContextProtocolServers": [
426 {
427 "transport": {
428 "type": "stdio",
429 "command": "uvx",
430 "args": ["mcp-server-sqlite", "--db-path", "/Users/NAME/test.db"]
431 }
432 }
433 ]
434 }
435}
436```
437
438You'll then be able to type "@" and see "MCP" in the context providers dropdown.
439
440### How to Request a New Context Provider in Continue
441
442Not seeing what you want? Create an issue [here](https://github.com/continuedev/continue/issues/new?assignees=TyDunn&labels=enhancement&projects=&template=feature-request-%F0%9F%92%AA.md&title=) to request a new Context Provider.