grasmash/yaml-cli
Composer 安装命令:
composer require grasmash/yaml-cli
包简介
A command line tool for reading and manipulating yaml files.
README 文档
README
Yet another command line tool for reading and manipulating yaml files, built on the Symfony console component.
Commands:
| Command | Description |
|---|---|
| get:value | Get a value for a specific key in a YAML file. |
| get:type | Get the data type of a value in a YAML file. |
| lint | Validates that a given YAML file has valid syntax. |
| unset:key | Unset a specific key in a YAML file. |
| update:key | Change a specific key in a YAML file. |
| update:value | Update the value for a specific key in a YAML file. |
Installation
composer require grasmash/yaml-cli
Example usage:
./vendor/bin/yaml-cli get:value somefile.yml some-key
./vendor/bin/yaml-cli get:type somefile.yml some-key
./vendor/bin/yaml-cli lint somefile.yml
./vendor/bin/yaml-cli unset:value somefile.yml some-key
./vendor/bin/yaml-cli update:key somefile.yml old-key new-key
./vendor/bin/yaml-cli update:value somefile.yml some-key some-value
# Cast to boolean.
./vendor/bin/yaml-cli update:value somefile.yml some-key false
./vendor/bin/yaml-cli update:value somefile.yml some-key true
./vendor/bin/yaml-cli update:value somefile.yml some-key 0 --type=boolean
./vendor/bin/yaml-cli update:value somefile.yml some-key 0 --type=bool
# Cast to null.
./vendor/bin/yaml-cli update:value somefile.yml some-key null
./vendor/bin/yaml-cli update:value somefile.yml some-key ~ --type=null
# Cast to integer.
./vendor/bin/yaml-cli update:value somefile.yml some-key 1 --type=integer
./vendor/bin/yaml-cli update:value somefile.yml some-key 1 --type=int
# Cast to float/double/real.
./vendor/bin/yaml-cli update:value somefile.yml some-key 1.0 --type=float
./vendor/bin/yaml-cli update:value somefile.yml some-key 1.0 --type=double
./vendor/bin/yaml-cli update:value somefile.yml some-key 1.0 --type=real
# Forcibly cast to string for values that would otherwise be boolean or null.
./vendor/bin/yaml-cli update:value somefile.yml some-key true --type=string
./vendor/bin/yaml-cli update:value somefile.yml some-key false --type=string
./vendor/bin/yaml-cli update:value somefile.yml some-key null --type=string
Similar tools:
- Javascript - https://github.com/pandastrike/yaml-cli
- Ruby - https://github.com/rubyworks/yaml_command
- Python - https://github.com/0k/shyaml
Recognition
This project was inspired by the yaml commands in Drupal Console.
grasmash/yaml-cli 适用场景与选型建议
grasmash/yaml-cli 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26.3M 次下载、GitHub Stars 达 25, 最近一次更新时间为 2017 年 01 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 grasmash/yaml-cli 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 grasmash/yaml-cli 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 26.3M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 27
- 点击次数: 18
- 依赖项目数: 10
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-03