DevCats 2a40c07c3a
feat(tests): add e2e test for code-server (#643)
## Description

Adds e2e test for code-server that actually installs and health checks
code-server
<!-- Briefly describe what this PR does and why -->

## Type of Change

- [ ] New module
- [ ] New template
- [ ] Bug fix
- [ ] Feature/enhancement
- [ ] Documentation
- [X] Other

## Testing & Validation

- [X] Tests pass (`bun test`)
- [X] Code formatted (`bun fmt`)
- [X] Changes tested locally

## Related Issues

<!-- Link related issues or write "None" if not applicable -->
2026-01-13 07:53:27 -06:00
..
2025-11-27 12:00:04 +05:00

display_name description icon verified tags
code-server VS Code in the browser ../../../../.icons/code.svg true
ide
web
code-server

code-server

Automatically install code-server in a workspace, create an app to access it via the dashboard, install extensions, and pre-configure editor settings.

module "code-server" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/coder/code-server/coder"
  version  = "1.4.2"
  agent_id = coder_agent.example.id
}

Screenshot 1

Examples

Pin Versions

module "code-server" {
  count           = data.coder_workspace.me.start_count
  source          = "registry.coder.com/coder/code-server/coder"
  version         = "1.4.2"
  agent_id        = coder_agent.example.id
  install_version = "4.106.3"
}

Pre-install Extensions

Install the Dracula theme from OpenVSX:

module "code-server" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/coder/code-server/coder"
  version  = "1.4.2"
  agent_id = coder_agent.example.id
  extensions = [
    "dracula-theme.theme-dracula"
  ]
}

Enter the <author>.<name> into the extensions array and code-server will automatically install on start.

Pre-configure Settings

Configure VS Code's settings.json file:

module "code-server" {
  count      = data.coder_workspace.me.start_count
  source     = "registry.coder.com/coder/code-server/coder"
  version    = "1.4.2"
  agent_id   = coder_agent.example.id
  extensions = ["dracula-theme.theme-dracula"]
  settings = {
    "workbench.colorTheme" = "Dracula"
  }
}

Install multiple extensions

Just run code-server in the background, don't fetch it from GitHub:

module "code-server" {
  count      = data.coder_workspace.me.start_count
  source     = "registry.coder.com/coder/code-server/coder"
  version    = "1.4.2"
  agent_id   = coder_agent.example.id
  extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
}

Pass Additional Arguments

You can pass additional command-line arguments to code-server using the additional_args variable. For example, to disable workspace trust:

module "code-server" {
  count           = data.coder_workspace.me.start_count
  source          = "registry.coder.com/coder/code-server/coder"
  version         = "1.4.2"
  agent_id        = coder_agent.example.id
  additional_args = "--disable-workspace-trust"
}

Offline and Use Cached Modes

By default the module looks for code-server at /tmp/code-server but this can be changed with install_prefix.

Run an existing copy of code-server if found, otherwise download from GitHub:

module "code-server" {
  count      = data.coder_workspace.me.start_count
  source     = "registry.coder.com/coder/code-server/coder"
  version    = "1.4.2"
  agent_id   = coder_agent.example.id
  use_cached = true
  extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
}

Just run code-server in the background, don't fetch it from GitHub:

module "code-server" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/coder/code-server/coder"
  version  = "1.4.2"
  agent_id = coder_agent.example.id
  offline  = true
}

Some of the key differences between code-server and VS Code Web are listed in docs.