Introduction¶
In DeepSeek Harness (DSH), handling .py files often involves switching to an external terminal or IDE: changing a line of code, checking the output, and switching windows back and forth. For those accustomed to the VS Code Run/Debug panel, what is missing is a “unified view” where you can “run as soon as you open the file, follow logs in real-time, and set breakpoints when needed.”
dsh-py-runner (maintainer amzingluo, GitHub: amzingluo/dsh-py-runner) is a client-side plugin for DSH: it provides a VS Code-like run/debug console for .py files in the sidebar, with dependencies marked as none in the README. The current package version is 0.2.0, license MIT, and requires Node >= 20.
What is this¶
The plugin takes the selected .py file and manages it as an independent view: the top contains Run/Debug/Stop/Save buttons, and the bottom shows streaming logs; there is also a “Python Runner” tab that keeps the logs of each session uninterrupted when switching files. The backend starts a Python subprocess within the DSH host process; debugging uses the debugpy DAP protocol. It is not a full IDE, but it covers breakpoints, step-through, call stack, variables, and watch expressions.
Core Features¶
Run and Logs¶
- Run immediately on open: The toolbar contains
Run/Debug/Stop/Save;Ctrl+Ssaves,Ctrl+Enterruns,Ctrl+Shift+Enterdebugs. - Colored and streaming stdout/stderr: Output streams to the bottom and auto-scrolls; after the user manually scrolls up, scrolling is no longer forced. Exit codes and execution time are displayed in the toolbar.
- Shared Input: The same input box serves as the program’s stdin; the log bar supports
Clear(only clears display, does not interrupt the process) andCopy.
VSCode-style Debugging¶
- Set breakpoints: Click the line number gutter to set/unset breakpoints. The toolbar during debugging shows
Continue/Step Over/Step Into/Step Out/Pause/Terminate. - Right Panel: Shows the Call Stack, an expandable variable tree, and watch expressions (enter in the watch box to add).
- Exception Handling: Uncaught exceptions stop execution at the error line. Debug and run sessions are mutually exclusive (buttons for one are disabled while the other is active).
- Dependency: The interpreter requires
debugpyto be installed. If missing, the panel provides a one-click “Install debugpy”pip install(output goes to the log, defaults to Aliyun mirror, can be overridden bypipIndex).
Note: Breakpoints and watches are written to localStorage per file and retained after refresh. Debugging capabilities do not currently expose conditional breakpoints, logpoints, multi-thread views, justMyCode, etc. (See README “Known Limitations”).
Editing and Others¶
- Lightweight Editing: Line numbers, Tab is 4 spaces; built-in small Python syntax highlighting (not a full parser, falls back to plain text after ~200k characters).
- Multiple Interpreters: Auto-detects Miniconda / Anaconda / DSH built-in Python / PATH; the toolbar allows switching and remembers your choice.
- Theming: Interface colors follow the host token (
--dsw-alias-*), consistent with light/dark themes.
Installation and Enablement¶
The README lists three installation methods; choose one based on your scenario:
# 1) From GitHub (this is the card you get after it's listed in the market, no npm needed)
dsh plugin --profile desktop add "github:amzingluo/dsh-py-runner"
# 2) From npm (only available if published to npm)
dsh plugin --profile desktop add dsh-py-runner
# 3) Local development: link to source code directory, changes take effect after restarting after editing lib/*.js
dsh plugin --profile desktop add "file:C:/Users/17871/Documents/Obsidian Vault/probability/dsh-py-runner"
Add dsh-py-runner to the profile’s dsh.profile.bundles (README example path is C:\Users\17871\.dsh\profiles\desktop\package.json), then restart DSH.
Installing from GitHub requires git to be installed locally (pnpm uses git ls-remote to resolve the repo); if missing, it may throw ERR_PNPM_GIT_RESOLVE_FAILED. On Windows, you can use winget install Git.Git.
Typical Usage¶
- Install and restart DSH as described above, and confirm the bundle is loaded.
- Open a
.pyfile in the workspace within DSH to enter the plugin view. - Select a Python interpreter in the toolbar (if you need to debug and
debugpyis not installed, click “Install debugpy” first). - After editing,
Ctrl+Sto save, then clickRunorCtrl+Enterto view real-time logs; input in the bottom box when you need stdin. - Set breakpoints in the line number gutter, then click
DebugorCtrl+Shift+Enter; after hitting a breakpoint, check the stack and variables on the right, and use the debug toolbar to step or continue.
Refer to the table in the repository README for a mapping of debug shortcuts and operations (set breakpoint, continue, step, switch stack frame, watch, etc.).
Applicability and Notes¶
Who is it for: Developers who write small scripts, view output, and occasionally use breakpoints as plugins in the DSH desktop profile, without wanting to repeatedly switch terminals or external IDEs.
Security and Permissions: The README states that running/debugging executes under DSH process permissions; file read/write is limited to the current session working directory (requireInside prevents .. escape); runtime POST validates the browser GUI session. It is recommended to read the source code and LICENSE before installation to confirm compliance with your security policy.
Other Limitations (from README): Non-UTF-8 files with declarations like #encoding:gbk can be decoded and displayed as GBK, but the editor is read-only for such files, and writing back might corrupt data. Single file edit limit is 4 MB, single run output limit is about 800k characters; session logs are cleared after DSH restart. Client-side categorized plugins update with DSH, and the interface is based on the current repository documentation.
The community directory SkillHub Plugin Page and GitHub are independent information sources with no official affiliation to DeepSeek / Huanfang; the DSH ecosystem itself is an “everything is a plugin” extension model.
Conclusion¶
dsh-py-runner brings “Open .py → Run or DAP Debug → Real-time logs” into the DSH sidebar and strives to closely mimic the interaction of the VS Code Run/Debug console. To learn more about its capabilities and limitations, see the Directory Page and GitHub README.