Skip to content

Repository files navigation

ym

Logo

The yaml-merge CLI allows you to merge multiple YAML files into a single file.

License

Functionality

The yaml-merge CLI reads one or more YAML files and merges them into a single YAML file. The merged YAML file contains all the key-value pairs from the input files. If there are any conflicts between the keys, the value from the last input file takes precedence.

Installing

Download

Check our release page to download a specific version

#!/bin/bash# Fetch the latest release version from Github API
VERSION=$(curl --silent "https://api.github.com/repos/RaftechNL/ym/releases/latest"| grep '"tag_name":'| sed -E 's/.*"([^"]+)".*/\1/')# Set the URL of the tarball for the latest release
URL="https://github.com/RaftechNL/cli-yaml-merger/releases/download/${VERSION}/ym_${VERSION}_darwin_x86_64.tar.gz"# Download and install the latest release
curl -L ${URL}| tar xz
chmod +x ym
sudo mv ym /usr/local/bin/

Homebrew

brew tap RaftechNL/toolbox
brew install raftechnl/toolbox/ym

Example

To merge two YAML files (file1.yaml and file2.yaml) and save the result to a new file (merged.yaml), run:

ym -i file1.yaml -i file2.yaml -o merged.yaml

This command reads the input YAML files (file1.yaml and file2.yaml), merges them into a single YAML file, and saves the result to a new file (merged.yaml).

If you want to merge three or more YAML files, simply add more -i options to the command:

ym -i file1.yaml -i file2.yaml -i file3.yaml -o merged.yaml

This command reads the input YAML files (file1.yaml, file2.yaml, and file3.yaml), merges them into a single YAML file, and saves the result to a new file (merged.yaml).

Contributing

Contributions are always welcome!

Authors

About

Minimalistic CLI to deep merge two+ YAML files

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages