Crates.io | yamine |
lib.rs | yamine |
version | 0.4.2 |
source | src |
created_at | 2023-11-13 22:10:42.504422 |
updated_at | 2023-11-14 15:24:44.078031 |
description | A simple CLI for combining json and yaml files |
homepage | https://github.com/avencera/yamine |
repository | https://github.com/avencera/yamine |
max_upload_size | |
id | 1034108 |
size | 68,460 |
A simple CLI for combining json and yaml files
Available via Homebrew/Linuxbrew
brew install avencera/tap/yamine
OR
Install from a github release:
curl -LSfs https://avencera.github.io/yamine/install.sh | sh -s -- --git avencera/yamine
OR
Install using cargo:
cargo install yamine
or cargo binstall yamine
OR
Download a release directly from github: github.com/avencera/yamine/releases
yamine --help
Combine JSON/YAML files into a single file
Usage: yamine [OPTIONS] [FILES_OR_FOLDERS]...
Arguments:
[FILES_OR_FOLDERS]... File(s) or folder you want to run in
Options:
-i, --stdin Read from STDIN
-d, --depth <DEPTH> Number of folder depth to recurse into [default: 1]
-o, --output <OUTPUT> Output file name [default: combined.yaml]
--dry-run Default mode
-w, --write Write new output file
-s, --stdout Outputs combined file contents to STDOUT
-f, --format <FORMAT> The format for the output file, defaults to yaml [default: yaml] [possible values: yaml, json-array, json-k8s, json]
-h, --help Print help
-V, --version Print version
combined.yaml
file
yamine -w .
combined.json
file in json-k8s
format:
yamine --write --format json-k8s --output combined.json .
yamine --stdout -f json .
pbpaste | yamine --stdin --stdout -f json
yaml
- a multi document yaml file separated by ---
(a kubernetes multi resource document)
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
---
apiVersion: v1
kind: Namespace
metadata:
name: example
---
kind: ServiceAccount
apiVersion: v1
---
apiVersion: v1
kind: Service
---
apiVersion: apps/v1
kind: Deployment
json
- a json file with each combined file being an element in the array
[
{
"apiVersion": "traefik.containo.us/v1alpha1",
"kind": "IngressRoute"
...
},
{
"apiVersion": "v1",
"kind": "Namespace",
...
},
{
"apiVersion": "v1",
"kind": "ServiceAccount",
...
},
{
"apiVersion": "v1",
"kind": "Service",
...
},
]
json-k8s
- a kubernetes multi resource json document ex:
{
"kind": "List",
"apiVersion": "v1",
"items": [
{
"apiVersion": "traefik.containo.us/v1alpha1",
"kind": "IngressRoute"
...
},
{
"apiVersion": "v1",
"kind": "Namespace",
...
},
{
"apiVersion": "v1",
"kind": "ServiceAccount",
...
},
{
"apiVersion": "v1",
"kind": "Service",
...
},
]
}