jqfmt
brew install jqfmt
v0.1.0
MIT
Opinionated formatter for jq
10
30-day installs · #8585
20
90-day · #9736
89
365-day · #9494
411
★ GitHub stars · updated 6mo ago
Build dependencies
Links
- https://github.com/noperator/jqfmt
- GitHub: noperator/jqfmt
- Brew formula source: Formula/j/jqfmt.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [
"go"
],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Opinionated formatter for jq",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:39:04+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "jqfmt",
"github_default_branch": "main",
"github_last_commit_at": "2026-02-03T16:04:02Z",
"github_readme_excerpt": "\u003cp align=\"center\"\u003e\n \u003cpicture\u003e\n \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/QEmYDw4.png\"\u003e\n \u003cimg alt=\"jqfmt logo\" src=\"https://i.imgur.com/oQTnVNb.png\" width=\"300px\"\u003e\n \u003c/picture\u003e\n\u003c/p\u003e\n\n## Description\n\nI\u0027m frequently passed long shell one-liners that require some visual inspection before running. These days, there\u0027s about as much jq in that one-liner as there is bash. I wrote jqfmt to help add line breaks in sensible locations while reading (or writing!) jq.\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"ray\" src=\"https://i.imgur.com/sgII1ce.png\" width=\"400px\"\u003e\n\u003c/p\u003e\n\nAt time of initial development, I naturally turned to https://github.com/itchyny/gojq expecting to be able to generate and walk a syntax tree\u2014but gojq didn\u0027t seem to provide an AST that could be \"walked,\" and it doesn\u0027t export its parsing logic to be used in library form. So, I yanked the relevant code out of https://github.com/itchyny/gojq/blob/main/query.go and started from there.\n\nSide note: Ever tried Googling for \"jq formatter\"? Reading search results is a nightmare since jq itself _is_, among other things, a formatter.\n\n## Getting started\n\n### Install\n\nWith [Homebrew](https://brew.sh) via the [`jqfmt` package](https://formulae.brew.sh/formula/jqfmt):\n\n```shell\nbrew install jqfmt\n```\n\nWith Go:\n\n```shell\ngo install -v github.com/noperator/jqfmt/cmd/jqfmt@latest\n```\n\n### Usage\n\n```\n\ud834\udd22 jqfmt -h\nUsage of jqfmt:\n -ar\n \tarrays\n -f string\n \tfile\n -o\tone line\n -ob\n \tobjects\n -op string\n \toperators\n -v\tverbose\n```\n\nLet\u0027s take this line of jq\u2026\n\n```\n\ud834\udd22 echo \u0027{one: .two, three: [.four, .five, [.fivetwo, .fivethree]], six: map(select((.seven | .eight | .nine)))}\u0027 |\n jqfmt\n{ one: .two, three: [.four, .five, [.fivetwo, .fivethree]], six: map(select((.seven | .eight | .nine))) }\n```\n\n\u2026and format objects.\n\n```\n\n\ud834\udd22 echo \u0027{one: .two, three: [.four, .five, [.fivetwo, .fivethree]], six: map(select((.seven | .eight | .nine)))}\u0027 |\n jqfmt -ob\n{\n one: .two,\n three: [.four, .five,",
"github_repo": "noperator/jqfmt",
"github_stars": 411,
"github_topics": [],
"homepage": "https://github.com/noperator/jqfmt",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 10,
"installs_365d": 89,
"installs_90d": 20,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "MIT",
"llm_generated_at": null,
"llm_model": null,
"name": "jqfmt",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 8585,
"rank_365d": 9494,
"rank_90d": 9736,
"raw_hash": "597c3df4fd5417de",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/j/jqfmt.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "0.1.0",
"versioned_formulae": [],
"why_use_this": null
}