Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spagettikod/vsix
Visual Studio Code Extension Marketplace CLI
https://github.com/spagettikod/vsix
cli golang visual-studio-code vscode vscode-extension
Last synced: 5 days ago
JSON representation
Visual Studio Code Extension Marketplace CLI
- Host: GitHub
- URL: https://github.com/spagettikod/vsix
- Owner: spagettikod
- License: mit
- Created: 2020-11-23T20:56:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-29T09:01:16.000Z (9 months ago)
- Last Synced: 2024-11-15T18:37:42.984Z (about 1 month ago)
- Topics: cli, golang, visual-studio-code, vscode, vscode-extension
- Language: Go
- Homepage:
- Size: 3.9 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vsix
Host your private [Marketplace](https://marketplace.visualstudio.com/) by downloading and serving extensions to Visual Studio Code in your own environment. The tool can be useful when working in air gapped environments but you still want access to Visual Studio Code extensions.## Installation
vsix is distributed as a single binary file. The current release support the operating systems and architectures below.macOS (Apple Silicon)
```shell
curl -OL https://github.com/spagettikod/vsix/releases/download/v2.2.0/vsix2.2.0.macos-arm64.tar.gz
sudo tar -C /usr/local/bin -xvf vsix2.2.0.macos-arm64.tar.gz
```Linux
```shell
curl -OL https://github.com/spagettikod/vsix/releases/download/v2.2.0/vsix2.2.0.linux-amd64.tar.gz
sudo tar -C /usr/local/bin -xvf vsix2.2.0.linux-amd64.tar.gz
```Docker
```docker
docker run --rm -it spagettikod/vsix info golang.Go
```You can bind mount folders to `/data` in the container when working with downloaded extensions.
```docker
docker run --rm -it \
-v $(pwd):/data \
spagettikod/vsix update /my_extensions_to_sync
```## Getting Started
Create a folder where you store downloaded extensions.```
mkdir extensions
```Add a few extensions you would like to have available off-line.
```
vsix add --data extensions golang.Go gruntfuggly.todo-tree
```Start your own marketplace serving the extensions you added above.
```
vsix serve --data extensions https://vsix.myserver.com:8443/_apis/public/gallery myvsix.cert myvsix.key
```If you run your own DNS you can hijack `marketplace.visualstudio.com` and point it to your local server or you can modify `product.json` in your Visual Studio Code installation. The former has the benefit of not having to modify your local Visual Studio Code installation while the latter one needs to be reapplied after each update of Visual Studio Code.
1. Open `product.json`. On macOS (if Visual Studio Code is installed in the Applications folder) this file is located at `/Applications/Visual Studio Code.app/Contents/Resources/app/product.json`.
1. Find the `extensionGallery` block and edit the `serviceUrl` to point to your server. For example, using the example above `https://vsix.myserver.com:8443/_apis/public/gallery`:
```json
...
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
},
...
```
1. Restart Visual Studio Code and start using extensions from your own marketplace.## Update extensions
To update and fetch the latest version of the extensions on your local marketplace you run the update command.```
vsix update --data extensions
```This will check for newer versions and download the most current one of your extensions if needed. It will only download the latest version, not all versions inbetween your latest version and the latest version at Visual Studio Code Marketplace.
## Multiple platforms
Some extensions support multiple platforms. If you don't have or use all platforms you can limit which platforms you want to add. When you run the `update`-command it will only update those platforms that were added. If you want to add a platform later on you can add it by running the `add` command again.This example will add an extension limiting it to the `darwin-arm64` platform.
```shell
vsix --data extensions add --platforms darwin-arm64 redhat.java
```When adding multiple extensions and limiting to certain platforms you must remember to include the `universal` platform, which most extensions belong to. Otherwise these will not be added. A good rule of thumb is to always add all platforms you want to support, regardless of extension.
```shell
vsix --data extensions add --platforms universal,darwin-arm64,linux-amd64,win32-arm64 golang.Go redhat.java
```You can use the `info` sub command to check which platforms are supported for a certain extension.
## Pre-release
Some extensions provide pre-release versions. These can in some cases be updated quite frequently. By default pre-release versions will not be downloaded by the `add` and `update` command. If you want an update to include pre-releases
```shell
vsix --data extensions --pre-release golang.Go ms-python.python
```