メインコンテンツへスキップ
G

dsh-py-nav

gipbear/dsh-py-nav

Python code navigation via ty, basedpyright, or pyright with Go to Definition, Find References, Hover, and Outline across local, WSL, and SSH/dsh-remote workspaces. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

インストール

dsh plugin --profile web add github:gipbear/dsh-py-nav

README

dsh-py-nav

Python code navigation plugin for DeepSeek Harness (DSH) — brings VS Code-style Ctrl+Click / F12 Go to Definition, Shift+F12 Find All References, Hover type signatures & docstrings, Document Symbols, and Alt+←/→ history to local (Ubuntu/Linux/macOS/Windows), WSL, and SSH / dsh-remote Python workspaces.

Features

  • Works directly inside dsh-remote file viewer & IDE mode: Automatically attaches to dsh-remote's .py/.pyi editor (both read-only highlight view and edit mode) and auto-reads $DSH_HOME/remote-workspaces/*/*/.dsh-remote-meta.json so multi-host / multi-repo SSH projects need zero duplicate setup.
  • Native DSH .py/.pyi Document Preview (Monaco Editor): Replaces static read-only previews with an offline-bundled Monaco Editor wired to persistent Python LSP.
  • Dedicated Python Nav Sidebar Tab: Browse and navigate local, WSL, or SSH Python repositories directly from DSH's right sidebar.
  • Zero-config Local Linux / Ubuntu mode: When running directly on Ubuntu / Linux, defaults to transport: 'local' and automatically discovers & switches Python project roots (pyproject.toml, pyrightconfig.json, ty.toml, setup.py, .venv, .git).
  • Dual-carrier compatible: Registers /api/py-nav on ctx.connection.fetch (Electron Desktop IPC + Web HTTP) with webServer fallback.
  • Fast persistent Python LSP: Auto-detects ty (Astral's Rust Python LSP), python3 -m ty, basedpyright-langserver, or pyright-langserver across .venv, ~/.local/bin, uv tools, pipx, pyenv, conda, and system PATH.
  • Smart Environment Diagnostics & One-Click Install: Proactively probes the target host (local / WSL / SSH) when opening .py files. If no Python LSP is installed, the status badge alerts you (⚠ PyNav: 缺 LSP) and opens an interactive setup card tailored to the host's actual tools (uv, pip --user, auto --trusted-host for internal http:// PyPI mirrors, or npm) with a one-click Install button and full PATH/candidate probe details.

Shortcuts

ShortcutAction
Ctrl+Click / F12Go to Definition (same file, cross-file, or external .venv / typeshed)
Shift+F12Find All References across the workspace
Ctrl + HoverType signature & docstring tooltip
Alt+Left / Alt+RightNavigate Back / Forward
EscDismiss References drawer or Definition picker

Prerequisites (on the host running Python)

Install at least one Python LSP server (recommended: ty, no Node.js required):

uv tool install ty
# or without uv:
pip install --user ty
# or with an internal http:// pip mirror:
pip install --user --trusted-host <mirror-host> ty

If the target host doesn't have one installed yet, dsh-py-nav detects the host's available package manager (uv / pip3 / pip / python3 -m pip / npm) and pip mirror settings, and offers a one-click Install action directly inside the UI.

You can also point server in ~/.dsh/py-nav.json directly to an executable path (e.g. "server": "/opt/tools/bin/ty" or "server": "~/.local/bin/ty").

Build & Pack

npm install
npm run typecheck
npm run build
npm pack --pack-destination dist

Install into DSH

# DSH Web (Ubuntu / Linux / macOS / Windows)
dsh plugin --profile web add dsh-py-nav

# Or install directly from a GitHub Release tarball
dsh plugin --profile web add https://github.com/Gipbear/dsh-py-nav/releases/download/v0.2.1/dsh-py-nav-0.2.1.tgz

In DSH Desktop, open Plugins and install dsh-py-nav, then restart DSH.

Settings are persisted to ~/.dsh/py-nav.json.

Integration Tests

npm run test:probe   # Environment probe, http:// trusted-host, direct server path
npm run test:local   # Local Ubuntu/Linux zero-config + Fetch API
npm run test:wsl     # Windows -> WSL Ubuntu transport
npm run test:ssh     # Windows -> OpenSSH + dsh-remote mirror auto-binding

関連プラグイン