{"id":22288446,"url":"https://github.com/sarathsp06/gojson","last_synced_at":"2025-07-28T22:32:48.775Z","repository":{"id":68798619,"uuid":"173143345","full_name":"sarathsp06/gojson","owner":"sarathsp06","description":"Command line utility to handle JSON in command line.","archived":false,"fork":false,"pushed_at":"2024-04-30T09:57:52.000Z","size":40617,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T19:21:16.896Z","etag":null,"topics":["cli","cli-app","golang","json"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sarathsp06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-28T16:06:10.000Z","updated_at":"2024-04-30T09:57:55.000Z","dependencies_parsed_at":"2024-06-20T18:53:30.511Z","dependency_job_id":"5eff1ca3-dac3-4bec-ac4d-08a0543436a6","html_url":"https://github.com/sarathsp06/gojson","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarathsp06%2Fgojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarathsp06%2Fgojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarathsp06%2Fgojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarathsp06%2Fgojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarathsp06","download_url":"https://codeload.github.com/sarathsp06/gojson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227961828,"owners_count":17847841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-app","golang","json"],"created_at":"2024-12-03T17:04:49.741Z","updated_at":"2024-12-03T17:04:49.893Z","avatar_url":"https://github.com/sarathsp06.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## GoJSON  [![Go Report Card](https://goreportcard.com/badge/github.com/sarathsp06/gojson)](https://goreportcard.com/report/github.com/sarathsp06/gojson) ![Last Commit](https://img.shields.io/github/last-commit/sarathsp06/gojson.svg) [![Go](https://github.com/sarathsp06/gojson/actions/workflows/go.yml/badge.svg)](https://github.com/sarathsp06/gojson/actions/workflows/go.yml)\n🎉 GoJSON 🚀 - A command-line utility to jazz up your JSON handling!\n\n🛠️ Built for fun during a never-ending 3-hour meeting where I just nodded along. 🙃 If you're scouting for some seriously useful JSON command-line tools, check out the list below!\n* [dsq](https://github.com/multiprocessio/dsq) - Tool for running SQL queries against JSON, CSV, Excel, Parquet, and more.\n* [fx](https://github.com/antonmedv/fx) - A interactive terminal tool.\n* [jo](https://github.com/jpmens/jo) - A small utility to create JSON objects\n* [jsoncat](https://github.com/pantuza/jsoncat) - Pretty-print Json in terminal with colors and adjusting tabs size.\n* [jq](http://stedolan.github.io/jq/) - A lightweight and flexible command-line JSON processor.\n* [json](http://trentm.com/json/) - A \"json\" command for massaging JSON on your Unix command line.\n* [jshon](http://kmkeen.com/jshon/) - A parser designed for maximum convenience within the shell.\n* [jarg](http://jdp.github.io/jarg/) - Shorthand JSON and form encoding syntax in the shell.\n* [jsawk](https://github.com/micha/jsawk) - Like awk, but for JSON.\n* [json-dotenv](https://github.com/decryptus/json-dotenv) - Manipulate and extract envfiles in json format.\n* [gron](https://github.com/tomnomnom/gron) - Convert a JSON file into discrete assignments that are greppable.\n* [jid](https://github.com/simeji/jid) - Incremental Digger. Drill down JSON interactively by using filtering queries like jq.\n* [jiq](https://github.com/fiatjaf/jiq) - It's `jid` with `jq`. You can drill down interactively by using `jq` filtering queries.\n* [jv](https://github.com/maxzender/jv) - jv (for jsonviewer) helps you view your JSON.\n* [jl](https://github.com/chrisdone/jl) - Functional sed for JSON.\n* [oj](https://github.com/ohler55/ojg) - A fast and flexible command line JSON processor.\n* [visidata](https://github.com/saulpw/visidata) - A terminal spreadsheet-like tool for interactively exploring data.\n\n\n### What gojson does\n\n- [x] Retrieve nested objects\n- [x] Pretty print JSON\n- [x] Validate JSON\n- [x] Aggregate functions\n\n\n## Installing\n\n**Go Dev version**\n\n```sh\ngo install  github.com/sarathsp06/gojson@latest\n```\n\n**Binray Release**\n\n[download](https://github.com/sarathsp06/gojson/releases) and use the binary as such for your platform\n\n\n**Tip:**\n\u003e In unix move the binary to PATH\n\n#### Key Syntax\n\n- Key is a set of `.` seperated nested values\n- Can use 0-n numbers to refer to index in arrays\n- Can use `lower:upper` syntax to refer to a range of an array. Eg: players.1:3 \n- Can use keys of inner objects directly on arrays or range of them. Eg:  players.name where players is an array\n\n### Usage Examples\n\n##### Getting a value \n\n- Get a string:\n\n```sh\n$ echo '{\"name\":{\"first\":\"Sarath\",\"last\":\"Pillai\"}}' | gojson name.last\n\"Pillai\"\n```\n\n- Get a block of JSON:\n\n```sh\n$ echo '{\"name\":{\"first\":\"Sarath\",\"last\":\"Pillai\"}}'  | gojson name\n\n{\n  \"first\": \"Sarath\",\n  \"last\": \"Pillai\"\n}\n```\n\n- Try to get a non-existent key:\n\n```sh\n$ echo '{\"name\":{\"first\":\"Sarath\",\"last\":\"Pillai\"}}' | gojson names\nnil\n\n```\n\n- Get an array value by index:\n\n```sh\n$ echo '{\"people\":[{\"name\":\"saratha\"},{\"name\":\"syam\"}]}' | gojson people.1.name\n\"syam\"\n```\n\n- Projection from a slice\n\n```sh\n$ echo '{\"people\":[{\"name\":\"saratha\"},{\"name\":\"syam\"},{\"name\":\"singh\"},{\"name\":\"ping\"}]}' | gojson people.2:.name \n[\n  \"singh\",\n  \"ping\"\n]\n```\n\n- Slice of array\n\n```sh\n$ echo '{\"people\":[{\"name\":\"saratha\"},{\"name\":\"syam\"},{\"name\":\"singh\"},{\"name\":\"ping\"}]}' | gojson people.2:5\n[\n  {\n    \"name\": \"singh\"\n  },\n  {\n    \"name\": \"ping\"\n  }\n]\n```\n\n- Handling JSON key names with a `.`:\n\n```sh\n$ echo '{\"first.name\":\"Sarath\",\"last.name\":\"Pillai\"}' | gojson \\\"first.name\\\"\n\"Sarath\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarathsp06%2Fgojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarathsp06%2Fgojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarathsp06%2Fgojson/lists"}