Skip to content
Closed
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
4 changes: 4 additions & 0 deletions docs/cody/capabilities/blocks/cody-selecting-context.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Cody's chat allows you to add files and symbols as context in your messages.

- Type `@` and then a filename to include a file as context
- Type `@#` and then a symbol name to include the symbol's definition as context. Functions, methods, classes, types, etc., are all symbols
13 changes: 13 additions & 0 deletions docs/cody/capabilities/blocks/cody-write-code.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The chat feature can also write code for your questions. For example, in VS Code, ask Cody to "write a function that sorts an array in ascending order".

You are provided with code suggestions in the chat window along with the following options for using the code.

- The **Copy Code** icon to your clipboard and paste the code suggestion into your code editor
- Insert the code suggestion at the current cursor location by the **Insert Code at Cursor** icon
- The **Save Code to New File** icon to save the code suggestion to a new file in your project

During the chat, if Cody needs additional context, it can ask you to provide more information with a follow-up question. If your question is beyond the scope of the context, Cody will ask you to provide an alternate question aligned with the context of your codebase.

<video width="1920" height="1080" loop playsInline controls style={{ width: '100%', height: 'auto' }}>
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/Media/cody-write-code.mp4" type="video/mp4" />
</video>
7 changes: 7 additions & 0 deletions docs/cody/capabilities/blocks/how-chat-works.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Cody can use several methods (including keyword search and optional embeddings context) to ask relevant questions. For VS Code extension users, Cody also uses context from the files to provide an informed response based on your codebase. Cody also tells you which code files it reads to generate its responses.

Cody can assist you with various use cases such as:

- Generating an API call: Cody can analyze your API schema to provide context for the code it generates
- Locating a specific component in your codebase: Cody can identify and describe the files where a particular component is defined
- Handling questions that involve multiple files, like understanding data population in a React app: Cody can locate React component definitions, helping you understand how data is passed and where it originates
35 changes: 7 additions & 28 deletions docs/cody/capabilities/chat.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import HowChatWorks from './blocks/how-chat-works.mdx'
import CodyWriteCode from './blocks/cody-write-code.mdx'
import CodySelectingContext from './blocks/cody-selecting-context.mdx'

# Chat

<p className="subtitle">Use Cody's chat to get contextually-aware answers to your questions.</p>
Expand All @@ -16,17 +20,9 @@ To use Cody's chat, you'll need to have the following:
- A supported editor extension (VS Code, JetBrains, and Neovim) installed

## How does chat work?

Cody can use several methods (including keyword search and optional embeddings context) to ask relevant questions. For VS Code extension users, Cody also uses context from the files to provide an informed response based on your codebase. Cody also tells you which code files it reads to generate its responses.

Cody can assist you with various use cases such as:

- Generating an API call: Cody can analyze your API schema to provide context for the code it generates
- Locating a specific component in your codebase: Cody can identify and describe the files where a particular component is defined
- Handling questions that involve multiple files, like understanding data population in a React app: Cody can locate React component definitions, helping you understand how data is passed and where it originates
<HowChatWorks />

## Ask Cody your first question

Let's use Cody VS Code extension's chat interface to answer your first question.

- Click the Cody icon in the sidebar to view the detailed panel
Expand All @@ -42,27 +38,10 @@ Cody will take a few seconds to process your question, providing contextual info
</video>

## Ask Cody to write code

The chat feature can also write code for your questions. For example, in VS Code, ask Cody to "write a function that sorts an array in ascending order".

You are provided with code suggestions in the chat window along with the following options for using the code.

- The **Copy Code** icon to your clipboard and paste the code suggestion into your code editor
- Insert the code suggestion at the current cursor location by the **Insert Code at Cursor** icon
- The **Save Code to New File** icon to save the code suggestion to a new file in your project

During the chat, if Cody needs additional context, it can ask you to provide more information with a follow-up question. If your question is beyond the scope of the context, Cody will ask you to provide an alternate question aligned with the context of your codebase.

