Civitasv/dsh-plugin-open-editor ↗★ 1

dsh-plugin-open-editor

Open the current DSH project in your favorite editor — one click for the default (VS Code), a picker for Cursor, Windsurf, Trae, JetBrains IDEs, Sublime Text, the OS file manager, and custom commands. 核心用途是快速在本地编辑器中打开当前DSH会话的工作目录。适合需要频繁切换到本地IDE进行代码编辑和项目管理的开发者,使用前提是会话必须拥有有效的工作目录。

Package
dsh-plugin-open-editor
Compatibility
Unverified
Version
0.1.0
License
MIT
Last updated
Aug 16, 2026

Other repositories with this package name

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗

使用

操作效果
点击「在编辑器中打开」用默认编辑器(默认 VS Code)打开当前会话的项目目录
点击右侧箭头展开编辑器选择器,选择任意已安装的编辑器 / 文件管理器
菜单底部显示打开结果(成功 / 失败原因)

当前项目 = 当前会话的工作目录(cwd)。没有工作目录的会话不显示该按钮。

配置

编辑 ~/.dsh/profiles/web/cordis.patch.yml 中该插件的 config:

- insert:
    - id: open-editor
      name: dsh-plugin-open-editor
      config:
        defaultEditor: vscode        # 点击主体按钮使用的编辑器(id)
        routePath: /open-editor/open   # 打开请求路由(一般无需改动)
        statusPath: /open-editor/editors  # 编辑器目录路由(一般无需改动)
        extraArgs: []                # 追加到每个内置编辑器命令后的参数
        allowedRoots: []             # 非空时,仅允许打开这些目录下的项目
        customEditors:               # 自定义编辑器(追加到内置列表)
          - id: my-editor
            label: My Editor
            command: ["C:\\Program Files\\My Editor\\editor.exe", "--folder", "{path}"]
  • defaultEditor:主体按钮使用的编辑器 id(内置 id 见上表,也可以填自定义 id)。
  • customEditors:command[0] 是可执行文件(PATH 名或绝对路径);后面的元素按原样 作为参数,字面量 {path} 会被替换为目标目录;没有 {path} 时自动把目录追加到最后。
  • allowedRoots:安全开关。默认允许打开任意存在的目录(本机工具);填写后,只有 这些目录(及子目录)能被打开,适合把 DSH 暴露到局域网时收紧权限。
  • extraArgs:给所有内置编辑器追加参数,例如 ["--new-window"] 让 VS Code 总是 新开窗口。