跳过主要内容
N

dsh-jupyterlab

nkuhan123/dsh-jupyterlab

DSH 的 JupyterLab 风格 notebook:代码与输出左右分栏并可拖动,长 cell 滚动时输出贴住视口,支持 Jupyter 快捷键(a/b/dd、m/y、Shift+Enter 与 Ctrl+Enter 区分)、左侧剪刀删除 cell、py/md 标签切换代码与 Markdown。基于 @beihaizb/dsh-notebook 的修改版:两者注册同一批 nb_* 工具,不能与上游同装,装前请先卸载原版;所选 Python 内核需安装 ipykernel、jupyter_client 与 nbformat。

安装

dsh plugin --profile web add github:nkuhan123/dsh-jupyterlab

README

dsh-jupyterlab

license

A JupyterLab-style notebook for DeepSeek Harness. A real, persistent ipykernel the agent can read, edit and run — with a front end that behaves like JupyterLab: code on the left, figures on the right, Jupyter keyboard shortcuts, and Markdown cells.

This is a modified fork of @beihaizb/dsh-notebook by beihzb (MIT). The kernel sidecar, the nb_* agent tools, .ipynb save/load and the cell UI are upstream work. This package keeps all of it and adds the features below, as a single self-contained plugin (the upstream sources are vendored, so dsh plugin add installs everything).

What this fork adds

  1. Split view (code | output). Every code cell renders as two columns: the editor on the left, its outputs — figures, stdout, DataFrames, tracebacks — on the right. A draggable divider resizes the columns and the ratio is remembered. The toolbar button ⇔ Split / ⇕ Inline returns to the classic stacked layout.
  2. Outputs stay in sight. The output pane is bottom-aligned and sticks to the viewport while you scroll a long cell, so a figure you just rendered is already on screen instead of being stranded at the top of the cell.
  3. Jupyter keyboard shortcuts. Press Esc to leave editing (command mode), then a / b insert a cell above / below, dd deletes, Enter edits, ↑ ↓ (or k j) move, m / y switch the cell to Markdown / Code, and Ctrl+Enter / Shift+Enter / Alt+Enter run. While editing, Tab accepts the completion popup (and still indents when none is open). ? opens the shortcut list.
  4. Cell type and one-click delete. A ✂ scissors in the gutter deletes the cell, and a py / md chip shows and switches the cell type. Markdown cells render ## headings, are edited by double-click, and can be folded like code cells.
  5. + MD in the toolbar inserts a Markdown cell (the existing + Cell now selects and focuses what it inserts).
  6. Left file bar (JupyterLab-style). The saved .ipynb files in the working directory are listed down the left side; click one to open it. The toolbar 🗂 Files button shows/hides the bar.
  7. Right figure viewer. Click any output figure — or any image path printed in the output, such as Saved: ...\fig.tif — and it opens in a resizable panel on the right (fit / actual size / fullscreen / close) instead of a modal that covers the notebook. .tif / .tiff frames are converted to PNG with the kernel's Pillow and cached, so saved TIFFs preview too.

Everything else — persistent kernel, agent tools, .ipynb round-trip, kernel picker, tqdm progress bars, clickable tracebacks, long-output folding, hybrid-CPU hint, EN/中文 UI — is upstream and unchanged.

Install

From the GitHub repository (this is what the plugin market uses):

dsh plugin --profile desktop add github:NKUHan123/dsh-jupyterlab

Or from the prebuilt tarball attached to the latest GitHub Release (no build step):

dsh plugin --profile desktop add file:<path-to>/dsh-jupyterlab.tgz  # prebuilt tarball from the latest GitHub Release

Then restart DeepSeek Harness. A Notebook tab appears in the session.

The package ships its compiled lib/ and the Python driver, so there is nothing to build at install time (no prepare / install scripts — pnpm has no build to approve).

Don't install this next to @beihaizb/dsh-notebook. Both register the same nb_* tools; this fork is a superset, so remove the original first:

dsh plugin --profile desktop remove @beihaizb/dsh-notebook

The Python environment you pick as kernel needs ipykernel, jupyter_client and nbformat.

Keyboard

ModeKeyAction
commandEnteredit the selected cell
commandEscback to command mode
commanda / binsert a cell above / below
commandd ddelete the selected cell
command↑ ↓ / k jselect previous / next cell
commandm / yswitch to Markdown / Code
commandCtrl+Enterrun, stay on the cell
commandShift+Enterrun, move to the next cell
commandAlt+Enterrun, insert a cell below
command?shortcut list
editingCtrl+Enter / Shift+Enter / Alt+Entersame run modes
editingTabaccept completion (indent when nothing is open)
editingEscleave editing

Tools (unchanged from upstream)

nb_new / nb_open / nb_save / nb_get / nb_context / nb_list / nb_list_vars / nb_inspect_object / nb_add_cell / nb_delete_cell / nb_move_cell / nb_edit_cell / nb_edit_and_run_cell / nb_cell_history / nb_revert_cell / nb_error_context / nb_run_cell / nb_run_all / nb_apply_suggestion / nb_kernel_restart / nb_kernel_restart_and_clear / nb_kernel_interrupt / nb_kernel_list / nb_kernel_select / nb_clear_outputs / nb_set_cwd

nb_add_cell also accepts before (insert above a given cell) in this fork.

Compatibility

DSH 0.1.x-rc and 0.2.x-rc (@deepseek-ai/dsh-tools: ^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1). Developed and tested against DSH 0.2.1-rc.5 on Windows with a conda ipykernel.

License & attribution

MIT. Original work Copyright (c) 2025-present beihzb — @beihaizb/dsh-notebook; modifications Copyright (c) 2026 dsh-jupyterlab contributors. See LICENSE.

相关插件