|
| 1 | +--- |
| 2 | +title: Workspaces |
| 3 | +description: Organize and customize your project environments |
| 4 | +sidebar_position: 40 |
| 5 | +--- |
| 6 | + |
| 7 | +import useBaseUrl from '@docusaurus/useBaseUrl'; |
| 8 | +import ThemedImage from '@theme/ThemedImage'; |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +_Workspaces_ in CodeGate allow you to organize and customize your interactions |
| 13 | +with large language models (LLMs). Each workspace is a distinct environment with |
| 14 | +its own configuration and history, enabling personalized settings and efficient |
| 15 | +management of your projects or tasks. |
| 16 | + |
| 17 | +Examples might include workspaces for different projects you're working on, or |
| 18 | +for specific tasks like code reviews or generating documentation. You can add |
| 19 | +custom instructions to each workspace to customize its behavior suitable to the |
| 20 | +task at hand. |
| 21 | + |
| 22 | +## Key features |
| 23 | + |
| 24 | +Workspaces offer several key features: |
| 25 | + |
| 26 | +- **Custom instructions**: Customize your interactions with LLMs by augmenting |
| 27 | + your AI assistant's system prompt, enabling tailored responses and behaviors |
| 28 | + for different types of tasks. |
| 29 | + |
| 30 | +- **Prompt and alert history**: Your LLM interactions (prompt history) and |
| 31 | + CodeGate security detections (alert history) are recorded in the active |
| 32 | + workspace, allowing you to track and review past interactions. |
| 33 | + |
| 34 | +- **Isolation**: Configurations and data in one workspace do not affect others, |
| 35 | + providing clarity when reviewing your AI-assisted coding history and precision |
| 36 | + in tailoring your custom instructions. |
| 37 | + |
| 38 | +:::tip Recommendations |
| 39 | + |
| 40 | +- Use workspaces to separate different projects or objectives, with customized |
| 41 | + instructions to optimize your work in each focus area. |
| 42 | +- Switch your active workspace as you move between projects or tasks. This helps |
| 43 | + you maintain your prompt and alert history for each project. |
| 44 | +- Regularly review and update your custom instructions to align with the |
| 45 | + evolving needs of your projects. |
| 46 | + |
| 47 | +::: |
| 48 | + |
| 49 | +## Working with workspaces |
| 50 | + |
| 51 | +You can view and manage your workspaces from the |
| 52 | +[CodeGate dashboard](../how-to/dashboard.md) |
| 53 | +([http://localhost:9090](http://localhost:9090)) or using commands in your AI |
| 54 | +assistant's chat interface. |
| 55 | + |
| 56 | +:::info Default workspace |
| 57 | + |
| 58 | +CodeGate ships with a default workspace named `default`. This workspace cannot |
| 59 | +be renamed, archived, or deleted. |
| 60 | + |
| 61 | +::: |
| 62 | + |
| 63 | +Only one workspace is active at any one time, and all AI assistant interactions |
| 64 | +occur within that workspace. |
| 65 | + |
| 66 | +You can perform several actions on workspaces: |
| 67 | + |
| 68 | +- **Activate**: Activate a workspace for use. Only one workspace can be active |
| 69 | + at a time. |
| 70 | +- **Add**: Create a new workspace. |
| 71 | +- **Rename**: Change the name of a workspace. |
| 72 | +- **Custom instructions**: Add custom instructions to augment your AI |
| 73 | + assistant's system prompt. |
| 74 | +- **Archive**: Mark a workspace as archived without permanently deleting it. The |
| 75 | + workspace is hidden from the available workspaces list, but can be restored |
| 76 | + later. This is useful when you are not actively working on a project but may |
| 77 | + want to come back to it in the future. |
| 78 | +- **Delete**: Permanently delete an archived workspace (CLI only). |
| 79 | + |
| 80 | +## Manage workspaces using the dashboard |
| 81 | + |
| 82 | +### Select the active workspace |
| 83 | + |
| 84 | +The currently active workspace is displayed at the top of the CodeGate dashboard |
| 85 | +interface. You can change the active workspace by expanding the workspace |
| 86 | +drop-down menu. Select the workspace you want to activate. You can also search |
| 87 | +by name to quickly find the desired workspace. |
| 88 | + |
| 89 | +<ThemedImage |
| 90 | + alt='The workspace drop-down menu in the CodeGate dashboard' |
| 91 | + sources={{ |
| 92 | + light: useBaseUrl('/img/features/workspace-menu-light.webp'), |
| 93 | + dark: useBaseUrl('/img/quickstart/workspace-menu-dark.webp'), |
| 94 | + }} |
| 95 | + title='Workspace menu' |
| 96 | + width={'800px'} |
| 97 | +/> |
| 98 | +_The workspace menu in the CodeGate dashboard_ |
| 99 | + |
| 100 | +### Manage workspaces |
| 101 | + |
| 102 | +To manage all your workspaces, select **Manage Workspaces** in the workspace |
| 103 | +menu. |
| 104 | + |
| 105 | +Click **Create Workspace** to add a new workspace. Workspace names can contain |
| 106 | +alphanumeric characters, hyphens (`-`), and underscores (`_`). Names are |
| 107 | +converted to lowercase, and must be unique. |
| 108 | + |
| 109 | +In the workspace list, click the **Settings** button next to a workspace to open |
| 110 | +the workspace settings screen. From here you can rename the workspace, set the |
| 111 | +custom prompt instructions, or archive the workspace. Archived workspaces can be |
| 112 | +restored from the Manage Workspaces screen, or permanently deleted |
| 113 | +[using the CLI](#delete). |
| 114 | + |
| 115 | +## Manage workspaces using the chat CLI |
| 116 | + |
| 117 | +You can manage workspaces using `codegate workspace` commands sent through your |
| 118 | +AI assistant's chat interface. To see all available commands, run: |
| 119 | + |
| 120 | +```text |
| 121 | +codegate workspace -h |
| 122 | +``` |
| 123 | + |
| 124 | +### Create a workspace \{#add} |
| 125 | + |
| 126 | +To create a new workspace: |
| 127 | + |
| 128 | +```text |
| 129 | +codegate workspace add WORKSPACE_NAME |
| 130 | +``` |
| 131 | + |
| 132 | +Replace `WORKSPACE_NAME` with a name for the new workspace. Names can only |
| 133 | +contain alphanumeric characters, hyphens (`-`), and underscores (`_`). |
| 134 | + |
| 135 | +### List workspaces \{#list} |
| 136 | + |
| 137 | +Get a list of all non-archived workspaces: |
| 138 | + |
| 139 | +```text |
| 140 | +codegate workspace list |
| 141 | +``` |
| 142 | + |
| 143 | +The currently active workspace is indicated as **(active)** in the list. |
| 144 | + |
| 145 | +### Activate a workspace \{#activate} |
| 146 | + |
| 147 | +Switch between workspaces using the `activate` command. The active workspace is |
| 148 | +the current environment for commands and configuration. |
| 149 | + |
| 150 | +```text |
| 151 | +codegate workspace activate WORKSPACE_NAME |
| 152 | +``` |
| 153 | + |
| 154 | +Replace `WORKSPACE_NAME` with the name of the workspace to activate. |
| 155 | + |
| 156 | +### Customize the system prompt \{#custom-instructions} |
| 157 | + |
| 158 | +To add custom instructions to your system prompt: |
| 159 | + |
| 160 | +```text |
| 161 | +codegate custom-instructions [-w WORKSPACE_NAME] set SYSTEM_PROMPT |
| 162 | +``` |
| 163 | + |
| 164 | +Replace `SYSTEM_PROMPT` with your custom prompt text. Optionally, specify the |
| 165 | +workspace to modify with `-w WORKSPACE_NAME`. If you don't explicitly set a |
| 166 | +workspace, the currently active workspace is modified. |
| 167 | + |
| 168 | +**Example**: Set a custom system prompt for the workspace named "project-alpha": |
| 169 | + |
| 170 | +```text |
| 171 | +codegate custom-instructions -w project-alpha set Start each conversation with "Welcome to Project Alpha Assistant. How can I help today?" |
| 172 | +``` |
| 173 | + |
| 174 | +To show the current custom instructions on a workspace: |
| 175 | + |
| 176 | +```text |
| 177 | +codegate custom-instructions [-w WORKSPACE_NAME] show |
| 178 | +``` |
| 179 | + |
| 180 | +To reset (clear) the custom instructions for a workspace: |
| 181 | + |
| 182 | +```text |
| 183 | +codegate custom-instructions [-w WORKSPACE_NAME] reset |
| 184 | +``` |
| 185 | + |
| 186 | +### Rename a workspace \{#rename} |
| 187 | + |
| 188 | +To change the name of an existing workspace: |
| 189 | + |
| 190 | +```text |
| 191 | +codegate workspace rename WORKSPACE_NAME NEW_WORKSPACE_NAME |
| 192 | +``` |
| 193 | + |
| 194 | +Replace `WORKSPACE_NAME` with the current name of the workspace, and |
| 195 | +`NEW_WORKSPACE_NAME` with the new name to set. |
| 196 | + |
| 197 | +### Archive a workspace \{#archive} |
| 198 | + |
| 199 | +To archive a workspace: |
| 200 | + |
| 201 | +```text |
| 202 | +codegate workspace archive WORKSPACE_NAME |
| 203 | +``` |
| 204 | + |
| 205 | +Replace `WORKSPACE_NAME` with the name of the workspace to archive. You cannot |
| 206 | +archive the currently active workspace. Archived workspaces can be |
| 207 | +[restored](#restore) later or [permanently deleted](#delete). |
| 208 | + |
| 209 | +### List archived workspaces \{#list-archived} |
| 210 | + |
| 211 | +Get a list of all archived workspaces: |
| 212 | + |
| 213 | +```text |
| 214 | +codegate workspace list-archived |
| 215 | +``` |
| 216 | + |
| 217 | +Archived workspaces can be [restored](#restore) or |
| 218 | +[permanently deleted](#delete), but cannot be activated. |
| 219 | + |
| 220 | +### Restore an archived workspace \{#restore} |
| 221 | + |
| 222 | +Use the `restore` command to recover an [archived](#archive) workspace. Once |
| 223 | +restored, a workspace will appear in your available [workspace list](#list) and |
| 224 | +can be [activated](#activate). |
| 225 | + |
| 226 | +```text |
| 227 | +codegate workspace restore WORKSPACE_NAME |
| 228 | +``` |
| 229 | + |
| 230 | +Replace `WORKSPACE_NAME` with the name of the workspace to restore. |
| 231 | + |
| 232 | +### Permanently delete a workspace \{#delete} |
| 233 | + |
| 234 | +The `delete-archived` command permanently deletes an archived workspace. |
| 235 | + |
| 236 | +```text |
| 237 | +codegate workspace delete-archived WORKSPACE_NAME |
| 238 | +``` |
| 239 | + |
| 240 | +Replace `WORKSPACE_NAME` with the name of the workspace to delete. |
| 241 | + |
| 242 | +:::warning |
| 243 | + |
| 244 | +Deletion is permanent. Ensure that the workspace is no longer needed and can be |
| 245 | +safely removed. |
| 246 | + |
| 247 | +::: |
0 commit comments