Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "duplicate-file-finder",
"version": "0.1.0",
"description": "Find files that are exact copies of each other in your folders — compared by size and SHA-256 content hash, never by name — and see how much space they waste. One copy per group is kept automatically (the original-looking name, not “copy” or “(1)”), you can change which one, then export a report or move the extra copies into a review folder. Nothing is ever deleted, and moved files can be restored. Runs locally; no API keys.",
"description_i18n": {
"en": "Find files that are exact copies of each other in your folders — compared by size and SHA-256 content hash, never by name — and see how much space they waste. One copy per group is kept automatically (the original-looking name, not “copy” or “(1)”), you can change which one, then export a report or move the extra copies into a review folder. Nothing is ever deleted, and moved files can be restored. Runs locally; no API keys.",
"zh-CN": "找出文件夹里内容完全相同的文件——按大小和 SHA-256 内容哈希比对,不看文件名——并算出浪费了多少空间。每组自动保留一份(像原件的那个,不带“副本”“(1)”),你可以改选保留哪个,然后导出报告,或把多余副本移到待删文件夹。绝不直接删除文件,移走的文件还能放回原处。在本地运行,无需 API 密钥。"
},
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"keywords": [
"duplicates",
"duplicate files",
"dedupe",
"sha256",
"clean up",
"disk space",
"重复文件",
"查重",
"去重",
"清理",
"副本"
],
"skills": "skills",
"mcpServers": {
"duplicate-file-finder": {
"type": "stdio",
"command": "node",
"args": [
"${ZCODE_PLUGIN_ROOT}/dist/server.mjs"
],
"cwd": "${ZCODE_PROJECT_DIR}",
"timeoutMs": 900000,
"env": {
"ZCODE_WORKSPACE_ROOT": "${ZCODE_PROJECT_DIR}"
}
}
},
"ui": {
"surfaces": [
{
"id": "editor",
"title": {
"zh-CN": "重复文件查找",
"en-US": "Duplicate File Finder"
},
"icon": "copy",
"server": "duplicate-file-finder",
"resourceUri": "ui://duplicate-file-finder/panel.html",
"availability": "session"
}
]
}
}
21 changes: 21 additions & 0 deletions external_plugins/duplicate-file-finder/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Penova

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
52 changes: 52 additions & 0 deletions external_plugins/duplicate-file-finder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Duplicate File Finder

Find files that are exact copies of each other in your folders — compared by size and SHA-256 content hash, never by name — and see how much space they waste. One copy per group is kept automatically (the original-looking name, not “copy” or “(1)”), you can change which one, then export a report or move the extra copies into a review folder. Nothing is ever deleted, and moved files can be restored. Runs locally; no API keys.

## Features

- **Exact matches only**: files are grouped by size, then by SHA-256 of their content, so “same name, different content” is never a false match and renamed copies are still found.
- **Which copy to keep**: smart (no “copy / 副本 / (1)” in the name, shortest path), oldest, newest, or prefer a folder you name; change any group with the Keep checkbox.
- **Space saved**: groups are sorted by wasted space; the summary shows how much you would free.
- **Safe clean-up**: extra copies are moved into duplicate-file-finder/<project>/review/ with their original paths, never deleted; “Restore moved copies” puts them back. Groups with no kept file are blocked.
- **Filters**: skip tiny files and extensions like .DS_Store; empty files are ignored.
- **Panel**: pick input files, adjust settings, see problems, edit any cell in the table, preview the result and export — all in the ZCode side panel. Edits are saved in `duplicate-file-finder/<project>.project.json` and kept until you re-open the inputs.

## Usage

Ask the agent in ZCode Desktop:

- "Find duplicate files in 下载/ and 旧电脑备份/"
- "Keep the copies inside 合同/ and move the rest to review"
- "Undo — put the moved copies back"

## Tools

| Tool | Purpose |
|---|---|
| `dupes_open` | Scan workspace folders and group byte-identical files. Opens the panel |
| `dupes_edit` | Change settings, edit cells by row, add or remove rows |
| `dupes_status` | Show the current rows, issues and summary |
| `dupes_export` | Write duplicates.csv and duplicates.html, or move extra copies into a review folder (with moved.csv); restore moves them back |

Output goes to `duplicate-file-finder/<project>/` in the workspace.

