# @vscode/vsce

> VS Code Extensions Manager

Latest version **4.1.1** (published 2026-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vscode/vsce
pnpm add @vscode/vsce
yarn add @vscode/vsce
bun add @vscode/vsce
```

Provides the command `vsce`.

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2026-11-12 |
| First published | 2022-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 22 |
| Dependencies | 26 |
| Unpacked size | 238.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1058 |
| Author | Microsoft Corporation |
| Maintainers | kaimaetzel, lszomoru, alexandrudima, sbatten, microsoft1es, vscode-bot |
| Keywords | vscode, vsce, extension |

## Links

- npm: https://www.npmjs.com/package/@vscode/vsce
- Repository: https://github.com/Microsoft/vsce
- Homepage: https://code.visualstudio.com
- Issues: https://github.com/Microsoft/vsce/issues
- npm.io page: https://npm.io/package/@vscode/vsce

## Dependencies (26)

- [mime](https://npm.io/package/mime.md) ^1.6.0
- [read](https://npm.io/package/read.md) ^1.0.7
- [yazl](https://npm.io/package/yazl.md) ^2.5.1
- [yauzl](https://npm.io/package/yauzl.md) ^3.4.0
- [marked](https://npm.io/package/marked.md) ^18.0.11
- [parse5](https://npm.io/package/parse5.md) ^8.0.1
- [semver](https://npm.io/package/semver.md) ^7.8.5
- [xml2js](https://npm.io/package/xml2js.md) ^0.5.0
- [url-join](https://npm.io/package/url-join.md) ^4.0.1
- [cockatiel](https://npm.io/package/cockatiel.md) ^3.2.1
- [commander](https://npm.io/package/commander.md) ^12.1.0
- [minimatch](https://npm.io/package/minimatch.md) ^10.2.6
- [tinyglobby](https://npm.io/package/tinyglobby.md) ^0.2.17
- [jsonc-parser](https://npm.io/package/jsonc-parser.md) ^3.3.1
- [@azure/identity](https://npm.io/package/@azure/identity.md) ^4.13.2
- [hosted-git-info](https://npm.io/package/hosted-git-info.md) ^4.1.0
- [proper-lockfile](https://npm.io/package/proper-lockfile.md) ^4.1.2
- [@napi-rs/keyring](https://npm.io/package/@napi-rs/keyring.md) ^1.3.0
- [@secretlint/core](https://npm.io/package/@secretlint/core.md) ^10.2.2
- [@secretlint/types](https://npm.io/package/@secretlint/types.md) ^10.2.2
- [@vscode/vsce-sign](https://npm.io/package/@vscode/vsce-sign.md) ^2.1.1
- [typed-rest-client](https://npm.io/package/typed-rest-client.md) ^1.8.11
- [azure-devops-node-api](https://npm.io/package/azure-devops-node-api.md) ^12.5.0
- [@secretlint/source-creator](https://npm.io/package/@secretlint/source-creator.md) ^10.2.2
- [@secretlint/secretlint-rule-no-dotenv](https://npm.io/package/@secretlint/secretlint-rule-no-dotenv.md) ^10.2.2
- [@secretlint/secretlint-rule-preset-recommend](https://npm.io/package/@secretlint/secretlint-rule-preset-recommend.md) ^10.2.2

## Recent versions

- 4.1.1 (latest) — 2026-11-12
- 4.1.2-3 (next) — 2026-11-24
- 4.1.2-2 — 2026-11-24
- 4.1.2-1 — 2026-11-24
- 4.1.2-0 — 2026-11-16
- 4.1.1-1 — 2026-11-12
- 4.1.1-0 — 2026-10-30
- 4.1.0 — 2026-10-28
- 4.0.1-6 — 2026-10-27
- 4.0.1-5 — 2026-10-21
- 4.0.1-4 — 2026-10-19
- 4.0.1-3 — 2026-10-03
- 4.0.1-2 — 2026-10-03
- 4.0.1-1 — 2026-09-29
- 4.0.1-0 — 2026-09-15
- … 194 more at https://npm.io/package/@vscode/vsce/versions

## README

# @vscode/vsce

> _The Visual Studio Code Extension Manager_

[![Build Status](https://dev.azure.com/monacotools/Monaco/_apis/build/status/npm/microsoft.vscode-vsce?repoName=microsoft%2Fvscode-vsce&branchName=main)](https://dev.azure.com/monacotools/Monaco/_build/latest?definitionId=446&repoName=microsoft%2Fvscode-vsce&branchName=main)
[![Version](https://img.shields.io/npm/v/@vscode/vsce.svg)](https://npmjs.org/package/@vscode/vsce)

This tool assists in packaging and publishing Visual Studio Code extensions.

Read the [**Documentation**](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VS Code website.

## Requirements

[Node.js](https://nodejs.org/en/) at least `22.x.x`.

### Linux

In order to save credentials safely, this project uses [`@napi-rs/keyring`](https://www.npmjs.com/package/@napi-rs/keyring), which uses the system Secret Service and falls back to the Linux kernel keyring. Setting the `VSCE_STORE=file` environment variable will revert back to the file credential store. Using the `VSCE_PAT` environment variable will also avoid using the system credential store.

### Upgrading saved PATs

When a command needs a saved Personal Access Token and the publisher has none in the current native credential store, `vsce` checks for that publisher's old `keytar` credential. If one is found in an interactive terminal, it offers:

```text
A saved PAT for publisher 'your-publisher' was found in the previous credential store. Copy it to the new store? [y/N]
```

Enter `Y` to copy just that publisher's PAT and continue without re-entering it. Enter `N` (or press Enter) to continue to the normal PAT prompt without copying anything. Migration is skipped in non-interactive runs such as CI.

- **Windows:** reads the requested Windows Credential Manager entry using the built-in Windows PowerShell. No `keytar` installation is needed.
- **Linux:** requires `secret-tool` (`libsecret-tools` on Debian/Ubuntu) and access to the same desktop Secret Service used previously. You may be prompted to unlock the keyring.
- **macOS:** existing Keychain entries are already compatible; no copying is necessary.

Existing PATs in the new store take precedence; migration does not run while listing publishers or logging out. Each copied PAT is read back before it is used. **Old keytar entries are never modified or deleted**, so older `vsce` versions can still use them. Declining or logging out does not permanently suppress the offer: the old PAT can be offered again when needed, but copying always requires fresh consent. Logout removes only the new entry and does not revoke the PAT.

Credential writes are serialized across `vsce` processes, and the destination is checked again after confirmation to avoid overwriting a newer PAT. The non-secret lock lives under `~/.vsce-keytar-migration`; no PATs or consent decisions are stored there. A command waits up to 30 seconds for the lock; a lock abandoned by a crashed process can be recovered after two minutes.

If legacy lookup or copying fails, `vsce` displays a warning and continues to the normal PAT prompt. Install the required helper/unlock the keyring and retry, or enter a PAT to save it normally. Migration helpers time out after 30 seconds. Using `VSCE_STORE=file`, `VSCE_PAT`, or `--pat` does not trigger this native-store migration; the existing plaintext-file migration is unchanged.

## Usage

```console
$ npx @vscode/vsce --version
```

`@vscode/vsce` is meant to be mainly used as a command-line tool. It can also be used as a library since it exposes a small [API](https://github.com/microsoft/vscode-vsce/blob/main/src/api.ts). When using `@vscode/vsce` as a library, be sure to sanitize any user input used in API calls to prevent security issues.

Supported package managers:

- `npm >=6`
- `yarn >=1 <2`

## Configuration

You can configure the behavior of `vsce` by using CLI flags (run `vsce --help` to list them all). Example:

```console
$ npx @vscode/vsce publish --baseImagesUrl https://my.custom/base/images/url
```

Or you can also set them in the `package.json`, so that you avoid having to retype the common options again. Example:

```jsonc
// package.json
{
  "vsce": {
    "baseImagesUrl": "https://my.custom/base/images/url",
    "dependencies": true,
    "yarn": false
  }
}
```

### Trusted publishing

`vsce publish --oidc` publishes from GitHub Actions without storing a Personal Access Token. Configure a trusted
publishing policy for the repository and workflow on the Visual Studio Marketplace, then grant the workflow permission
to request an OIDC token:

```yaml
jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npx @vscode/vsce publish --oidc
```

OIDC publishing requests a GitHub Actions token for the `marketplace.visualstudio.com` audience and exchanges it for a
Marketplace session token valid for up to 15 minutes. The exchange uses
`POST /_apis/gallery/token?api-version=7.2-preview.1` with `Authorization: FederatedToken <GitHub OIDC JWT>` and a JSON
body containing `publisherName`. The session token is then used in place of a PAT for publishing. It does not fall back
to a PAT when token acquisition or exchange fails.

## Development

First clone this repository, then:

```console
$ npm install
$ npm run watch:build # or `watch:test` to also build tests
```

Once the watcher is up and running, you can run out of sources with:

```console
$ node vsce
```

Tests can be executed with:

```console
$ npm test
```

> **Note:** [Yarn](https://www.npmjs.com/package/yarn) is required to run the tests.

---
_Source: https://npm.io/package/@vscode/vsce · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
