April 25, 2022 01:56 pm GMT
Original Link: https://dev.to/gyudoza/yamlier-a-super-simple-cli-yaml-editor-nco
yamlier: a Super simple cli yaml editor.
github repository: https://github.com/jujumilk3/yamlier
If you have to edit yaml file on CI/CD pipeline or other situations, just use it.
install
wget https://github.com/jujumilk3/yamlier/releases/download/v0.1.0/yamlier
usage
- yamlier --help
- yamlier edit [flags]
yamlier edit [file_path] [key] [value] | [output_filepath]
example
# developer.yamlname: Martin D'vloperjob: Developerskill: Elitefoods: - Apple - Orange - Strawberry - Mangolanguages: perl: Elite python: Elite pascal: Lameeducation: | 4 GCSEs 3 A-Levels BSc in the Internet of Things
yamlier edit ./developer.yaml name changed_name ./developer-yamlier.yaml
# developer-yamlier.yamleducation: | 4 GCSEs 3 A-Levels BSc in the Internet of Thingsfoods:- Apple- Orange- Strawberry- Mangojob: Developerlanguages: pascal: Lame perl: Elite python: Elitename: changed_name # name changedskill: Elite
CAUTION: new yaml's keys are ordered.
I made it because i had to edit my yaml config file on CI/CD pipeline. There were some values that should not be exposed. I thought there is some cli tool that edits yaml file. Because kustomize actually does it. But there's no yaml editing cli tool.
Everyone who needs to edit yaml file at cli is writing temporary bash, shell, python script to edit yaml file.
Don't complicate things. Use this.
Original Link: https://dev.to/gyudoza/yamlier-a-super-simple-cli-yaml-editor-nco
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To