Package: vscod
VSCODVSCODis short forVisualStudioCodeOfflineDownloader. This tool will allow you to download batches of extensions as well as VSCode binaries so you can later on use them to install your favorite editor and it's extensions.
This tool could help greatly if you're a frustrated admin that needs to update a local artifact repository, if you don't have access to the official repositories from your station and need to pass things by hand or just if you're an automation freak and for some reason want to mess up with the Visual Studio Marketplace.I tried to find a tool that does that and when I failed I tried to at least find a convenient API to use but to my surprise the Marketplace doesn't have one at the time of writing these lines (and if you find one, feel free to send a PR!), and so I ended up writingVSCOD!InstallationUse the Python package managerpipto installvscod.pipinstallvscodUsageShell# Display the helpvscod--help# Download the insider binaries for Linux (64bit deb), Windows (32bit) and Mac to the 'downloads' dir.vscoddownloadeditor--output'downloads'--buildinsiderlinux-deb-x64win32-archivedarwin# Download the official Python extension and the Vim keymap to the 'extensions' dir.vscoddownloadextensions--output'extensions'ms-python.pythonvscodevim.vim# Download the requested config data (see below) to the current directory (the default path if none is specified btw).vscoddownloadconfig--output'.'/path/to/config.json# List all the supported platform and build strings.vscodlist-optsPythonfromvscodimportextensions_downloader,vscode_downloaderfromvscod.vscode_downloaderimportBUILDS,PLATFORMS,LATEST_VERSIONimportasyncioimportaiohttpasyncdefvscod_demo():asyncwithaiohttp.ClientSession()assession:# It's all asynchronous!# Download the latest version of the official Python extension to the path.awaitextensions_downloader.download_extension_by_id(session,'ms-python.python','latest','/path/to/save')# Find what the latest version of the Vim keymap is.vim_version=awaitextensions_downloader.get_extension_version(session,'vscodevim.vim')# Download the latest stable Linux deb version to the path.awaitvscode_downloader.download_vscode(session,PLATFORMS.LINUX64_DEB,'/path/to/save',build=BUILDS.STABLE,version=LATEST_VERSION)asyncio.run(vscod_demo())ConfigYou can also supply a JSON configuration that looks something like this:{"vscode":[{"platform":"linux-deb-x64"},{"platform":"win32-x64-user","version":"latest","build":"stable"}],"extensions":{"gitlens":"eamodio.gitlens","languages":{"go":"ms-vscode.go","python":{"python":"ms-python.python","auto_docstring":"njpwerner.autodocstring"}}}}The top level"vscode"and"extensions"signals that these are the editor and extensions download settings respectively (duh).
The parsing process then goes as follows:For extensions:Go through the loaded dictionary's items recursively:If the value is a string, we got to the extension ID.If the value is a dict, delve deeper.Build a directory hierarchy using the keys as directories.Download each extension ID to it's designated location.For VSCode binaries:Go through the loaded list of specification dicts. If the value of the top level"vscode"key is a dict, treat it like a list with a single dict.For each of them download the binary according to the specification given in the dict into a designated directory.So it will generate the following hierarchy:|-- root_path
    |-- gitlens
    |   |-- eamodio.gitlens-9.9.3.vsix
    |-- languages
    |   |-- go
    |   |   |-- ms-vscode.go-0.11.4.vsix
    |   |-- python
    |       |-- auto_docstring
    |       |   |-- njpwerner.autodocstring-0.3.0.vsix
    |       |-- python
    |           |-- ms-python.python-2019.8.30787.vsix
    |-- linux-deb-x64
    |   |-- code_1.37.1-1565886362_amd64.deb
    |-- win32-x64-user
        |-- VSCodeUserSetup-x64-1.37.1.exeLicenseMIT