VS Code Extension Packaging
Use these steps to build, verify, and publish the VS Code extension without producing an incomplete VSIX.
Prerequisites
- Run commands from
extensions/vscode unless noted otherwise.
- Install dependencies for
core, gui, and extensions/vscode.
- Use the same target you plan to support on Marketplace. Native binaries are packaged per target.
Build a local VSIX
From the repository root:
cd extensions/vscode
npm install
npm run package
This now runs the full staging flow before vsce packages the extension:
- builds or reuses the GUI output
- copies the GUI into
extensions/vscode/gui
- stages native binaries, sqlite, ripgrep, models, and runtime files
- bundles
out/extension.js
- writes the VSIX to
extensions/vscode/build/
The direct script path also stages correctly:
cd extensions/vscode
node scripts/package.js --target darwin-arm64
For a target-specific build:
cd extensions/vscode
CONTINUE_VSCODE_TARGET=darwin-arm64 npm run package
Examples:
CONTINUE_VSCODE_TARGET=darwin-arm64 npm run package
CONTINUE_VSCODE_TARGET=darwin-x64 npm run package
CONTINUE_VSCODE_TARGET=linux-x64 npm run package
CONTINUE_VSCODE_TARGET=win32-x64 npm run package
Verify the VSIX locally
Install the generated file in VS Code before publishing it:
code --install-extension build/appbuilder-code-agent-0.0.1.vsix --force
After installation, verify these points in VS Code:
- the extension activates without staying in a loading state
- the sidebar webview opens
Developer: Show Running Extensions shows the extension as active
Developer: Toggle Developer Tools does not show missing gui/assets or missing native module errors
Publish to Marketplace
Use the helper to keep packaging, local installation, and Marketplace upload on the same path.
Validate the VSIX locally:
cd extensions/vscode
CONTINUE_VSCODE_TARGET=darwin-arm64 npm run publish:validate
That command:
- packages through
scripts/package.js
- installs the generated VSIX with
code --install-extension
- stops before publishing so you can verify the extension loads correctly
After the local install works, publish the exact VSIX that was just built:
cd extensions/vscode
CONTINUE_VSCODE_TARGET=darwin-arm64 npm run publish:marketplace
If you want to package without installing it locally:
cd extensions/vscode
node scripts/publish.js --target darwin-arm64 --skip-install
If you still want the raw vsce command, only use it after the validation step above:
cd extensions/vscode
npx @vscode/vsce publish
If you prefer to upload the generated VSIX through the Marketplace publisher flow, upload the file from extensions/vscode/build/ only after the local verification step passes.
Common failure
Do not package the extension with raw vsce package unless the staging step is wired in first. An incomplete package can install successfully and then stay in an infinite loading state because the GUI assets or packaged runtime dependencies are missing.