A CLI tool for publishing VS Code extensions to the Marketplace, OpenVSX, and GitHub Releases.
npx vsxpub
You can skip publishing to specific platforms by using the --include
or --exclude
. exclude is higher priority than include.
Examples:
- Local development:
npx vsxpub --exclude git
to skip GitHub releases - CI/CD pipeline:
npx vsxpub --include git
to avoid configuring secrets
Required environment variables:
GITHUB_TOKEN
- GitHub personal access tokenVSCE_PAT
- VS Code Marketplace personal access tokenOVSX_PAT
- OpenVSX registry personal access token
For local development, follow the Visual Studio Marketplace and Open VSX Registry documentation to set up personal access tokens. For CI/CD, add these as GitHub repository secrets
or skip specific platforms.
Before using vsxpub
, ensure that your GitHub release page has been created. You can use tools like changelogithub
to automatically create release pages with changelogs.
name: Release
permissions:
contents: write
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install pnpm
uses: pnpm/action-setup@v3
- run: pnpm install
# Create release page with changelog
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# Generate .vsix file
- name: Generate .vsix file
run: npx vsce package --no-dependencies
# Publish extension to all platforms
# Or you can skip publishing to specific platforms in CI and run npx vsxpub locally without configuring secrets
- name: Publish Extension
run: npx vsxpub --no-dependencies
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
VSCE_PAT: ${{secrets.VSCE_PAT}}
OVSX_PAT: ${{secrets.OVSX_PAT}}
Modern IDEs like Cursor and Windsurf that fork VS Code obtain their extensions from OpenVSX instead of the official VS Code Marketplace. This creates significant additional workload for VS Code extension developers who need to manually synchronize their extensions to OpenVSX.
When versions become inconsistent between the two platforms, it causes numerous problems for users who expect the same extension experience across different IDEs.
Additionally, to handle more complex scenarios, vsxpub
also uploads the .vsix file to the GitHub release page, providing users with the option for manual installation when automatic publishing to platforms is not possible or desired.
MIT License © jinghaihan