Skip to content
dsh.fish
Bundle

dsh-fulltext-search

DSH web plugin: full-text content search for the better-sidebar file manager — a search tab that greps file CONTENTS in the session working directory and opens matches in the sidebar editor

Source
termanli
License
Apache-2.0
Updated
Updated 6 days ago

Readme

# dsh-fulltext-search

DSH(DeepSeek Harness)Web GUI 插件:在侧边栏文件管理([dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar))中按**文件内容**全文搜索当前会话工作目录,返回 `文件 + 行号 + 匹配行预览`,点击结果即可在编辑器中打开文件。

支持正则表达式、区分大小写、全字精确匹配、智能大小写与 include/exclude 范围过滤。系统装有 [ripgrep](https://github.com/BurntSushi/ripgrep) 时自动使用(与 VSCode 搜索同款引擎,性能最佳);未安装则回退内置 JS 引擎,功能一致。

## 安装

前置:已安装 DSH 与 dsh-better-sidebar(`dsh web` 侧边栏可见)。

> **安装顺序**:先装 dsh-better-sidebar,再装本插件;升级时同样先升级 dsh-better-sidebar。若未检测到 better-sidebar 的 `registerTab` 服务,本插件会打印中文警告并跳过 tab 注册(不会崩溃)。

```sh
dsh plugin --profile web add link:<本仓库路径>
# 例如:dsh plugin --profile web add link:D:\git\dsh-fulltext-search
```

装完需**重启 DSH**,并**硬刷新浏览器**(Ctrl/Cmd+Shift+R)。

可选:安装 [ripgrep](https://github.com/BurntSushi/ripgrep) 以启用最快的搜索引擎(如 `winget install BurntSushi.ripgrep.MSVC`、`brew install ripgrep` 或 `apt install ripgrep`);未安装时自动使用内置 JS 引擎,功能一致。

## 安全

- 搜索根**恒为服务端会话记录的工作目录**(`sessions.get(sessionId).header.cwd`),请求体中的 `cwd` 字段一律忽略——伪造的 `sessionId` 无法借任意绝对路径把全文搜索扩大到宿主机其他可读目录。
- 会话不存在 → `404 session-not-found`;会话无工作目录 → `400 no-session-cwd`;两者都在任何搜索执行前被拒绝,不存在 `process.cwd()` 兜底。

## 使用

1. 打开侧边栏,点 `+` → 选择「全文搜索」(或直接点击放大镜图标)
2. 输入关键字并回车;可用 `.*`(正则)、`Aa`(区分大小写)、`Ab`(全字匹配)按钮与「智能大小写」开关调整匹配方式
3. 点击结果行 → 文件在编辑器 tab 中打开;点击文件名 → 打开文件

## 许可证

本项目基于 [Apache License 2.0](LICENSE) 发布。

Install

dsh plugin --profile web add github:termanli/dsh-fulltext-search

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source