Skip to content

Setting Up the RelationalAI VS Code Extension

To start using the RelationalAI VS Code Extension, you first need to install it, connect to RelationalAI, and select a project.

Installing the Extension

After downloading VS Code:

  1. Click the Extensions icon in the Activity Bar.
  2. Type RelationalAI into the Search field.
  3. Click Install to install the extension.
install-button

The extension then appears in the Activity Bar.

Connecting to RelationalAI

Now it’s time to configure your profile and connect to your RelationalAI account. You can do that either from the Admin section under the RelationalAI View or from the Command Palette.

To add your credentials from the Admin section:

  1. Click the RelationalAI icon in the Activity Bar. The RelationalAI View opens.
  2. Click Admin. A pull-down menu appears.
  3. Click Profile and select Edit Profiles. This opens a file called config in a folder called .rai in your home directory on your computer.
  4. Enter your client ID and client secret to connect securely to RelationalAI.
  5. Press Control+S (PC) or Command+S (Mac) to save your information.

To add your credentials from the Command Palette:

  1. Press Command+Shift+P to activate the Command Palette.
  2. Type RelationalAI: Set Up or Edit Credentials and select the command from the list by clicking it. This creates and opens the config file.
  3. Enter your client ID and client secret to connect securely to RelationalAI.
  4. Press Control+S (PC) or Command+S (Mac) to save.

This allows the RelationalAI SDKs and the RelationalAI VS Code Extension to find your credentials and connect to the service.

🔎

To view all the commands supported by the extension, click Commands under the Admin section. See Accessing Commands in the Using the RelationalAI View guide for more details.

Choosing a Project

Now you need to open a directory containing a RelationalAI project you want to work on. You can either select an existing project on your machine or clone a new one from GitHub.

open-project

Selecting an Existing Project

To open an existing project:

  1. Click the Explorer icon in the Activity Bar.
  2. Click Open Folder.
  3. In the window that opens, browse to the location of your project folder.
  4. Click Open.
🔎

This extension is designed to work with your project directory as the workspace folder in VS Code. If you have a different directory open in VS Code — perhaps a parent directory which contains multiple projects – then open the project you want to work on in another VS Code window. Your models should be saved in a directory called model (or another directory of your choosing).

Cloning a New Project

You can clone a new project either from the Explorer section or by using the integrated terminal.

To clone a new project from the Explorer:

  1. Click Clone Repository.
  2. Provide the repository’s URL.
  3. In the window that opens, choose a location for your folder and click Select as Repository Destination.
  4. In the window that opens, click Open.

To clone a new project from the integrated terminal:

  1. Under Terminal, type git clone <project URL>. For example, git clone https://github.com/sswatson/faa-flights.
  2. Once the project is cloned, click File and choose Open Folder.
  3. In the window that opens, browse to the location of the project you just cloned.
  4. Click Open.

This opens the project folder in VS Code.

sample-project

Creating a Separate View

Clicking the RelationalAI icon in the Activity Bar opens the RelationalAI View in the Primary Side Bar — the space designated for the project folder.

You can move the RelationalAI View and view it independently of the project you’re working on. To do so:

  1. Click the Toggle Secondary Side Bar icon.
  2. Click the RelationalAI icon and drag it to the right-hand sidebar.
drag-extension

You can now view and navigate through the sections from the Secondary Side Bar.

new-view
Was this doc helpful?