Repository navigation
CLI Usage
zipax-bot edited this page Aug 11, 2026
·
2 revisions
zipax-cli 是压缩核心的命令行入口,用于测试与自动化场景。它与桌面应用共享同一套压缩逻辑(zipax-core)。
cd zipax-cross
# 查看帮助
cargo run -q -p zipax-cli -- --help预览压缩效果,不实际写文件:
cargo run -q -p zipax-cli -- plan photo.jpg
cargo run -q -p zipax-cli -- plan photo.png --overwrite --output-format webp# 默认质量
cargo run -q -p zipax-cli -- compress photo.jpg --level 4
# 转换为 AVIF
cargo run -q -p zipax-cli -- compress photo.jpg --output-format avif --level 4
# 限制尺寸
cargo run -q -p zipax-cli -- compress photo.jpg --max-width 128 --max-height 128cargo run -q -p zipax-cli -- compress photo.png --level 4
# 转换为 WebP 并限制目标大小 500KB
cargo run -q -p zipax-cli -- compress photo.png --output-format webp --target-size-kb 500cargo run -q -p zipax-cli -- compress a.png b.png --output-format webp| 参数 | 说明 |
|---|---|
--level N |
质量等级 1–6(默认 3) |
--output-format <fmt> |
输出格式:jpeg / png / webp / avif |
--max-width / --max-height |
尺寸限制(像素) |
--target-size-kb N |
目标文件大小(KB) |
--overwrite |
覆盖原文件 |
cargo test回到 Home · English: CLI Usage
Language / 语言:
- 简体中文 · English
- Home
- Tech-Stack
- Architecture
- Compression-Engine
- Features
- Build-and-Release
- CLI-Usage
- Ghostscript-Install
- Release-History
- Docs-Index
- Home-EN
- Tech-Stack-EN
- Architecture-EN
- Compression-Engine-EN
- Features-EN
- Build-and-Release-EN
- CLI-Usage-EN
- Ghostscript-Install-EN
- Release-History-EN
- Docs-Index-EN