Scan your whole stack
Are you using gh-htmlpreview?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.0
gh-htmlpreview was last scanned on 27 Nov 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.0 LATEST | 27 Nov 2026 | No rules fired |
Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A GitHub CLI extension or a standalone Python CLI tool for serving a preview of an HTML file from a GitHub repository. Pass a URL for a file in a GitHub repository, and it will open your browser to a local HTTP server that serves the file and its relative assets (CSS, JavaScript, images, etc.). You can also follow links to other pages in the repository. All files are handled in memory, so no need to download files or clean them up afterwards. It can authenticate with GitHub to work with either public or private repos.
Handy for browsing things like:
[!IMPORTANT] Security: The previewed page's JavaScript runs in your browser like any website's. Only preview pages from repositories you trust as much as a website you'd visit. See the Security section for additional discussion.
[!NOTE] What this tool does is similar to htmlpreview.github.io, but it runs locally and can authenticate with your GitHub CLI login or a token. It does not route content through a third-party website, and it works for private repos. We are not affiliated in any way with htmlpreview.github.io.
With the GitHub CLI installed, run:
gh extension install jayqi/gh-htmlpreview
The extension needs uv or Python 3.11 or newer on your PATH. With uv, it finds or downloads a suitable Python itself.
The extension tracks the main branch; update it with gh extension upgrade htmlpreview. To stay on a release instead, install with --pin, such as --pin v0.1.0.
As a Python package from PyPI, with uv:
uvx gh-htmlpreview URL
or installed as a tool:
uv tool install gh-htmlpreview
It has no dependencies beyond the Python standard library.
Copy the URL of an HTML file from GitHub and pass it in:
gh htmlpreview https://github.com/jayqi/gh-htmlpreview/blob/main/demo/index.html
Serving jayqi/gh-htmlpreview@a64dfb7:demo/index.html at http://127.0.0.1:53817/demo/index.html
Shutting down after 0:30:00 without requests. Press Ctrl-C to stop.
The branch or tag is resolved to a commit when it starts, and every file in the session comes from that commit. The server stops after an idle timeout without requests (by default 30 minutes, configurable with -t/--timeout), or when you press Ctrl-C.
A private repository works the same way once you're signed in to the GitHub CLI:
gh auth login
gh htmlpreview https://github.com/my-org/private-repo/blob/main/reports/summary.html
Branch names containing / work too:
gh htmlpreview https://github.com/my-org/my-repo/blob/feature/new-report/docs/report.html
To use the standalone Python CLI installed from PyPI, the command is gh-htmlpreview instead of gh htmlpreview.
For a shorter command, set a gh alias:
gh alias set hp htmlpreview
gh hp https://github.com/jayqi/gh-htmlpreview/blob/main/demo/index.html
https://github.com/{owner}/{repo}/blob/{ref}/{path}https://github.com/{owner}/{repo}/raw/{ref}/{path}https://raw.githubusercontent.com/{owner}/{repo}/{ref}/{path}{ref} can be a branch, a tag, or a full commit SHA, as in GitHub's permalinks.
The whole repository at that commit is servable from the HTTP server's root, so relative links (../index.html) and root-relative links (/docs/other.html) resolve the way they would on GitHub Pages serving from the repository root. Following links from the previewed page to other HTML files in the repository works as a result, but it's best effort: a link to a directory needs a trailing slash (articles/) to serve its index.html.
Root-relative links assume the site's root is the repository's root. A site built into a subdirectory, such as site/ or docs/_build/html/, works only if its links are relative. Links that leave off both the trailing slash and .html (/about) won't resolve.
This tool authenticates with any GitHub token that can read the repository, such as the one from gh auth login or a personal access token. It checks token sources in the following order:
GH_TOKEN environment variableGITHUB_TOKEN environment variablegh auth token, if the GitHub CLI is installed and signed inIf you create a personal access token for this, a fine-grained token needs the "Contents: Read-only" permission, and a classic token needs the repo scope for private repositories.
Without a token, public repositories still work. Files come from raw.githubusercontent.com, and only resolving the branch, tag, or commit uses the GitHub API, which allows 60 unauthenticated requests per hour.
The tool will automatically open your browser to the served page. You can configure a browser command, and the configuration source follows the GitHub CLI's behavior with the following order:
GH_BROWSER environment variablegh config get browserBROWSER environment variableUse -n/--no-browser to print the URL without opening a browser.
In an SSH session, or on Linux without a display, the default browser isn't opened. Over SSH, it prints the port-forwarding command to run on your own machine, such as ssh -L 53817:127.0.0.1:53817 HOST. Forward to the same port number and open the printed URL as is, with 127.0.0.1 rather than localhost, or the server refuses the request. You can use -p/--port to specify a port in order to keep the same port between sessions.
The previewed page's JavaScript runs in your browser like any website's. Only preview pages from repositories you trust as much as a website you'd visit. Because browsers don't separate cookies by port, that JavaScript can read and set cookies of other apps served on 127.0.0.1, other than HttpOnly ones. Storage the page leaves behind, such as localStorage, can also be seen by later web applications served at the same port.
This tool takes the following security precautions:
127.0.0.1 only. It does not listen on 0.0.0.0, which would allow other devices to connect.Host header 127.0.0.1:{port}, which blocks DNS-rebinding attacks from reading repository content through the server. It also refuses localhost, in order to keep the cookies of other apps running on localhost isolated from the previewed page.Sec-Fetch-Site header that browsers send. This includes other apps served on 127.0.0.1.usage: gh htmlpreview [-h] [-t DURATION] [-p PORT] [-n] [--version] URL
Preview an HTML file from a GitHub repository in your browser.
positional arguments:
URL GitHub URL of the file to preview.
options:
-h, --help show this help message and exit
-t, --timeout DURATION
Time to keep the server alive after the most recent request,
such as '90s', '10m' or '1h30m'. A number without a unit is
seconds. (default: 30m)
-p, --port PORT Port to use. (default: 0, chosen by the operating system)
-n, --no-browser Print the URL without opening a browser.
--version Show version and exit. Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.