Skip to content

Add URI-based programmatic launch for Protein Viewer from CLI/Python#42

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-cli-launch-feature
Draft

Add URI-based programmatic launch for Protein Viewer from CLI/Python#42
Copilot wants to merge 3 commits into
mainfrom
copilot/add-cli-launch-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

This change adds a programmatic way to open one or more local structure files in Protein Viewer without Explorer selection, enabling shell/Python-driven workflows. It introduces a stable VS Code deep-link entrypoint and aligns command handling for single- and multi-file invocation.

  • Programmatic launch surface

    • Register onUri activation and a URI handler in the extension.
    • Support deep links of the form:
      • vscode://ArianJamasb.protein-viewer/open?file=<path-or-uri>&file=<path-or-uri>
    • Parse repeated file query parameters and open them in a new Protein Viewer tab.
  • Command path hardening

    • Update protein-viewer.activateFromFiles to handle both:
      • Explorer multi-select (selectedFiles)
      • Single-file invocation (file_uri fallback)
  • Documentation updates

    • Add concise CLI/Python usage examples in README for constructing and opening deep links with multiple files.
  • Focused parsing coverage

    • Add targeted tests for URI parsing behavior (/open path handling and repeated file params).
import urllib.parse, webbrowser

files = ["/abs/a.pdb", "/abs/b.cif"]
query = "&".join(f"file={urllib.parse.quote(f)}" for f in files)
webbrowser.open(f"vscode://ArianJamasb.protein-viewer/open?{query}")

Copilot AI linked an issue May 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add CLI option to launch protein viewer from files Add URI-based programmatic launch for Protein Viewer from CLI/Python May 22, 2026
Copilot finished work on behalf of a-r-j May 22, 2026 20:27
Copilot AI requested a review from a-r-j May 22, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launching from CLI or python

2 participants