Skip to main content

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.

Context Items

Built-in Context Providers

To use any of the built-in context providers, open ~/.continue/config.json and add it to the contextProviders list.

Files

Type '@file' to reference any file in your current workspace.

{ "name": "file" }

Code

Type '@code' to reference specific functions or classes from throughout your project.

{ "name": "code" }

Git Diff

Type '@diff' to 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.

{ "name": "diff" }

Terminal

Type '@terminal' to reference the contents of your IDE's terminal.

{ "name": "terminal" }

Documentation

Type @docs to index and retrieve snippets from any documentation site.

{ "name": "docs" }

To learn more, visit [@docs](customize/deep-dives/docs.md).

Open Files

Type '@open' to reference the contents of all of your open files. Set onlyPinned to true to only reference pinned files.

{ "name": "open", "params": { "onlyPinned": true } }

Codebase Retrieval

Type '@codebase' to automatically retrieve the most relevant snippets from your codebase. Read more about indexing and retrieval here.

{ "name": "codebase" }

Folders

Type '@folder' to use the same retrieval mechanism as '@codebase', but only on a single folder.

{ "name": "folder" }

Type '@search' to reference the results of codebase search, just like the results you would get from VS Code search. This context provider is powered by ripgrep.

{ "name": "search" }

URL

Type '@url' and input a URL, then Continue will convert it to a markdown document to pass to the model.

{ "name": "url" }

File Tree

Type '@tree' to reference the structure of your current workspace. The LLM will be able to see the nested directory structure of your project.

{ "name": "tree" }

Google

Type '@google' to reference the results of a Google search. For example, type "@google python tutorial" if you want to search and discuss ways of learning Python.

{
"name": "google",
"params": { "serperApiKey": "<your serper.dev api key>" }
}

Note: You can get an API key for free at serper.dev.

GitHub Issues

Type '@issue' to reference the conversation in a GitHub issue. Make sure to include your own GitHub personal access token to avoid being rate-limited:

{
"name": "issue",
"params": {
"repos": [
{
"owner": "continuedev",
"repo": "continue"
}
],
"githubToken": "ghp_xxx"
}
}

GitLab Merge Request

Type @gitlab-mr to reference an open MR for this branch on GitLab.

Configuration

You will need to create a personal access token with the read_api scope. then add the following to your configuration:

{
"name": "gitlab-mr",
"params": {
"token": "..."
}
}

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.

{
"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 Issues

Type '@jira' to reference the conversation in a Jira issue. 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.

{
"name": "jira",
"params": {
"domain": "company.atlassian.net",
"token ": "ATATT..."
}
}

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.

  "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.

PostgreSQL

Type @postgres to reference the schema of a table, and some sample rows. A dropdown will appear, allowing you to select a specific table, or all tables.

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.

Here is a short demo.

{
"name": "postgres",
"params": {
"host": "localhost",
"port": 5436,
"user": "myuser",
"password": "catsarecool",
"database": "animals",
"schema": "public",
"sampleRows": 3
}
}

Database Tables

Type @database to reference table schemas you can use the drop-down or start typeing table names based off of your configuration. Configuration supports multiple databases, allowing you to specify various connection details for PostgreSQL, MySQL, SQLite. Each connection should include a unique name, the connection_type (e.g., postgres, sqlite), and the necessary connection parameters specific to each database type.

{
"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"
}
}
]
}
}

Debugger: Local Variables

Type @locals to reference the contents of the local variables with top n level (defaulting to 3) of call stack for that thread. A dropdown will appear, allowing you to select a specific thread to see the local variables in that thread.

{
"name": "locals",
"params": {
"stackDepth": 3
}
}

Repository map

Provides an overview of all files and the call signatures of top-level classes, functions, and methods. This helps the model better understand how a particular piece of code relates to the rest of the codebase.

This context provider is inpsired by Aider's repository map.

{
"name": "repo-map"
}

Operating System

Type @os to reference the architecture and platform of your current operating system.

{ "name": "os" }

Requesting Context Providers

Not seeing what you want? Create an issue here to request a new ContextProvider.