Context providers
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.
As 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.
Built-in Context Providers
To use any of the built-in context providers, open config.json
and add it to the contextProviders
list.
@File
Reference any file in your current workspace.
{
"contextProviders": [
{
"name": "file"
}
]
}
@Code
Reference specific functions or classes from throughout your project.
{
"contextProviders": [
{
"name": "code"
}
]
}
@Git Diff
Reference 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.
{
"contextProviders": [
{
"name": "diff"
}
]
}
@Terminal
Reference the contents of your IDE's terminal.
{
"contextProviders": [
{
"name": "terminal"
}
]
}
@Docs
Reference the contents from any documentation site.
{
"contextProviders": [
{
"name": "docs"
}
]
}
Note that this will only enable the @Docs
context provider.
To use it, you need to add a documentation site to your config.json
. See the docs page for more information.
@Open
Reference the contents of all of your open files. Set onlyPinned
to true
to only reference pinned files.
{
"contextProviders": [
{
"name": "open",
"params": {
"onlyPinned": true
}
}
]
}
@Codebase
Reference the most relevant snippets from your codebase.
{
"contextProviders": [
{
"name": "codebase"
}
]
}
Read more about indexing and retrieval here.
@Folder
Uses the same retrieval mechanism as @Codebase
, but only on a single folder.
{
"contextProviders": [
{
"name": "folder"
}
]
}
@Search
Reference the results of codebase search, just like the results you would get from VS Code search.
{
"contextProviders": [
{
"name": "search"
}
]
}
This context provider is powered by ripgrep.
@Url
Reference the markdown converted contents of a given URL.
{
"contextProviders": [
{
"name": "url"
}
]
}
@Tree
Reference the structure of your current workspace.
{
"contextProviders": [
{
"name": "tree"
}
]
}
@Google
Reference the results of a Google search.
{
"contextProviders": [
{
"name": "google",
"params": {
"serperApiKey": "<your serper.dev api key>"
}
}
]
}
For example, type "@Google python tutorial" if you want to search and discuss ways of learning Python.
Note: You can get an API key for free at serper.dev.
@Issue
Reference the conversation in a GitHub issue.
{
"contextProviders": [
{
"name": "issue",
"params": {
"repos": [
{
"owner": "continuedev",
"repo": "continue"
}
],
"githubToken": "ghp_xxx"
}
}
]
}
Make sure to include your own GitHub personal access token to avoid being rate-limited.
@Gitlab Merge Request
Reference an open MR for this branch on GitLab.
{
"contextProviders": [
{
"name": "gitlab-mr",
"params": {
"token": "..."
}
}
]
}
You will need to create a personal access token with the read_api
scope.
Using Self-Hosted GitLab
You can specify the domain to communicate with by setting the domain
parameter in your configurtion. By default this is set to gitlab.com
.
{
"contextProviders": [
{
"name": "gitlab-mr",
"params": {
"token": "...",
"domain": "gitlab.example.com"
}
}
]
}
Filtering Comments
If you select some code to be edited, you can have the context provider filter out comments for other files. To enable this feature, set filterComments
to true
.
@Jira
Reference the conversation in a Jira issue.
{
"contextProviders": [
{
"name": "jira",
"params": {
"domain": "company.atlassian.net",
"token ": "ATATT..."
}
}
]
}
Make sure to include your own Atlassian API Token, or use your email
and token
, with token set to your password for basic authentication. If you use your own Atlassian API Token, don't configure your email.
Jira Datacenter Support
This context provider supports both Jira API version 2 and 3. It will use version 3 by default since
that's what the cloud version uses, but if you have the datacenter version of Jira, you'll need
to set the API Version to 2 using the apiVersion
property.
{
"contextProviders": [
{
"name": "jira",
"params": {
"apiVersion": "2"
}
}
]
}
Issue Query
By default, the following query will be used to find issues:
assignee = currentUser() AND resolution = Unresolved order by updated DESC
You can override this query by setting the issueQuery
parameter.
@Postgres
Reference the schema of a table, and some sample rows
{
"contextProviders": [
{
"name": "postgres",
"params": {
"host": "localhost",
"port": 5436,
"user": "myuser",
"password": "catsarecool",
"database": "animals",
"schema": "public",
"sampleRows": 3
}
}
]
}
The only required settings are those for creating the database connection: host
, port
, user
, password
, and database
.
By default, the schema
filter is set to public
, and the sampleRows
is set to 3. You may unset the schema if you want to include tables from all schemas.
@Database
Reference table schemas from Sqlite, Postgres, and MySQL databases.
{
"contextProviders": [
{
"name": "database",
"params": {
"connections": [
{
"name": "examplePostgres",
"connection_type": "postgres",
"connection": {
"user": "username",
"host": "localhost",
"database": "exampleDB",
"password": "yourPassword",
"port": 5432
}
},
{
"name": "exampleSqlite",
"connection_type": "sqlite",
"connection": {
"filename": "/path/to/your/sqlite/database.db"
}
}
]
}
}
]
}
Each connection should include a unique name, the connection_type
, and the necessary connection parameters specific to each database type.
Available connection types:
postgres
mysql
sqlite
@Locals
Reference the contents of the local variables in the debugger.
{
"contextProviders": [
{
"name": "locals",
"params": {
"stackDepth": 3
}
}
]
}
Uses the top n levels (defaulting to 3) of the call stack for that thread.
@Repository Map
Reference the outline of your codebase.
{
"contextProviders": [
{
"name": "repo-map"
}
]
}
Provides 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.
In the submenu that appears, you can select either Entire codebase
, or specify a subfolder to generate the repostiory map from.
This context provider is inpsired by Aider's repository map.
@Operating System
Reference the architecture and platform of your current operating system.
{
"contextProviders": [
{
"name": "os"
}
]
}
@HTTP
The 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.
{
"contextProviders": [
{
"name": "http",
"params": {
"url": "https://api.example.com/v1/users"
}
}
]
}
The receiving URL should expect to receive the following parameters:
{
query: string,
fullInput: string
}
The response 200 OK should be a JSON object with the following structure:
[
{
"name": "",
"description": "",
"content": ""
}
]
// OR
{
"name": "",
"description": "",
"content": ""
}
Requesting Context Providers
Not seeing what you want? Create an issue here to request a new Context Provider.