CLI Intro: Complementing the Browser
The browser workflow is great for speed and sharing, but it has limits for large batches, automation scripts, CI, or stricter local pipelines. CloudCreate CLI fills that gap.
Use both together: explore and validate quickly in the browser, then move stable flows to CLI for batch processing and automation.
CLI is also agent-friendly: predictable commands and pipeable outputs make it reliable in automation flows.
Recommended usage
- Web pages: quick trial, visual controls, instant preview.
- CLI: scriptable, reusable, ideal for local and pipeline use.
- Aligned parameter semantics: lower migration cost from trial to production.
Installation
For regular use, install globally. For one-off runs, use npx without installation. After install, both `cloudcreate` and `cc-tools` are available.
# 全局安装(推荐)
npm install -g @cloudcreate/cli
# 免安装一次性运行
npx --yes @cloudcreate/cli css:minify ./app.css --level aggressive
npx --yes @cloudcreate/cli open image:resize --mode width --width 1200 --print AI assistant (agent) usage tips
- Prefer having the agent call CLI directly instead of simulating processing in chat for reproducible results.
- Use explicit input/output paths (prefer absolute paths) and fixed parameters to reduce ambiguity.
- `open --print` is ideal when the agent should generate a shareable browser link first, then the user validates in UI.
- Log commands and parameters in automation flows for auditing and replay.
# Agent 友好范式:固定输入、固定输出、固定参数
cloudcreate image:compress /abs/in/banner.png -o /abs/out/banner.webp --quality 78 --format webp
# 先生成浏览器链接给用户确认
cloudcreate open image:resize --mode width --width 1200 --quality 82 --format webp --print
# 无全局安装时,Agent 也可直接运行
npx --yes @cloudcreate/cli table:convert /abs/in/data.xlsx --format csv -o /abs/out/data.csv Common command examples (browser complement + agent-ready)
- Image compression for lighter upload-ready assets.
- Image conversion to standardize formats like WebP/JPEG.
- Table conversion across xlsx/csv/tsv/json for data handoff.
- CSS minify before release/build.
- Archive compress/decompress for packaging and transfer.
# 1) 图片压缩
cloudcreate image:compress ./input.png -o ./output.webp --quality 78 --format webp
# 2) 图片格式转换
cloudcreate image:compress ./input.jpg -o ./output.avif --quality 72 --format avif
# 3) 表格转换(xlsx -> csv)
cloudcreate table:convert ./report.xlsx --format csv -o ./report.csv --sheet 0
# 4) CSS 压缩
cloudcreate css:minify ./app.css -o ./app.min.css --level aggressive
# 5) 归档打包与解包
cloudcreate archive:compress ./dist --format zip -o ./dist.zip
cloudcreate archive:decompress ./dist.zip -o ./dist-unpacked
# Browser deep link(补充)
cloudcreate open image:resize --mode width --width 1200 --quality 82 --format webp --print