# Open VSX mirror (pkg.shecan.ir)

> Mirror of the Open VSX Registry (open-vsx.org), the extension gallery of VSCodium, code-server, Gitpod and other VS Code-compatible editors: the VS Code gallery API (/vscode/gallery, /vscode/asset, /vscode/unpkg; search with POST extensionquery) and the REST API (/api/), with extension files from Open VSX's storage.

- Upstream: open-vsx.org
- Mirror URLs: <https://mirror-openvsx.pkg.shecan.ir/vscode/gallery>, <https://mirror-openvsx.pkg.shecan.ir/api/>
- Clients: vscodium, code-server, curl
- Service status: <https://pkg.shecan.ir/status.json> (key `openvsx`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/openvsx/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/openvsx.json>

## Limitations

- Open VSX only. The Microsoft Visual Studio Marketplace is not mirrored (its terms allow it only for Microsoft's products), so this does not apply to Microsoft's VS Code.
- Cursor and other editors with their own marketplace service cannot be pointed at the mirror.
- itemUrl stays on open-vsx.org: it only opens the extension's web page in a browser.
- Searches and "latest" metadata are cached for 10 minutes, so a just-published version can take that long to appear.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### vscodium: persistent (user- or system-wide configuration)

Configuration file: `%APPDATA%\VSCodium\product.json` or `~/.config/VSCodium/product.json` (checked by hand)

```json
{
  "extensionsGallery": {
    "serviceUrl": "https://mirror-openvsx.pkg.shecan.ir/vscode/gallery",
    "itemUrl": "https://open-vsx.org/vscode/item",
    "extensionUrlTemplate": "https://mirror-openvsx.pkg.shecan.ir/vscode/gallery/{publisher}/{name}/latest",
    "resourceUrlTemplate": "https://mirror-openvsx.pkg.shecan.ir/vscode/unpkg/{publisher}/{name}/{version}/{path}"
  }
}
```

### vscodium: temporary (one command or the current shell; nothing saved)

Run (linux, macos) (checked by hand)

```sh
export VSCODE_GALLERY_SERVICE_URL=https://mirror-openvsx.pkg.shecan.ir/vscode/gallery
export VSCODE_GALLERY_ITEM_URL=https://open-vsx.org/vscode/item
export VSCODE_GALLERY_EXTENSION_URL_TEMPLATE='https://mirror-openvsx.pkg.shecan.ir/vscode/gallery/{publisher}/{name}/latest'
export VSCODE_GALLERY_RESOURCE_URL_TEMPLATE='https://mirror-openvsx.pkg.shecan.ir/vscode/unpkg/{publisher}/{name}/{version}/{path}'
codium --install-extension redhat.vscode-yaml
```

### code-server: temporary (one command or the current shell; nothing saved)

Run (linux, macos)

```sh
export EXTENSIONS_GALLERY='{"serviceUrl":"https://mirror-openvsx.pkg.shecan.ir/vscode/gallery","itemUrl":"https://open-vsx.org/vscode/item","extensionUrlTemplate":"https://mirror-openvsx.pkg.shecan.ir/vscode/gallery/{publisher}/{name}/latest","resourceUrlTemplate":"https://mirror-openvsx.pkg.shecan.ir/vscode/unpkg/{publisher}/{name}/{version}/{path}"}'
code-server --install-extension rust-lang.rust-analyzer
```

### curl: temporary (one command or the current shell; nothing saved)

Run (linux, macos)

```sh
curl -fLo redhat.vscode-yaml.vsix "$(curl -fsSL https://mirror-openvsx.pkg.shecan.ir/api/redhat/vscode-yaml/latest | grep -o '"download":"[^"]*"' | cut -d'"' -f4)"
```
