Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions docs/at-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
title: 🗃️ @ Commands
description: Context Providrrs for PearAI
keywords: [setup, install, context, providers, model]
---

# 🗃️ `@` Commands

## How it works

`@` Commands provide extra context (i.e. extra information) that can be included with your prompt to give the LLM more awareness of your work environment. To use this, type '@' inside the PearAI chat to see a dropdown containing a list of context options. Each context provider is a plugin, allowing you to reference an extra piece of information.

As an example, you are having trouble running an app locally, and there's a bunch of errors in the terminal. You can use `@terminal` to include the error logs and further use `@files` to include `package.json` to immediately start debugging the problem. PearAI streamlines the debugging process by allowing you to gather a complete context all in one place.

!![context](../static/img/context.webp)

## Built-in Context Providers

PearAI comes with a few useful context providers ready to use out of the box. If you wish to remove or add context providers, you can do so in `config.json`, under the `contextProviders` list.

### `@Files`

Allows you to specify a file as context.

```json
{
"contextProviders": [
{
"name": "files"
}
]
}
```
### `@Codebase`

Allows you to provide the codebase as context. Please note that depending on the size of your codebase, this may consume a lot of credits.

```json
{
"contextProviders": [
{
"name": "codebase"
}
]
}
```
### `@Code`

Allows you to specify functions/classes.

```json
{
"contextProviders": [
{
"name": "code"
}
]
}
```
### `@Docs`

Allows you to specify a documentation site as context.

```json
{
"contextProviders": [
{
"name": "docs"
}
]
}
```
### `@Git Diff`

This provides as context all the changes you've made on the current branch in reference to main. Use this to get a summary of your current work or to get a code review.

```json
{
"contextProviders": [
{
"name": "diff"
}
]
}
```
### `@Terminal`

Add your current terminal content as context.

```json
{
"contextProviders": [
{
"name": "terminal"
}
]
}
```
### `@Problems`

Adds the problems in your current file as context.

```json
{
"contextProviders": [
{
"name": "problems"
}
]
}
```
### `@Folder`

Reference everything within the specified folder as context.

```json
{
"contextProviders": [
{
"name": "folder"
}
]
}
```

### `@Directory Structure`

Provides the project's directory structure as context. You can use this context to let the LLM know of any changes you've made to the directory.

```json
{
"contextProviders": [
{
"name": "directory"
}
]
}
```
3 changes: 2 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
docsSidebar: [
"index",
"index",
"quickstart",
"demos",
"at-commands",
"important-shortcuts",
"tab-autocomplete",
"codebase-context",
Expand Down
Binary file added static/img/context.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.