## Scope (v0.1)

- Exact duplicates only; similar photos (resized or re-encoded) are not matched in v0.1.
- Inside the workspace, up to 5 folders and 20,000 files per scan.
- It never deletes; empty the review folder yourself when you're sure.

## Privacy, network and files

- **Everything runs locally.** No network, no uploads, no API keys or accounts.
- Reads only the files you choose. Writes only the `duplicate-file-finder/` folder in the workspace; it also moves extra copies into that folder, but only when you click “Move extra copies to review” (and back with “Restore”). No hooks.

## Build and test (developers)

- Source: `ui-plugins/duplicate-file-finder/`.
- Build: `pnpm install --frozen-lockfile && pnpm build`, then add `dist/local-marketplace` as a local source.
- Tests: `pnpm --filter @penova/plugin-duplicate-file-finder test` and `test:e2e` (needs Chrome; sample files in `test/samples/`).

## Third-party components and licenses

MIT licensed (author: Penova). Bundled: MCP SDK and ext-apps (MIT), zod (MIT); the full list is in `dist/THIRD_PARTY_NOTICES.txt`.
52 changes: 52 additions & 0 deletions external_plugins/duplicate-file-finder/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 重复文件查找

找出文件夹里内容完全相同的文件——按大小和 SHA-256 内容哈希比对,不看文件名——并算出浪费了多少空间。每组自动保留一份(像原件的那个,不带“副本”“(1)”),你可以改选保留哪个,然后导出报告,或把多余副本移到待删文件夹。绝不直接删除文件,移走的文件还能放回原处。在本地运行,无需 API 密钥。

## 功能

- **只认完全相同**:先按大小、再按内容的 SHA-256 分组,“同名不同内容”不会误判,改过名的副本也能找出来。
- **保留哪一份**:智能(文件名不带“copy / 副本 / (1)”、路径最短)、最早、最新,或优先保留指定文件夹里的;每组都可以用“保留”勾选框改。
- **能省多少空间**:按浪费空间从大到小排列,摘要显示可以释放多少。
- **安全清理**:多余副本按原路径移到 duplicate-file-finder/<项目>/review/,绝不删除;“把移走的副本放回原处”可以还原。没有保留任何文件的组会被拦住。
- **筛选**:可忽略太小的文件和 .DS_Store 之类的扩展名;空文件不计。
- **面板**:在 ZCode 侧栏里选择输入文件、调整设置、查看问题、直接修改表格里的任意单元格、预览成品并导出。修改保存在 `duplicate-file-finder/<项目>.project.json`,重新打开输入文件前一直保留。

## 使用方法

在 ZCode 桌面端对助手说:

- “找出 下载/ 和 旧电脑备份/ 里的重复文件”
- “保留 合同/ 文件夹里的那份,其余移到待删文件夹”
- “撤销,把移走的副本放回原处”

## 工具

| 工具 | 作用 |
|---|---|
| `dupes_open` | 扫描工作区文件夹,把内容完全相同的文件分组,并打开面板 |
| `dupes_edit` | 修改设置、按行修改单元格、新增或删除行 |
| `dupes_status` | 查看当前数据、问题和汇总 |
| `dupes_export` | 导出 duplicates.csv 和 duplicates.html,或把多余副本移到待删文件夹(附 moved.csv);restore 可放回原处 |

导出文件写到工作区的 `duplicate-file-finder/<项目>/` 文件夹。

## 范围(v0.1)

- 只找完全相同的文件;v0.1 不识别相似图片(缩放过或重新压缩过的)。
- 范围限于工作区,每次最多 5 个文件夹、20,000 个文件。
- 插件不会删除文件;确认无误后请自己清空待删文件夹。

## 隐私、网络与文件

- **全部在本地运行。** 不联网、不上传,不需要 API 密钥或账号。
- 只读取你选择的文件,只写入工作区的 `duplicate-file-finder/` 文件夹;另外只有在你点“把多余副本移到待删文件夹”时才会移动文件(点“放回原处”可还原)。没有 Hook。

## 构建与测试(开发者)

- 源码:`ui-plugins/duplicate-file-finder/`。
- 构建:`pnpm install --frozen-lockfile && pnpm build`,然后把 `dist/local-marketplace` 添加为本地来源。
- 测试:`pnpm --filter @penova/plugin-duplicate-file-finder test` 和 `test:e2e`(需要 Chrome;样例文件在 `test/samples/`)。

