This Rust program reads the different arrays from an extensions.json file and downloads the corresponding VSIX packages for Visual Studio Code extensions.
This is an adaptation of the original vsixHarvester, it does not use the Visual Studio Code extensions.json file, but a custom one. The custom extensions.json file allows to specify the architecture for each extension.
The custom extensions.json is designed for use in our hcf-coder, a modified version of codercom/code-server. During the Dockerfile build process, all necessary Visual Studio Code extensions are automatically downloaded at the latest version compatible with the embedded code engine.
- Reads a list of extensions from
extensions.json. - Downloads the latest version of each extension as a VSIX package.
- Supports proxy configuration.
- Option to force re-download even if the file already exists.
- Provides verbose output for detailed logging.
- Direct download of a single extension without using extensions.json file.
- Parrallel download of extensions.
- Get latest version for a specific engine
- Rust and Cargo installed on your system. You can install them from rustup.rs.
cargo install vsixHarvestervsixHarvester [OPTIONS]-i,--input <INPUT>: Path to theextensions.jsonfile. Default is./extensions.json.-d,--destination <DESTINATION>: Destination folder to save the VSIX files. Default is./extensions.-D,--download <EXTENSION>: Download a single extension (e.g., 'golang.Go') without using extensions.json.-a,--arch <ARCHITECTURE>: Architecture for single extension download (e.g., 'linux_x64', 'darwin_arm64').-e,--engine-version <ENGINE_VERSION: Engine version to be compatible with--no-cache: Force re-download even if the extension file already exists.--proxy <PROXY>: Proxy URL to use for HTTP requests.--serial-download: Download extensions serially instead of in parallel.-v,--verbose: Enable verbose output for detailed logging.-h,--help: Print help information.--allow-pre-release: Allow downloading pre-release versions of extensions (default to false).
Alternatively, you can set the following environment variables:
- EXTENSIONS_FILE (default:
./extensions.json) - OUTPUT_DIR (default:
./extensions) - PROXY (default: none)
- ENGINE_VERSION (default: none)
- VERBOSE (default: false) - sets the log level to
info - DOWNLOAD (default: none)
- ARCH (default: none)
- SERIAL_DOWNLOAD (default: false)
- NO_CACHE (default: false)
The program use env_logger for logging. You can set the RUST_LOG environment variable to control the log level.
vsixHarvester \
--input ./your/path/to/extensions.json \
--destination ./your/path/to/extensions \
--no-cache \
--verboseDirect download of a single extension:
vsixHarvester --download golang.Go --destination ./extensionsDirect download with specific architecture:
vsixHarvester -D ms-python.python -a linux_x64 -d ./extensionswin32_x64win32_arm64darwin_x64darwin_arm64linux_x64linux_arm64
The extensions.json file should have the following structure:
{
"universal": [
// "publisher.extensionName",
// "anotherPublisher.anotherExtensionName",
"GitHub.copilot",
"GitHub.copilot-chat",
"golang.Go",
"yzhang.markdown-all-in-one",
"eamodio.gitlens"
],
"linux_x64":[
"rust-lang.rust-analyzer",
"ms-python.python"
],
"linux_arm64":[
"rust-lang.rust-analyzer",
"ms-python.python"
]
}- Inspired from offvsix
- Modified from vsixHarvester