This guide walks you through publishing CodeGuard to the Visual Studio Code Marketplace.
Before publishing, you need:
- Microsoft Account - Create one at https://account.microsoft.com if you don't have one
- Azure DevOps Organization - For managing your publisher account
- Personal Access Token (PAT) - For authentication
- vsce CLI Tool - VSCode Extension Manager
npm install -g @vscode/vsceVerify installation:
vsce --version- Go to https://dev.azure.com
- Sign in with your Microsoft account
- Click "Create new organization"
- Choose a name (e.g., "codeguard-publisher")
- Complete the setup
- In Azure DevOps, click your profile icon (top right)
- Select "Personal access tokens"
- Click "+ New Token"
- Configure the token:
- Name: "VSCode Marketplace Publisher"
- Organization: Select your organization
- Expiration: Choose duration (90 days, 1 year, or custom)
- Scopes: Select "Custom defined"
- Check "Marketplace" > "Manage" (this is critical!)
- Click "Create"
- IMPORTANT: Copy the token immediately - you won't see it again!
- Save it securely (e.g., password manager)
- Go to https://marketplace.visualstudio.com/manage
- Sign in with your Microsoft account
- Click "Create publisher"
- Fill in the form:
- Publisher ID: Unique identifier (e.g., "lekhanpro" or "codeguard-team")
- Must be lowercase, alphanumeric, hyphens allowed
- Cannot be changed later!
- Display Name: "CodeGuard" or your preferred name
- Email: Your contact email
- Description: Brief description of your publisher profile
- Publisher ID: Unique identifier (e.g., "lekhanpro" or "codeguard-team")
- Click "Create"
Update the publisher field in package.json with your Publisher ID:
{
"publisher": "your-publisher-id",
"repository": {
"type": "git",
"url": "https://github.com/lekhanpro/CodeGuard.git"
},
"bugs": {
"url": "https://github.com/lekhanpro/CodeGuard/issues"
},
"homepage": "https://github.com/lekhanpro/CodeGuard#readme",
"icon": "icon.png"
}Create a 128x128 PNG icon named icon.png in the root directory. This will be displayed in the marketplace.
If you don't have an icon yet, you can skip this and add it later.
vsce login your-publisher-idWhen prompted, paste your Personal Access Token (PAT).
Before publishing, test the package locally:
npm run compile
vsce packageThis creates a .vsix file (e.g., codeguard-0.1.0.vsix).
Install the packaged extension in VSCode:
code --install-extension codeguard-0.1.0.vsixTest it thoroughly to ensure everything works.
Once you're satisfied with testing:
vsce publishOr publish with a specific version:
vsce publish 0.1.0Or publish and increment version automatically:
vsce publish patch # 0.1.0 -> 0.1.1
vsce publish minor # 0.1.0 -> 0.2.0
vsce publish major # 0.1.0 -> 1.0.0- Go to https://marketplace.visualstudio.com/manage
- You should see your extension listed
- Click on it to view details
- The extension will be available at:
https://marketplace.visualstudio.com/items?itemName=your-publisher-id.codeguard
After publication (may take a few minutes to appear):
- Open VSCode
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "CodeGuard"
- Click Install
When you have updates:
- Update version in
package.json - Update
CHANGELOG.mdwith changes - Commit and push to GitHub
- Run
vsce publishagain
Or use automatic versioning:
# For bug fixes
vsce publish patch
# For new features
vsce publish minor
# For breaking changes
vsce publish major- Verify your Publisher ID is correct
- Make sure you've created the publisher at https://marketplace.visualstudio.com/manage
- Create a new PAT with "Marketplace > Manage" scope
- Run
vsce login your-publisher-idagain
- Check that all required fields in
package.jsonare filled - Ensure
README.mdexists and has content - Verify
LICENSEfile exists
- Either add an
icon.pngfile (128x128) - Or remove the
"icon"field frompackage.json
- Version Control: Always commit and push to GitHub before publishing
- Testing: Test the packaged
.vsixfile before publishing - Changelog: Keep
CHANGELOG.mdupdated with each release - Semantic Versioning: Follow semver (MAJOR.MINOR.PATCH)
- Documentation: Keep README.md comprehensive and up-to-date
- Security: Never commit your PAT to version control
After publishing, you can:
- View Statistics: See download counts, ratings, and reviews
- Respond to Reviews: Engage with users
- Update Metadata: Change description, categories, etc.
- Unpublish: Remove extension if needed (use carefully!)
-
GitHub README: Add marketplace badge:
[](https://marketplace.visualstudio.com/items?itemName=your-publisher-id.codeguard)
-
Social Media: Share on Twitter, LinkedIn, Reddit (r/vscode)
-
Blog Post: Write about your extension's features
-
Documentation: Create comprehensive docs on GitHub wiki
# Login to publisher account
vsce login your-publisher-id
# Package extension (creates .vsix)
vsce package
# Publish extension
vsce publish
# Publish with version bump
vsce publish patch|minor|major
# Show extension info
vsce show your-publisher-id.codeguard
# Unpublish extension (careful!)
vsce unpublish your-publisher-id.codeguard
# List all versions
vsce ls your-publisher-id.codeguard- VSCode Publishing Guide: https://code.visualstudio.com/api/working-with-extensions/publishing-extension
- Marketplace Management: https://marketplace.visualstudio.com/manage
- Azure DevOps: https://dev.azure.com
- Extension Guidelines: https://code.visualstudio.com/api/references/extension-guidelines
If you encounter issues:
- Check the VSCode Extension API docs
- Visit VSCode Extension Development Discord
- Ask on Stack Overflow
Ready to publish? Follow the steps above and your extension will be live on the VSCode Marketplace!