jupyterlab_xdg_open_url_extension
Open a URL from a JupyterLab terminal. On a headless JupyterLab server there is no browser, so a terminal xdg-open <url> just fails. This extension catches that emission and turns it into a JupyterLab notification with an Open button that opens the URL in your real browser tab - instantly.
It does one thing, quietly. Run jlab-xdg-open <url> in a terminal (or let any tool that calls xdg-open do it for you), and the link comes to you.
Features
- Terminal-native - any URL emitted with
jlab-xdg-openin a terminal becomes a notification, no copy-paste out of the terminal - Invisible marker - the emitter prints a hidden OSC escape sequence; nothing clutters your terminal output
- Instant delivery - uses
jupyterlab_notifications_extensionwith the--nowflag (immediate WebSocket push), so the notification appears the moment the link is emitted, on every open tab - One-click open - the notification's Open button opens the URL in a new browser tab
- Frontend + emitter only - no server extension, no endpoints, no configuration to manage
Requirements
- JupyterLab >= 4.6
jupyterlab_notifications_extension(installed automatically as a dependency)
Install
pip install jupyterlab_xdg_open_url_extension
Usage
Emit a URL from any JupyterLab terminal:
jlab-xdg-open https://example.com
A notification appears instantly with an Open button that opens the URL in a new browser tab.
Installing the extension also puts an xdg-open on your PATH ahead of the system one, so any tool that spawns xdg-open - claude, gh, git, OAuth device flows - triggers the notification automatically, no alias needed. On a headless server the system xdg-open cannot open a browser anyway; this shadow is removed when you uninstall the package.
Completing an OAuth login on a headless host
Opening the browser is only half of an OAuth login. Tools like claude, gh, and codex also start a short-lived callback server on the host's localhost:PORT and expect the browser to redirect the authorization code back to it. On a headless host the browser runs on your machine, so that redirect lands on your localhost, not the host - the code never arrives. Three practical ways close that gap.
- Token or API key (simplest, no callback) - authenticate once elsewhere and carry the token in; for
claude, runclaude setup-tokenand set it in the host env, or setANTHROPIC_API_KEY- best for containers and CI - Paste the code (Claude Code v2.1+) - authenticate in the browser this extension opened, then paste the code the success page shows straight into the
claudeterminal, no reachable callback needed - Replay the callback - copy the
http://localhost:PORT/callback?code=...URL from the browser (the page fails to load, but the URL is in the address bar) and replay it inside the container:
jlab-xdg-open --callback 'http://localhost:45923/callback?code=...&state=...'
--callback makes a single loopback request to the tool's own waiting server - it starts no service, only replays localhost/127.0.0.1 URLs, and does not follow redirects.
Uninstall
pip uninstall jupyterlab_xdg_open_url_extension
Metadata
Release files for jupyterlab-xdg-open-url-extension 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jupyterlab_xdg_open_url_extension-0.1.8.tar.gz | 439.0 kB | Without provenance | Details for jupyterlab_xdg_open_url_extension-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jupyterlab_xdg_open_url_extension-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for jupyterlab_xdg_open_url_extension-0.1.8-py3-none-any.whl |
Total release size: 470.9 kB
Release files / jupyterlab_xdg_open_url_extension-0.1.8.tar.gz
| Download URL | jupyterlab_xdg_open_url_extension-0.1.8.tar.gz |
|---|---|
| Size | 439.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6aef73fc4490b3b666422e332dc785d8a9e8faa7025785b8aa210cf0a7f10320
|
|
BLAKE2b-256 checksum How to use checksums |
4913bbc201fce8e268799d91dddef28916595ce20ea0c59fd8575b78a370a36d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / jupyterlab_xdg_open_url_extension-0.1.8-py3-none-any.whl
| Download URL | jupyterlab_xdg_open_url_extension-0.1.8-py3-none-any.whl |
|---|---|
| Size | 31.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6afdfa0e1e80b45521523eb1a6b128e20c624b1e77e1636d3acddb140e3975f
|
|
BLAKE2b-256 checksum How to use checksums |
77f766f4d40baa0c31c8a39639071d2b1389ad36ac8c43649bd40e184cfdb83c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Security for jupyterlab-xdg-open-url-extension 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.