Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

cody: update readme with more info for user #49846

Merged
merged 12 commits into from
Mar 22, 2023
Merged
77 changes: 60 additions & 17 deletions client/cody/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
# Sourcegraph Cody for Enterprise for Visual Studio Code
<div align="center">
<p>Cody: An AI-Powered Programming Assistant</p>
<a href="https://docs.sourcegraph.com/cody">Docs</a> •
<a href="https://discord.gg/s2qDtYGnAE">Discord</a> •
<a href="https://twitter.com/sourcegraph">Twitter</a>
<br /><br />
<a href="https://srcgr.ph/discord">
<img src="https://img.shields.io/discord/969688426372825169?color=5765F2" alt="Discord" />
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody">
<img src="https://img.shields.io/vscode-marketplace/v/sourcegraph.cody.svg?label=vs%20marketplace" alt="VS Marketplace" />
</a>
</div>

[![vs marketplace](https://img.shields.io/vscode-marketplace/v/sourcegraph.cody.svg?label=vs%20marketplace)](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody)
## Cody Enterprise

Cody is in private alpha (experimental) at this stage. Please contact your techical advisor or [signup here](https://sourcegraph.typeform.com/to/pIXTgwrd?typeform-source=t.co) to get access.

We have limited capacity to onboard customers at first, but we're working hard to open Cody up to the world fast!

## What is Cody?

Cody is your hyper-intelligent programming sidekick - an AI assistant developed by Sourcegraph to supercharge your productivity as a developer.

## Highlighted features

- Answer questions about your codebase instantly
- Generate documentation and unit tests on demand
- Write code snippets and prototypes for you
- Translate comments and functions in your code between languages

## Installation

### From the Visual Studio Marketplace:
Here are the ways to install Cody in Visual Studio Code:

### In Visual Studio Code

1. Install Sourcegraph from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody).
2. Launch VS Code, and click on the Cody icon in the VS Code Activity Bar to open the extension. Alternatively, you can launch the extension by pressing <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> and searching for "Cody: Focus on chat view".
1. Open the Extensions tab on the left side of VS Code (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd> or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd>).
2. Search for `Sourcegraph Cody` and click Install.
3. Once installed, **reload** VS Code.
4. After reloading, click the Cody icon in the VS Code Activity Bar to open the extension.
- Alternatively, you can launch the extension by pressing <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> and searching for "Cody: Focus on chat view" and searching for "Cody: Focus on chat view".

### From within VS Code:
### Through the Visual Studio Marketplace

1. Open the extensions tab on the left side of VS Code (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd> or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd>).
2. Search for `Sourcegraph Cody for Enterprise` -> `Install` and `Reload`.
1. Install Cody from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody).
2. After installing the plugin, click the Cody icon in the VS Code Activity Bar to open the extension.

## Setting up the Cody extension

Expand All @@ -22,25 +54,36 @@ To set up the Cody extension, you will need to enter the URL of your Sourcegraph
2. If you are setting up Cody for the first time, you should see the terms of service.
3. To proceed, read the terms and click "I accept", if you accept the terms of service.
4. Aftewards, you should see the login screen, where you have to enter the URL of your Sourcegraph instance and an access token used for authentication.
5. Once you have filled out the login form, click the Login button to login to Cody.

> To generate an access token: go to your Sourcegraph instance, then in your account settings, navigate to `Access tokens`, click `Generate new token`, and copy the token.
### Generating a Sourcegraph access token

5. Once you have filled out the form, click the Login button to login into Cody.
1. Go to your Sourcegraph instance.
2. In your account settings, navigate to `Access tokens`.
3. Click `Generate new token`.
4. Copy the token.

### Codebase

To enable codebase-aware answers, you have to set the codebase setting to let Cody know which repository you are working on in the current workspace. You can do that by opening the VSCode workspace settings, search for the "Cody: Codebase" setting, and enter the repository name as listed on your Sourcegraph instance. Setting the codebase will edit the `.vscode/settings.json` file in your repository, which you can then commit and save for future usage.
To enable codebase-aware answers, you have to set the codebase setting to let Cody know which repository you are working on in the current workspace. You can do that as follows:

1. Open the VS Code workspace settings by pressing <kbd>Cmd</kbd>, (or File > Preferences (Settings) on Windows & Linux).
2. Search for the "Cody: Codebase" setting.
3. Enter the repository name as listed on your Sourcegraph instance.
1. For example: `github.com/sourcegraph/sourcegraph` without the `https` protocol

Setting the codebase will edit the `.vscode/settings.json` file in your repository, which you can then commit and save for future usage.

## Extension Settings

This extension contributes the following settings:

| Setting | Description | Example |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| cody.enabled | Enable or disable Cody. | true/false |
| cody.serverEndpoint | URL of the Sourcegraph instance. | "https://sourcegraph.sourcegraph.com" |
| cody.codebase | Name of the repository opened in the current workspace. Use the same repository name as listed on your Sourcegraph instance. | "github.com/sourcegraph/sourcegraph" |
| cody.useContext | Context source for Cody. One of: "embeddings", "keyword", "blended", or "none". | "embeddings" |
| Setting | Description | Example |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| cody.enabled | Enable or disable Cody. | true/false |
| cody.serverEndpoint | URL of the Sourcegraph instance. | "https://example.sourcegraph.com" |
| cody.codebase | Name of the repository opened in the current workspace. Use the same repository name as listed on your Sourcegraph instance. | "github.com/sourcegraph/sourcegraph" |
| cody.useContext | Context source for Cody. One of: "embeddings", "keyword", "blended", or "none". | "embeddings" |

## Development

Expand Down
16 changes: 11 additions & 5 deletions client/cody/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"name": "cody",
"private": true,
"displayName": "Cody for Enterprise",
"version": "0.0.6",
"displayName": "Cody Enterprise",
"version": "0.0.1",
"publisher": "sourcegraph",
"license": "Apache-2.0",
"icon": "resources/cody.png",
"description": "",
"description": "Your programming sidekick powered by AI and Sourcegraph's code search and intelligence.",
"categories": [
"Other"
],
"keywords": [
"developer tools",
"ai"
],
"repository": {
"type": "git",
"url": "https://github.com/sourcegraph/sourcegraph.git",
Expand All @@ -29,8 +33,10 @@
"esbuild": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node",
"test:integration": "pnpm compile:test && node ./dist/test/src/test/runTest.js",
"test:unit": "pnpm compile:test && mocha './dist/test/src/test/unit/*.test.js'",
"vsce:package": "scripts/check-rg.sh && pnpm --silent build && vsce package --no-dependencies -o dist/cody.vsix",
"vsce:publish": "scripts/check-rg.sh && vsce publish --packagePath dist/cody.vsix",
"vscode:prepublish": "scripts/check-rg.sh",
"vsce:package": "pnpm --silent build && vsce package --no-dependencies -o dist/cody.vsix",
"vsce:prerelease": "pnpm --silent build && vsce package patch --pre-release --no-dependencies -o dist/cody.vsix",
"vsce:publish": "vsce publish --packagePath dist/cody.vsix",
"watch": "concurrently \"pnpm watch:esbuild\" \"pnpm watch:webview\"",
"watch:esbuild": "pnpm esbuild --sourcemap --watch",
"watch:webview": "vite build --mode development --watch",
Expand Down
2 changes: 1 addition & 1 deletion client/cody/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"outDir": "dist",
"jsx": "react-jsx",
},
"include": ["src", "webviews", "vite.config.ts", "webpack.config.js"],
"include": ["src", "webviews", "vite.config.ts", "webpack.config.js", "package.json"],
"exclude": ["scripts", "out", "dist"],
"references": [],
}
2 changes: 1 addition & 1 deletion client/cody/webviews/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Header: React.FunctionComponent<React.PropsWithChildren<HeaderProps
</div>
<div className="header-title">
<span className="header-cody">Cody</span>
<VSCodeTag className="tag-beta">Beta</VSCodeTag>
<VSCodeTag className="tag-beta">experimental</VSCodeTag>
</div>
</div>
<div className="header-container-right">
Expand Down