Visual Studio Code and extensions downloader for offline installations
vscode-dl is a Python3 script that downloads the latest Linux version of Visual Studio Code and a curated list of extensions for installation on computers without Internet connection or proxy restrictions.
The program also creates a catalog in JSON and Markdown that can be incorporated into a web page, like this example.
When run again, it tries to update extensions and VSCode to their latest version.
- Python3 : version >= 3.6 (older ones won't work because of f-strings)
- Requests and Requests-cache
This installs the latest stable, released version.
pip3 install -U vscode-dl
python3 -m venv vscode-dl vscode-dl/bin/pip install vscode-dl vscode-dl/bin/vscode-dl --help
Download Visual Studio Code and extensions listed in
extensions.yaml into the
web/ subdirectory (screenshot) :
Scan installed extensions and add them to the download list :
More options are available. Use
vscode-dl --help to show them.
Run with Docker
A Dockerfile is provided to run the app into a container, with interpreter and requirements ready-to-use.
# build the image docker build -t vscode_dl . # run the downloader docker run -ti --rm -v /path/to/mirror:/app/web vscode_dl # run the downloader with an alternate extension list docker run -ti --rm -v /path/to/mirror:/app/web -v /path/to/extensions.yaml:/app/extensions.yaml vscode_dl
Installation and update tool
On a offline installation, get.py install or updates Code, downloads and updates the installed extensions from the mirror.
It requires Python 3.5+ and requests that should be installed on all modern Debian/Ubuntu.
curl -skL http://mirror.url:port/get.py | python3 - http://mirror.url:port/
-t permits to provide a minimal set of extensions to be installed. They should be listed in a JSON array.
Example of a file
myteam.json (to be copied in the mirror directory):
The following command wil install or update Code and the extensions listed above.
python3 <(curl -sL http://mirror.url:port/get.py) -t myteam http://mirror.url:port/
The tool :
The tool installs itself into
~/.local/bin/code-tool. This tool can be used to maintenance tasks and install new extensions. You may have to add this directory to your PATH.
# update Code and extensions code-tool -u # display version and mirror url code-tool -V # list available extensions code-tool -l # install an extension code-tool -i <extension.key>
More options are available. Use
code-tool --help to show them.
The development container
Code allows you to develop inside a container. Unluckily, this feature requires Internet connection since the remote server is downloaded when attaching to the container, unless this server is already installed. This is the aim of scripts into container/ subdirectory.
It can be easily adapted to an existing build environment, even for SSH remote development.
As the time of writing (December 2019), only x64, armhf, arm64 and Alpine/amd64 platforms are available.
The Go extension case
The Go extension requires some Go packages to be functional (linter, formatter, code analyzer, etc.). These dependencies are listed into the extension, that tries to install them from Internet. To bypass this step, the sync program (
go get -d commands to download the required packages, and the update tool (
code-tool) installs them in
~/go (default GOPATH). Thus, the GOPATH environment variable should include at least this directory.
- Official Visual Studio Code site
- Official GitHub
- Awesome list for Visual Studio Code
Unlicense aka. Public Domain 😀
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size vscode_dl-1.0.0-py3-none-any.whl (21.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size vscode-dl-1.0.0.tar.gz (19.1 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for vscode_dl-1.0.0-py3-none-any.whl