Goku CLI is a small Go tool for converting JSON to YAML and YAML to JSON.
- Reads
.json,.yaml, and.ymlfiles - Prints the converted result
- Saves the converted file
- Can save with a custom file name or path
- Shows an error if input and output formats are the same
Clone the project, then run:
go mod tidy
To build in the project folder:
- Windows:
go build -o goku.exe . - macOS/Linux:
go build -o goku .
To use the command as goku from anywhere, build it into any folder that is already in your system PATH.
Basic command:
goku -i <input-file> -o <output-format>
JSON to YAML:
goku -i examples/config.json -o yaml
YAML to JSON:
goku -i examples/config.yaml -o json
Save with another name or folder:
goku -i examples/config.json -o yaml -p output/app.yaml
-i,--input: input file path-o,--output: output format,jsonoryaml-p,--path: optional output path with file name-h,--help: show help
Run goku --help.
Run go test ./....
MIT License