How do I pin a vscode version or otherwise make changes to my installed version of vscode using the CLI?

Vscode has a CLI https://code.visualstudio.com/docs/editor/command-line

I was hoping to have some kind of automated/builtin way of mutating the version of vscode I have installed, say I have 1.81.1 and I want to change to 1.81.4, it would be nice to have the capability to do so through the cli like

MacBookPro18 % /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code --set-version 1.81.4

but I haven’t been able to find anything like this.

Is my only option to manually download and install a version from https://update.code.visualstudio.com ?

At the time of this writing, I’m not aware of there being any way to upgrade or downgrade VS Code via its commandline interface. If you install VS Code via a package manager (Ex. dpkg/apt, Snap, winget, Chocolatey, Homebrew, etc.), then you could use your package manager’s cli (if it has one) to do this.

As for other ways built-in to VS Code to manage versioning, see How to downgrade vscode and How do I disable VS Code of updating itself?.

Leave a Comment