Skip to main content

jupyterlab_xdg_open_url_extension

GitHub Actions npm version PyPI version Total PyPI downloads JupyterLab 4 Brought To You By KOLOMOLO Donate PayPal

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-open in 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_extension with the --now flag (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, run claude setup-token and set it in the host env, or set ANTHROPIC_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 claude terminal, 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.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyterlab-xdg-open-url-extension 0.1.11
File Size Uploaded Provenance Actions
jupyterlab_xdg_open_url_extension-0.1.11.tar.gz 398.4 kB Without provenance Details for jupyterlab_xdg_open_url_extension-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlab-xdg-open-url-extension 0.1.11
File Interpreter ABI Platform Actions
jupyterlab_xdg_open_url_extension-0.1.11-py3-none-any.whl Python 3 none any Details for jupyterlab_xdg_open_url_extension-0.1.11-py3-none-any.whl

Total release size: 430.3 kB

Release files / jupyterlab_xdg_open_url_extension-0.1.11.tar.gz

Download URL jupyterlab_xdg_open_url_extension-0.1.11.tar.gz
Size 398.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e0f22cf67c998c8b10edb11af5dc5f51fc937f85a4a57c64cf437243db1b3852
BLAKE2b-256 checksum
How to use checksums
9e68145d3a67b64f9cb3e0bee85f234c2bbfccaab149567fb33acf276ad11537
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.11-py3-none-any.whl

Download URL jupyterlab_xdg_open_url_extension-0.1.11-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f4f0436672552844c82a70c6a711770ec652215d571924d48276bfb667b2bf8
BLAKE2b-256 checksum
How to use checksums
a1a16f486a4a82349380a09791c072ecdf93c026799fc585ecf3161b1060dfce
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.11

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page