Visual Studio Code¶
- ID
vscode- Home page
- Version requirement
>= 1.60
- Platforms
🅱️ BSD · 🐧 Linux · 🍎 macOS · ⨂ Unix · 🪟 Windows
- Operations
installed·install·remove- purl types
pkg:vscode- Brewfile entry
vscode, in Brewfile backups- CLI name
code- Issues and PRs
- Source
Visual Studio Code’s extension manager, driven
through the code CLI.
The Marketplace cannot be queried from the CLI: no search, outdated or upgrade command exists (extensions self-update in the background), so only the installed listing, install and remove are declared.
No version_regexes: code --version prints the bare version, then the commit
hash and the arch on their own lines, and the default regex picks the first
token up.
What mpm adds to vscode¶
mpm reaches across every manager at once, not vscode alone: mpm installed and mpm outdated cover vscode alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.
Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.
Your vscode commands, in mpm¶
You already know vscode: each operation maps one-to-one onto mpm, in an interface shared by every manager.
To… |
With |
With |
|---|---|---|
List what’s installed |
|
|
Install a package |
|
|
Remove a package |
|
|
Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Operations¶
Operation |
Supported |
|---|---|
|
✓ |
|
|
|
|
|
|
|
✓ |
|
|
|
|
|
✓ |
|
|
|
|
|
Selecting and configuring vscode¶
Deselect vscode for a single run with --no-vscode, or persist the choice in your configuration:
[mpm]
vscode = false
Keep it enabled but tune how mpm drives it with a per-manager override:
[mpm.managers.vscode]
timeout = 900
mpm config-template vscode prints every overridable attribute as a ready-to-paste block.
Recipes¶
A few jobs you would otherwise script around vscode, one mpm command each:
Snapshot and clone a machine:
mpm --vscode dump vscode.toml, thenmpm restore vscode.tomlon the next one.Export a Brewfile entry instead:
mpm --vscode dump --brewfile Brewfile.Export a compliance SBOM:
mpm --vscode sbom(CycloneDX by default,--spdxfor SPDX).
Privilege escalation¶
mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.
None of its operations needs root.
See privilege escalation for the full policy.
Cooldown¶
State of Visual Studio Code’s release-age gating, from the cooldown support table:
Status: 🚧 Proposed
Mechanism: proposed enterprise policy
Reference: microsoft/vscode#316867
A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:
Registry: VS Code Marketplace
Retraction: Unpublish, uniquely with client-side remediation: “the extension is removed from the Marketplace and added to a block list. If the extension has been installed, it’s automatically uninstalled by VS Code” (runtime security), against a public ledger of removals (RemovedPackages.md)
With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.
Version probe¶
The version is probed by running:
$ code --version
1.60.2
7f6ab5485bbc008386c4386d08766667e155244e
x64
and extracted with:
r"(?P<version>\S+)"
Reference traces¶
Raw native outputs captured in the bundled definition: the reference mpm’s parsers were written against. If you know Visual Studio Code well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ code --list-extensions --show-versions
ms-python.python@2021.9.1246542782
ms-toolsai.jupyter@2021.8.2041215044
tamasfe.even-better-toml@0.14.2
Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --vscode installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.