Advanced1 分钟
桌面版CLI使用说明
如何使用命令行界面
Desktop CLI 使用
如何使用 Desktop(¥4,500)中包含的 CLI 工具。
📍 基本命令
# YAML → JSON
yamlforge convert input.yaml -o output.json
# JSON → YAML
yamlforge convert input.json -o output.yaml
# 输出到 stdout
yamlforge convert input.yaml⚙️ 选项
| 选项 | 描述 | 默认值 |
|---|---|---|
-o, --output | 输出文件 | stdout |
--preserve-anchors | 保留锚点 | true |
--preserve-comments | 保留注释 | true |
--indent | 缩进大小 | 2 |
--sort-keys | 排序键 | false |
📁 批量处理
# 将目录中的所有 YAML 转换为 JSON
yamlforge batch ./configs --pattern "*.yaml" --output ./json
# 递归处理
yamlforge batch ./configs --pattern "**/*.yaml" --recursive🔧 管道集成
# 从 stdin 读取
cat config.yaml | yamlforge convert --stdin
# 与 jq 结合
yamlforge convert config.yaml | jq '.server.port'标签
#cli#desktop#advanced#command-line#batch