xtool.ng
v2.0.0
Published
xtool — 个人命令行工具集合(统一入口分发)
Downloads
687
Maintainers
Readme
xtool
个人命令行工具集合(统一入口:4 个工具,未来可扩展)。
快速使用
# 1. 安装(一次性)
npm install -g xtool.ng
# 2. 查看总览
xtool
# 3. 查看某个工具的帮助
xtool -h rename
# 或
xtool rename --help
# 4. 跑某个工具
xtool png -q 90 # PNG → JPG(默认 action)
xtool png -a merge ~/Downloads # PNG 智能合并
xtool rename '^test-(.*)\.txt$' 'prod-#1.txt' -y
xtool mp4 -d ./videos
xtool pdf "report.pdf" # PDF → JPG 导出(默认 action)
xtool pdf -a compress "report.pdf"已收录工具
| 工具 | 作用 |
| -- | -- |
| mp4 | 批量压缩 MP4(码率超标检测 + CRF23,hevc 带 hvc1 tag,Finder/空格预览正常) |
| pdf | PDF → JPG 导出 / 图片合并为 PDF / PDF 压缩(-a fetch/merge/compress) |
| png | 批量 PNG → JPG(-a jpg,默认)/ 智能合并 PNG(-a merge) |
| rename | 当前目录按正则重命名(dry-run 默认) |
安装要求
- Node ≥ 18
- macOS / Linux / Windows
mp4需要ffmpeg+ffprobe;pdf/png需要 ImageMagick (magick);pdf -a compress需要 Ghostscript (gs)。
macOS:
brew install ffmpeg imagemagick ghostscript参与开发
阅读 AGENTS.md。任务完成后跑 ./scripts/verify。
