About

This post documents how to install "desktop" extensions with code-server - a popular way to run Visual Studio Code in the browser.

Background

The code-server project can run an instance of Visual Studio Code in the browser. I run code-server on my FreeBSD computers and it provides a development environment for my OpenBSD laptops.

By default the extensions that can be installed with code-server are limited to "web" extensions that are designed to run in a browser environment. It's also possible to use and install "desktop" extensions too but the install path is less obvious and requires a few manual steps that must be performed at the command-line.

Download

Overview

The first step involves downloading an extension as a vsix file, which is a zip archive that contains the extension's code and metadata.

The Go-based offvsix project provides a command-line utility that can download extensions from the Visual Studio Code marketplace. The following downloads the extension at the command-line and saves it to the extensions/ directory:

user@localhost$ offvsix golang.go
offvsix: find extension "golang.go"
offvsix: download version "0.53.1"
offvsix: [==================================================>] 100%
offvsix: save "golang.go-0.53.1.vsix"

Explanation

Install

Overview

After the extension has been downloaded we are ready to begin the install process with the code-server command-line utility:

user@localhost$ code-server --install-extension golang.go-0.53.1.vsix
Installing extensions...
Extension 'golang.go-0.53.1.vsix' was successfully installed.

Explanation

Conclusion

It took me months to realize that code-server could install and use desktop extensions as well as "web" extensions, and once I figured it out I wanted to document the process for others (and my future self). I hope this post might help others who are using code-server to drive their development environments.