Skip to content

vscode extensions download with extensions.json

License

Notifications You must be signed in to change notification settings

sctg-development/vsixHarvester

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vsixHarvester

VSCode Extension Downloader in Rust

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.

Features

  • 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

Binaries

Prerequisites

  • Rust and Cargo installed on your system. You can install them from rustup.rs.

Installation

cargo install vsixHarvester

Usage

vsixHarvester [OPTIONS]

Options

  • -i, --input <INPUT>: Path to the extensions.json file. 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.

Environment Variables

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)

Logging

The program use env_logger for logging. You can set the RUST_LOG environment variable to control the log level.

Example

vsixHarvester \
  --input ./your/path/to/extensions.json \
  --destination ./your/path/to/extensions \
  --no-cache \
  --verbose

Direct download of a single extension:

vsixHarvester --download golang.Go --destination ./extensions

Direct download with specific architecture:

vsixHarvester -D ms-python.python -a linux_x64 -d ./extensions
Architecture options
  • win32_x64
  • win32_arm64
  • darwin_x64
  • darwin_arm64
  • linux_x64
  • linux_arm64

extensions.json Format

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"
  ]
}

Thanks

About

vscode extensions download with extensions.json

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 95.8%
  • Dockerfile 4.2%