Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions plugins/batch-rename/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
dist/
outputs/
.vite/
*.log
utools/
test/
14 changes: 14 additions & 0 deletions plugins/batch-rename/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 更新日志

## 1.0.0 - 2026-09-25

### 新增

- 提供查找替换、自动编号、插入内容和手动编辑四种批量重命名方式,并支持文件夹扫描、排序和实时预览。
- 支持基于 ZTools 已配置模型生成智能重命名候选;用户确认预览后才执行改名。
- 执行前检查名称冲突和非法名称,支持关联改名及最近一次操作撤销。
- 支持读取文件时间、大小、图片尺寸和拍摄时间等信息用于预览名称。

### 安全

- 改名遇到冲突或失败时保留源文件,不覆盖无关目标文件;支持部分成功结果提示。
21 changes: 21 additions & 0 deletions plugins/batch-rename/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 yyxxd

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.
49 changes: 49 additions & 0 deletions plugins/batch-rename/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 文件智能重命名

面向 Windows / ZTools 的文件批量重命名插件。支持规则化重命名,也可以使用 ZTools 中已配置的 AI 模型生成候选名称;所有候选都可先预览,再执行。

## 功能

- **查找替换**:普通替换、位置替换、多规则串联,并可选择是否处理扩展名。
- **自动编号**:支持数字、中文数字和英文字母序号,可设置前后缀、起始值和位数。
- **插入内容**:插入文本、序号、文件时间、大小、图片尺寸和拍摄时间。
- **智能重命名**:根据自然语言要求生成候选名称;需要先在 ZTools 配置可用模型。
- **手动编辑**:逐项编辑,或粘贴电子表格中的多行文件名。
- 支持从资源管理器文件上下文导入、递归扫描文件夹、排序、实时预览、冲突预检和最近一次操作撤销。

## 界面截图

| 查找替换 | 智能重命名 |
| --- | --- |
| ![查找替换](docs/ui-evidence/v1.0.0-find-replace.png) | ![智能重命名](docs/ui-evidence/v1.0.0-smart-rename.png) |

其他界面:[自动编号](docs/ui-evidence/v1.0.0-numbering.png) · [插入内容](docs/ui-evidence/v1.0.0-insert.png) · [手动编辑](docs/ui-evidence/v1.0.0-manual-edit.png)

## 安装

- **插件中心**:在 ZTools 插件市场搜索“文件智能重命名”。市场审核通过后即可安装。
- **本地安装**:从 [GitHub Releases](https://github.com/yyxxd/ztools-batch-rename/releases) 下载 ZIP,在 ZTools 插件管理中选择“本地安装”。

## 本地开发与打包

需要 Node.js 和 pnpm。克隆仓库后运行:

```powershell
pnpm install
pnpm dev
pnpm build
pnpm test
.\scripts\package-probe.ps1
```

打包脚本会在 `outputs/` 生成可在 ZTools 中本地安装的 ZIP。也可在 ZTools 插件管理中加载本地开发版本。

## 支持范围

- 目标平台:Windows(`win32`)与 ZTools。
- 智能重命名依赖 ZTools 已配置的模型;每次最多处理 500 个文件。
- 其他操作系统及未经实测的宿主版本暂不声明支持。

## 许可

[MIT License](LICENSE)
Loading
Loading