vscodeweb

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ForwardPortsOption  = "FORWARD_PORTS"
	BindAddressOption   = "BIND_ADDRESS"
	VersionOption       = "VERSION"
	DownloadAmd64Option = "DOWNLOAD_AMD64"
	DownloadArm64Option = "DOWNLOAD_ARM64"
)
View Source
const DefaultVSCodeWebPort = 10802

DefaultVSCodeWebPort sits next to openvscode (10800) and code-server (10801) so a host running all three only collides under the FindAvailablePort fallback path, not by default.

Variables

View Source
var Options = ide.Options{
	ForwardPortsOption: {
		Name:        ForwardPortsOption,
		Description: "If Devsy should automatically do port-forwarding",
		Default:     "true",
		Enum:        []string{"true", "false"},
	},
	BindAddressOption: {
		Name:        BindAddressOption,
		Description: "The address to bind VS Code Web to locally, e.g. 0.0.0.0:12345",
		Default:     "",
	},
	VersionOption: {
		Name: VersionOption,
		Description: "The VS Code version for the serve-web CLI " +
			"(a release version like 1.96.4, or 'latest')",
		Default: "1.96.4",
	},
	DownloadArm64Option: {
		Name:        DownloadArm64Option,
		Description: "The download url for the arm64 VS Code CLI",
	},
	DownloadAmd64Option: {
		Name:        DownloadAmd64Option,
		Description: "The download url for the amd64 VS Code CLI",
	},
}

Functions

This section is empty.

Types

type ServerOptions

type ServerOptions struct {
	Extensions []string
	Settings   string
	UserName   string
	Host       string
	Port       string
	Values     map[string]config.OptionValue
}

ServerOptions configures a VSCodeWeb instance.

type VSCodeWeb

type VSCodeWeb struct {
	// contains filtered or unexported fields
}

VSCodeWeb installs the official VS Code CLI and runs it as `code serve-web` inside the workspace, serving the browser IDE backed by the Microsoft Marketplace.

func NewVSCodeWeb

func NewVSCodeWeb(opts ServerOptions) *VSCodeWeb

func (*VSCodeWeb) Install

func (v *VSCodeWeb) Install() error

Install downloads the VS Code CLI tarball, extracts the `code` binary under <home>/.vscode-web, and writes settings.json. The download is skipped only when the existing install already matches the requested release (tracked via a marker file), so changing VERSION / DOWNLOAD_* triggers a reinstall. settings.json is rewritten on every call so workspace settings stay current.

func (*VSCodeWeb) InstallExtensions

func (v *VSCodeWeb) InstallExtensions() error

InstallExtensions installs each requested extension via the VS Code CLI. Partial failures are logged and tolerated; an aggregated error is returned only when every requested extension fails to install.

func (*VSCodeWeb) Start

func (v *VSCodeWeb) Start() error

Start launches `code serve-web` as a background process bound to host:port. Idempotent via command.StartBackgroundOnce. --accept-server-license-terms is required so the background process never blocks on a license prompt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL