You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
modules/code-server
Guspan Tanadi c390ed005f
docs: update section links JSON Settings (#401)
3 months ago
..
README.md docs: update section links JSON Settings (#401) 3 months ago
main.test.ts feat(code-server): add code-server offline and cache support (#184) 1 year ago
main.tf fix(code-server): set `settings` variable type to `any` (#368) 5 months ago
run.sh fix: handle extensions.json comments in vscode-web and code-server (#398) 3 months ago

README.md

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

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/modules/code-server/coder"
  version  = "1.0.29"
  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/modules/code-server/coder"
  version         = "1.0.29"
  agent_id        = coder_agent.example.id
  install_version = "4.8.3"
}

Pre-install Extensions

Install the Dracula theme from OpenVSX:

module "code-server" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/modules/code-server/coder"
  version  = "1.0.29"
  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/modules/code-server/coder"
  version    = "1.0.29"
  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/modules/code-server/coder"
  version    = "1.0.29"
  agent_id   = coder_agent.example.id
  extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
}

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/modules/code-server/coder"
  version    = "1.0.29"
  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/modules/code-server/coder"
  version  = "1.0.29"
  agent_id = coder_agent.example.id
  offline  = true
}