https://github.com/abc-inc/gutenfmt
https://github.com/abc-inc/gutenfmt
cli csv format golang json output template tsv yaml
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/abc-inc/gutenfmt
- Owner: abc-inc
- License: apache-2.0
- Created: 2021-04-11T11:41:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-29T08:54:35.000Z (8 months ago)
- Last Synced: 2026-01-12T18:26:09.706Z (3 months ago)
- Topics: cli, csv, format, golang, json, output, template, tsv, yaml
- Language: Go
- Homepage: https://abc-inc.github.io/gutenfmt/
- Size: 164 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gutenfmt
gutenfmt is a cross-platform command line tool that converts name-value pairs and JSON to different output formats,
including, but not limited to, CSV, JSON, YAML or a table with aligned columns.
## Examples
The following examples provide a brief overview of gutenfmt and its features.
### Query Structured Data using JQ Filters or JMESPath Expressions
```shell
$ env | gutenfmt --jq .JAVA_HOME
$ # or JMESPath
$ env | gutenfmt --query JAVA_HOME
$ # instead of
$ env | grep -E ^JAVA_HOME= | cut -d = -f 2
````
### List OpenJDK Packages on a Debian-System as Colorized JSON
```shell
$ dpkg-query -W -f='${Package}\t${Version}\t${Status}\n' "openjdk*" | grep -Fv unknown | cut -f 1,2 | gutenfmt
{
"openjdk-16-jdk": "16.0.2+7-2",
"openjdk-16-jdk-headless": "16.0.2+7-2",
"openjdk-16-jre": "16.0.2+7-2",
"openjdk-16-jre-headless": "16.0.2+7-2",
"openjdk-16-source": "16.0.2+7-2",
"openjdk-8-jdk": "8u302-b08-0ubuntu2",
"openjdk-8-jdk-headless": "8u302-b08-0ubuntu2",
"openjdk-8-jre": "8u302-b08-0ubuntu2",
"openjdk-8-jre-headless": "8u302-b08-0ubuntu2"
}
```
### Print JavaScript Dependencies as Table With Aligned Columns
```shell
$ gutenfmt package.json --jq '.dependencies' -o text | sort
...
@types/yargs ^17.0.3
@webcomponents/custom-elements ^1.1.0
xhr2 0.2.1
yargs ^17.2.1
```
## Further Information
gutenfmt is a also a Go library that helps to create applications, which support different output formats.
It comes with an opinionated view of the third-party libraries, so that you can get started with minimum fuss.
In other words, Formatters come with meaningful defaults.
The primary goals are:
- Provide a radically faster and widely accessible getting-started experience for Command Line Interface (CLI) development.
- Be opinionated out of the box but get out of the way quickly as requirements start to diverge from the defaults.
- Provide a range of standardized output formats that are common to state-of-the-art projects.
Both, User Manual and Development Guide, can be found at
abc-inc.github.io/gutenfmt.