<video width="1920" height="1080" loop playsInline controls style={{ width: '100%', height: 'auto' }}>
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/Media/cody-write-code.mp4" type="video/mp4" />
</video>
<CodyWriteCode />

## Selecting Context

Cody's chat allows you to add files and symbols as context in your messages.

- Type `@` and then a filename to include a file as context
- Type `@#` and then a symbol name to include the symbol's definition as context. Functions, methods, classes, types, etc., are all symbols
<CodySelectingContext />

### Chat vs Commands

Expand Down
9 changes: 9 additions & 0 deletions docs/cody/clients/blocks/cody-for-web-intro.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Callout type="note" title="Experimental">
Cody support for Web interface is in the Experimental stage.
</Callout>

In addition to the Cody extensions for [VS Code](/cody/clients/install-vscode), [JetBrains](/cody/clients/install-jetbrains) IDEs, and [Neovim](/cody/clients/install-neovim), Cody is also available in the Sourcegraph web app. Community users can use Cody for free by logging into their accounts on Sourcegraph.com, and enterprise users can use Cody within their Sourcegraph instance.

<LinkCards>
<LinkCard href="https://sourcegraph.com/sign-in?returnTo=/search" imgSrc="https://sourcegraph.com/.assets/img/sourcegraph-mark.svg" imgAlt="Cody for Web" title="Cody for Web (Experimental)" description="Use Cody in the Sourcegraph Web App." />
</LinkCards>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
To connect the extension with your Enterprise instance,

- Click **Sign in with an Enterprise Instance**
- Enter the server for your enterprise instance (e.g. `https://<your-instance>.sourcegraph.com`)
- Select **Generate new token**. You'll be directed to the **Access tokens** page on your instance in the browser
- Generate a new token, copy it, and paste it into the **Token** field in your editor
- Click **Sign in**
43 changes: 43 additions & 0 deletions docs/cody/clients/blocks/connect-instance-vscode-enterprise.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Callout type="info"> If you are using an older version of Cody, uninstall it and reload VS Code. It's always recommended to install the latest version before proceeding to next steps.</Callout>

Sourcegraph Enterprise users should connect Cody to their Enterprise instance by clicking **Sign In to Your Enterprise Instance**.

You'll be prompted to choose how to sign-in, select **Sign In to Sourcegraph Instances v5.1 and above**.

![sign-in-option](https://storage.googleapis.com/sourcegraph-assets/Docs/927fb401aa80af47f4384a854309b0ed5ac58da34507ed4c0dfd72da61e1edfb.png)

Enter the URL of your Enterprise instance. If you are unsure, please contact your administrator.

![instance-url](https://storage.googleapis.com/sourcegraph-assets/Docs/c8fc65594ac718cfc6e6d67e76af8dd8989c8dd6300725f5afd872210f76e786.png)

A pop-up will ask if you want to Open the URL in a new window. Click **Open** to open the URL in a new window.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/0c72d6a8e48a28bb6543d5dd333187ae130743937e584b67bd3a42b810e9ec69.png)

Sign in to your instance. If you do not yet have a login, please contact your administrator.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/3b66de59129d19d8e71ed4d07b1e369ac956b7e3177cb8d3af60765559842431.png)

Create an access token from Account Settings - Access Tokens. Click **+ Generate new token**