## 第三方组件与许可证

MIT 许可(作者:Penova)。打包的组件:MCP SDK 与 ext-apps(MIT)、zod(MIT);完整列表见 `dist/THIRD_PARTY_NOTICES.txt`。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: duplicate-file-finder
description: 找出文件夹里内容完全相同的文件——按大小和 SHA-256 内容哈希比对,不看文件名——并算出浪费了多少空间。每组自动保留一份(像原件的那个,不带“副本”“(1)”),你可以改选保留哪个,然后导出报告,或把多余副本移到待删文件夹。绝不直接删除文件,移走的文件还能放回原处。在本地运行,无需 API 密钥。 用户提到“重复文件 / 查重 / 去重 / 清理副本 / 硬盘空间”时使用。
---

# 重复文件查找

1. `dupes_open(inputs, settings?, project?)`:扫描工作区文件夹,把内容完全相同的文件分组。inputs 是工作区相对路径。
- 结果里有汇总、问题列表(错误 / 提醒)和前几行数据,每行有编号 `#n`。
- inputs 传一个或多个文件夹;要优先保留某文件夹就设 settings: {keep: "folder", prefer: "合同"}(会重新扫描分组)。
2. 向用户简要说明结果,先说错误和需要确认的地方,不要逐行念。
3. 用户要改时调用 `dupes_edit(project, settings?, set?: [{row, values}], add?, remove?)`。
- 改保留:`set: [{row, values: {keep: true}}]`;每组至少保留一个。
4. `dupes_export(project, formats?)`:导出 duplicates.csv 和 duplicates.html,或把多余副本移到待删文件夹(附 moved.csv);restore 可放回原处。把文件路径告诉用户。
5. 先导出 report 给用户看;用户明确同意后才导出 move。不要说“已删除”——文件只是移到了 review/。
49 changes: 49 additions & 0 deletions marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,55 @@
"把上一个 Hi3D 任务生成的模型按角色拆分成部件"
]
}
},
{
"name": "duplicate-file-finder",
"componentTypes": [
"ui"
],
"source": "./external_plugins/duplicate-file-finder",
"displayName": "Duplicate File Finder",
"displayName_i18n": {
"en": "Duplicate File Finder",
"zh-CN": "重复文件查找"
},
"description": "Find files that are exact copies of each other in your folders — compared by size and SHA-256 content hash, never by name — and see how much space they waste. One copy per group is kept automatically (the original-looking name, not “copy” or “(1)”), you can change which one, then export a report or move the extra copies into a review folder. Nothing is ever deleted, and moved files can be restored. Runs locally; no API keys.",
"description_i18n": {
"en": "Find files that are exact copies of each other in your folders — compared by size and SHA-256 content hash, never by name — and see how much space they waste. One copy per group is kept automatically (the original-looking name, not “copy” or “(1)”), you can change which one, then export a report or move the extra copies into a review folder. Nothing is ever deleted, and moved files can be restored. Runs locally; no API keys.",
"zh-CN": "找出文件夹里内容完全相同的文件——按大小和 SHA-256 内容哈希比对,不看文件名——并算出浪费了多少空间。每组自动保留一份(像原件的那个,不带“副本”“(1)”),你可以改选保留哪个,然后导出报告,或把多余副本移到待删文件夹。绝不直接删除文件,移走的文件还能放回原处。在本地运行,无需 API 密钥。"
},
"version": "0.1.0",
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"category": "productivity",
"keywords": [
"duplicates",
"duplicate files",
"dedupe",
"sha256",
"clean up",
"disk space",
"重复文件",
"查重",
"去重",
"清理",
"副本"
],
"examplePrompts": [
"Find duplicate files in 下载/ and 旧电脑备份/",
"Keep the copies inside 合同/ and move the rest to review",
"Undo — put the moved copies back"
],
"examplePrompts_i18n": {
"zh-CN": [
"找出 下载/ 和 旧电脑备份/ 里的重复文件",
"保留 合同/ 文件夹里的那份,其余移到待删文件夹",
"撤销,把移走的副本放回原处"
]
}
}
]
}
62 changes: 36 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading