- Usage - basic usage
- Formats - list of supported file formats
- Platforms - list of supported platforms
- Releases - where to find an executable
- Examples - detailed usage exampels
- Building - how to build the CLI
- Testing - test the CLI
The command line tool, gss, can be used to easily convert data between formats. gss reads from stdin and outputs to stdout.
gss -i INPUT_FORMAT -o OUTPUT_FORMAT [flags]Using typical shell redirection, you can read from INPUT_FILE and write to OUTPUT_FILE.
gss -i INPUT_FORMAT -o OUTPUT_FORMAT [flags] < INPUT_FILE > OUTPUT_FILEOr you could save the output to shell variable output.
output=$(echo "${input}" | gss -i INPUT_FORMAT -o OUTPUT_FORMAT [flags])For more information use the help flag.
gss --helpThe following file formats are supported. Pull requests to support other formats are welcome!
| Format | Read | Write | Stream | Description |
|---|---|---|---|---|
| bson | ✓ | ✓ | - | Binary JSON |
| csv | ✓ | ✓ | ✓ | Comma-Separated Values |
| fmt | - | ✓ | ✓ | fmt |
| go | - | ✓ | ✓ | Go (format specifier: "%#v") |
| gob | ✓ | ✓ | ✓ | gob |
| hcl | ✓ | - | - | HashiCorp Configuration Language |
| json | ✓ | ✓ | - | JSON |
| jsonl | ✓ | ✓ | ✓ | JSON Lines |
| properties | ✓ | ✓ | - | Properties |
| tags | ✓ | ✓ | ✓ | single-line series of key=value tags |
| toml | ✓ | ✓ | - | TOML |
| tsv | ✓ | ✓ | ✓ | Tab-Separated Values |
| yaml | ✓ | ✓ | - | YAML |
The following platforms are supported. Pull requests to support other platforms are welcome!
| GOOS | GOARCH |
|---|---|
| darwin | amd64 |
| linux | amd64 |
| windows | amd64 |
| linux | arm64 |
gss is currently in alpha. Find releases at https://github.com/spatialcurrent/go-reader-writer/releases. See the Building section below to build from scratch.
Darwin
gss_darwin_amd64- CLI for Darwin on amd64 (includesmacOSandiOSplatforms)
Linux
gss_linux_amd64- CLI for Linux on amd64gss_linux_amd64- CLI for Linux on arm64
Windows
gss_windows_amd64.exe- CLI for Windows on amd64
.gitignore file to jsonl
cat .gitignore | gss -i csv --input-header path -o jsonGet language from CircleCI config.
cat .circleci/config.yml | gss -i yaml -o json -c '#' | jq -r .versionConvert list of files to JSON Lines
find . -name '*.go' | gss -i csv --input-header path -o jsonlUse make build_cli to build executables for Linux and Windows.
Changing Destination
The default destination for build artifacts is gss/bin, but you can change the destination with an environment variable. For building on a Chromebook consider saving the artifacts in /usr/local/go/bin, e.g., DEST=/usr/local/go/bin make build_cli
To run CLI testes use make test_cli, which uses shUnit2. If you recive a shunit2:FATAL Please declare TMPDIR with path on partition with exec permission. error, you can modify the TMPDIR environment variable in line or with export TMPDIR=<YOUR TEMP DIRECTORY HERE>. For example:
TMPDIR="/usr/local/tmp" make test_cli