![create-token](https://storage.googleapis.com/sourcegraph-assets/Docs/a88d828e082067ac6c57f8c32d67de3bf093732689578a4aa29c5b2f67fd53ba.png)

Name the token and click **+ Generate token**.

![name-generate-token](https://storage.googleapis.com/sourcegraph-assets/Docs/6e2255ea122a5b1840d0ce7c032e26742540b7a2a610ab95d47e969b9f94e3f4.png)

Copy the token and return to VSCode.

![copy-token](https://storage.googleapis.com/sourcegraph-assets/Docs/707e642d4cf84aba4134cb83d2bdc0c1280f847d0909c144aaf43e004de3a945.png)

Again, click **Sign In to Your Enterprise Instance** and choose **Sign In to Sourcegraph Instances v5.1 and above**. Enter the URL of your instance.

You should now be prompted to authorize Sourcegraph to connect to your VSCode extension using the token you created. Click **Authorize**.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/78651f94c061ba7a63041893a73705b5b5568587830831f68b3afee1f02ca744.png)

Finally, you will be asked to allow the extension access. CLick **Open**.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/946384c3bbce7790dc119ecec2d1540fcb3e50dc007eee4472c0bcac8b14c251.png)

VSCode should now display the Cody panel and you're ready to go.
9 changes: 9 additions & 0 deletions docs/cody/clients/blocks/install-jetbrains-extension.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Follow these steps to install the Cody plugin:

- Open JetBrains IntelliJ editor on your local machine
- Open **Settings** (Mac: `⌘+,` Windows: `Ctrl+Alt+S`) and select **Plugins**
- Type and search **Sourcegraph Cody + Code Search** extension and click **Install**

![cody-for-intellij](https://storage.googleapis.com/sourcegraph-assets/Docs/Media/cody-for-intellij.png)

Alternatively, you can [Download and install the extension from the Jetbrains marketplace](https://plugins.jetbrains.com/plugin/9682-sourcegraph).
10 changes: 10 additions & 0 deletions docs/cody/clients/blocks/install-vscode-extension.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Follow these steps to install the Cody AI extension for VS Code:

- Open VS Code editor on your local machine
- Click the **Extensions** icon in the Activity Bar on the side of VS Code, or use the keyboard shortcut `Cmd+Shift+X` (macOS) or `Ctrl+Shift+X` (Windows/Linux)
- Type **Cody AI** in the search bar and click the **Install** button
- After installing, you may be prompted to reload VS Code to activate the extension

![install-vscode-extension](https://storage.googleapis.com/sourcegraph-assets/Docs/install-cody-vscode.png)

Alternatively, you can also [download and install the extension from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) directly.
12 changes: 3 additions & 9 deletions docs/cody/clients/cody-with-sourcegraph.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import CodyForWebIntro from './blocks/cody-for-web-intro.mdx'

# Cody for Web

<p className="subtitle">Learn how to use Cody in the web interface with Sourcegraph.com</p>

<Callout type="note" title="Experimental">
Cody support for Web interface is in the Experimental stage.
</Callout>

In addition to the Cody extensions for [VS Code](/cody/clients/install-vscode), [JetBrains](/cody/clients/install-jetbrains) IDEs, and [Neovim](/cody/clients/install-neovim), Cody is also available in the Sourcegraph web app. Community users can use Cody for free by logging into their accounts on Sourcegraph.com, and enterprise users can use Cody within their Sourcegraph instance.

<LinkCards>
<LinkCard href="https://sourcegraph.com/sign-in?returnTo=/search" imgSrc="https://sourcegraph.com/.assets/img/sourcegraph-mark.svg" imgAlt="Cody for Web" title="Cody for Web (Experimental)" description="Use Cody in the Sourcegraph Web App." />
</LinkCards>
<CodyForWebIntro components={props.components} />

## Initial setup

Expand Down
23 changes: 5 additions & 18 deletions docs/cody/clients/install-jetbrains.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import InstallJetbrainsExtension from './blocks/install-jetbrains-extension.mdx'
import ConnectInstanceJetbrainsEnterprise from './blocks/connect-instance-jetbrains-enterprise.mdx'

# Install Cody for JetBrains

<p className="subtitle">Learn how to use Cody and its features with the JetBrains IntelliJ editor.</p>
Expand Down Expand Up @@ -30,16 +33,7 @@ The Cody extension by Sourcegraph enhances your coding experience in your IDE by
- [WebStorm](https://www.jetbrains.com/webstorm/)

## Install the JetBrains IntelliJ Cody extension

Follow these steps to install the Cody plugin:

- Open JetBrains IntelliJ editor on your local machine
- Open **Settings** (Mac: `⌘+,` Windows: `Ctrl+Alt+S`) and select **Plugins**
- Type and search **Sourcegraph Cody + Code Search** extension and click **Install**

![cody-for-intellij](https://storage.googleapis.com/sourcegraph-assets/Docs/Media/cody-for-intellij.png)

Alternatively, you can [Download and install the extension from the Jetbrains marketplace](https://plugins.jetbrains.com/plugin/9682-sourcegraph).
<InstallJetbrainsExtension />

## Connect the extension to Sourcegraph

Expand All @@ -50,14 +44,7 @@ Alternatively, you can also click the **Sign in with an Enterprise Instance** to
![cody-for-intellij-login](https://storage.googleapis.com/sourcegraph-assets/Docs/Media/sign-in-cody-jb.png)

### For Sourcegraph Enterprise users

To connect the extension with your Enterprise instance,

- Click **Sign in with an Enterprise Instance**
- Enter the server for your enterprise instance (e.g. `https://<your-instance>.sourcegraph.com`)
- Select **Generate new token**. You'll be directed to the **Access tokens** page on your instance in the browser
- Generate a new token, copy it, and paste it into the **Token** field in your editor
- Click **Sign in**
<ConnectInstanceJetbrainsEnterprise />

### For Sourcegraph.com users

Expand Down
60 changes: 5 additions & 55 deletions docs/cody/clients/install-vscode.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import InstallVscodeExtension from './blocks/install-vscode-extension.mdx'
import ConnectInstanceVscodeEnterprise from './blocks/connect-instance-vscode-enterprise.mdx'

# Installing Cody in VS Code

<p className="subtitle">Learn how to use Cody and its features with the VS Code editor.</p>
Expand All @@ -14,17 +17,7 @@ The Cody extension by Sourcegraph enhances your coding experience in VS Code by
- You have a Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account

## Install the VS Code extension

Follow these steps to install the Cody AI extension for VS Code:

- Open VS Code editor on your local machine
- Click the **Extensions** icon in the Activity Bar on the side of VS Code, or use the keyboard shortcut `Cmd+Shift+X` (macOS) or `Ctrl+Shift+X` (Windows/Linux)
- Type **Cody AI** in the search bar and click the **Install** button
- After installing, you may be prompted to reload VS Code to activate the extension

![install-vscode-extension](https://storage.googleapis.com/sourcegraph-assets/Docs/install-cody-vscode.png)

Alternatively, you can also [download and install the extension from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) directly.
<InstallVscodeExtension />

## Connect the extension to Sourcegraph

Expand All @@ -37,50 +30,7 @@ Cody Free and Cody Pro users can sign in to their Sourcegraph.com accounts throu
![cody-sign-flow](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-new-ui.png)

### Sourcegraph Enterprise Cody Users

<Callout type="info"> If you are using an older version of Cody, uninstall it and reload VS Code. It's always recommended to install the latest version before proceeding to next steps.</Callout>

Sourcegraph Enterprise users should connect Cody to their Enterprise instance by clicking **Sign In to Your Enterprise Instance**.

You'll be prompted to choose how to sign-in, select **Sign In to Sourcegraph Instances v5.1 and above**.

![sign-in-option](https://storage.googleapis.com/sourcegraph-assets/Docs/927fb401aa80af47f4384a854309b0ed5ac58da34507ed4c0dfd72da61e1edfb.png)

Enter the URL of your Enterprise instance. If you are unsure, please contact your administrator.

![instance-url](https://storage.googleapis.com/sourcegraph-assets/Docs/c8fc65594ac718cfc6e6d67e76af8dd8989c8dd6300725f5afd872210f76e786.png)

A pop-up will ask if you want to Open the URL in a new window. Click **Open** to open the URL in a new window.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/0c72d6a8e48a28bb6543d5dd333187ae130743937e584b67bd3a42b810e9ec69.png)

Sign in to your instance. If you do not yet have a login, please contact your administrator.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/3b66de59129d19d8e71ed4d07b1e369ac956b7e3177cb8d3af60765559842431.png)

Create an access token from Account Settings - Access Tokens. Click **+ Generate new token**

![create-token](https://storage.googleapis.com/sourcegraph-assets/Docs/a88d828e082067ac6c57f8c32d67de3bf093732689578a4aa29c5b2f67fd53ba.png)

Name the token and click **+ Generate token**.

![name-generate-token](https://storage.googleapis.com/sourcegraph-assets/Docs/6e2255ea122a5b1840d0ce7c032e26742540b7a2a610ab95d47e969b9f94e3f4.png)

Copy the token and return to VSCode.

![copy-token](https://storage.googleapis.com/sourcegraph-assets/Docs/707e642d4cf84aba4134cb83d2bdc0c1280f847d0909c144aaf43e004de3a945.png)

Again, click **Sign In to Your Enterprise Instance** and choose **Sign In to Sourcegraph Instances v5.1 and above**. Enter the URL of your instance.

You should now be prompted to authorize Sourcegraph to connect to your VSCode extension using the token you created. Click **Authorize**.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/78651f94c061ba7a63041893a73705b5b5568587830831f68b3afee1f02ca744.png)

Finally, you will be asked to allow the extension access. CLick **Open**.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/946384c3bbce7790dc119ecec2d1540fcb3e50dc007eee4472c0bcac8b14c251.png)

VSCode should now display the Cody panel and you're ready to go.
<ConnectInstanceVscodeEnterprise components={props.components} />

## Verifying the installation

Expand Down
52 changes: 52 additions & 0 deletions docs/customer-enablement/cody/end-users/enterprise-start-guide.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import InstallVscodeExtension from '../../../cody/clients/blocks/install-vscode-extension.mdx'
import ConnectInstanceVscodeEnterprise from '../../../cody/clients/blocks/connect-instance-vscode-enterprise.mdx'
import InstallJetbrainsExtension from '../../../cody/clients/blocks/install-jetbrains-extension.mdx'
import ConnectInstanceJetbrainsEnterprise from '../../../cody/clients/blocks/connect-instance-jetbrains-enterprise.mdx'

import CodyForWebIntro from '../../../cody/clients/blocks/cody-for-web-intro.mdx'

import HowChatWorks from '../../../cody/capabilities/blocks/how-chat-works.mdx'
import CodyWriteCode from '../../../cody/capabilities/blocks/cody-write-code.mdx'
import CodySelectingContext from '../../../cody/capabilities/blocks/cody-selecting-context.mdx'

# Cody Enterprise Start Guide
A guide for Enterprise users to get set up and running with Cody

## Configuring Cody clients
There are three primary places where you can use Cody:

<Accordion title="Visual Studio Code IDE">
### Install the VS Code extension
<InstallVscodeExtension />

### Connect the extension to Sourcegraph for Enterprise Cody Users
After a successful installation, the Cody icon appears in the [Activity sidebar](https://code.visualstudio.com/api/ux-guidelines/activity-bar).

<ConnectInstanceVscodeEnterprise components={props.components} />
</Accordion>

<Accordion title="IntelliJ (JetBrains) IDE">
### Install Cody for JetBrains
<InstallJetbrainsExtension />

### Connect the extension to Sourcegraph for Eneterprise Cody Users
<ConnectInstanceJetbrainsEnterprise />
</Accordion>

<Accordion title="Cody for Web">
<CodyForWebIntro components={props.components} />
</Accordion>

## Cody Capabilities
Cody offers a rich set of capabilities and features that help you write better code faster. These include:

<Accordion title="Chat">
### How does chat work?
<HowChatWorks />

### Ask Cody to write code
<CodyWriteCode />

### Selecting Context
<CodySelectingContext />
</Accordion>
1 change: 1 addition & 0 deletions docs/customer-enablement/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Demo Guide for Customer Enablement
Loading