Skip to main content

VSCode

Overview

Inworld VS Code Extension is a collaboration tool for accelerating character design iteration, enabling the uploading and downloading of Inworld designs, which can then be stored in Git or Perforce.

This extension significantly enhances workflow efficiency and collaboration by empowering team members to track changes, compare versions, and revert to previous iterations. This guide covers how to set up and use this collaboration tool with your project.

Installing and Using Inworld Extension

To install and use the Inworld Collaboration Tool in your VS Code instance, find it in the VS Code Extension Marketplace by the name: "inworld-vscode."

extensions

After finding the Inworld Collaboration Tool, perform the steps below:

1. Open a Folder

Open VS Code and open a folder. For example, create a folder named "inworld" in your projects directory.

Then, open the Extension View from the sidebar, indicated by an “i" icon.

icon

2. Set Up Configuration

Next, the configuration needs to be set up.

Press the Setup Configuration button and enter your Studio API Key.

setup

Then, choose the workspace you want to use from the Dropdown Menu.

setup2

An associated config.json file is then created under the .inworld folder.

setup3

Additionally, a Secrets file containing the key is created under the .inworld folder.

setup4

If you are using Git for version control, you may add .inworld/config.json to the repository while including .inworld/secrets.json in the .gitignore file.

If you need to manually modify the configuration after the initial setup, be sure to understand the purpose of each field:

  • Workspace Name: For example, for https://studio.inworld.ai/workspaces/test-workspace/characters, use the test-workspace part of the URL.

  • Workspace Directory: This is the path to the directory where all workspace data is placed. You can create this directory manually or it will be created automatically during the first pull. The path can be relative or absolute.

  • Studio API Key: You can find this token in the Studio API section under the Integration tab, as shown in the image below.

setup5

Optional:

  • Format: Can be omitted. Possible options are json and yaml. By default, the JSON file format will be used to store Inworld entities. For Goals, it is recommended you use the YAML format because the Studio interface works only with YAML.

3: Check Configuration

Next, take a moment to check your configuration before proceeding.

If the configuration is finished successfully, the extension indicates that all required fields are valid with a Green checkmark.

config

If any items are displayed in Red, these errors must be fixed in the Config file then Saved.

In each case, follow the instructions provided for each line.

error

4. Auto-Generation Feature

Select input file(s) on the Create tab and press the AI Generate button.

auto

Additionally, you can Right-Click on Inworld-Data and use the Inworld: Create Inworld Elements context menu to generate entities.

elements

Once the entities are generated, you are now ready to work within the VSCode workspace.

You can now create a scene, character, or knowledge from scratch using the Extension page, the Context Menu, or a Palette Command.

Pull the Workspace from Studio

After setting up the configuration, you may start editing your workspace by pulling data such as scenes, characters, and knowledge as local files from the Extension page, or from the context menu, as shown below.

Note these commands are applied to the whole workspace, meaning all local files are affected.

pullpush

From the Context Menu.

pullwork

After pulling the workspace, you can find all the character files under the Directory Folder.

general

Push the Workspace to Studio

After editing in your local files for Inworld characters, knowledge, or scenes, you may push changes to Inworld Studio from the Extension page, or from the context menu, as shown below.

Note that these commands are applied to the whole workspace, meaning the push applies to all files.

From the Extension page.

pullwork2

From the Context Menu.

pushwork2

Pull and Push of Changed Entities Only

If you are using Git or Perforce as your version control system, you may synchronize only the files that have been modified locally.

For example, consider the following Inworld data:

workspaces

To enable change tracking, the repository must be initialized with Git or Perforce under VSCode’s Source Control View.

source

After making edits, updates shown under Source Control View.

Here, you can control versions via Git or Perforce:

source2

To sync character changes with Inworld Studio server, changes are listed under the Conflicts and Changes view in the Inworld Extension:

source3

Changed files show up in the Changes folder first.

You may either add specific files to the sync list and push, or pull only those files to the Inworld server.

source4

Merge Conflicts

During the execution of a Pull or Push command, you may encounter a situation where someone else has modified the same entity you are working on.

If you try to Push, an error appears prompting you to pull changes first. After Pulling, any conflicting files appear in the Merge Conflicts list. These conflicts need to be resolved before continuing your work.

conflicts

Add Additional Workspaces

You may work with multiple workspaces.

If needed, add another workspace to the workspaces array in the configuration file.

additional

Clone Workspace

If you need to clear your workspace in one click in Studio (such as for test purposes), use the VSCode command Inworld: Clear Workspace.

This command is available in the Palette View.

clear2

This command removes all elements from Inworld Studio such as characters, scenes, and knowledge. No local files are affected.

Be careful using this command, as it is impossible to restore deleted elements.

Clone Workspace

If you need to clone your workspace, use the VSCode command Inworld: Clone Workspace.

To clone data from workspace-1 to workspace-2, follow the steps below:

1. Pull Data

Pull the data from workspace-1 into the workspace-1 folder.

{
"workspaces": [
{
"id": "workspace-1",
"directory": "workspace-1"
}
]
}

2. Clone Workspace

Use the Inworld: Clone Workspace palette command to start cloning process.

clon12

3. Select Workspace

Next, select the workspace.

clone3

4. Find Entities

Find new entities in workspace-2.

The configuration file is updated in the following way:

{
"workspaces": [
{
"id": "workspace-1",
"directory": "workspace-1",
"clone": {
"id": "workspace-2"
}
}
]
}

Note that workspace-2 must be created manually before pushing.

Switching Between Environments

If you need to access a Customized Studio Server, update ./inworld/config.json with the following:

{
"workspaces": [
{
"id": "workspace-id,
"directory": "workspace-directory",
"host": "{YOUR_STUDIO_URL}"
}
]
}

Additionally, update ./inworld/secrets.json with the following:

{
"keys": [
{
"host": "{YOUR_STUDIO_URL}",
"value": "{KEY_FOR_YOUR_STUDIO_URL}",
}
]
}