{"id":15042433,"url":"https://github.com/catdad/json-cli-toolkit","last_synced_at":"2026-02-28T19:02:37.597Z","repository":{"id":57284716,"uuid":"60807590","full_name":"catdad/json-cli-toolkit","owner":"catdad","description":":hear_no_evil: work with json from the command line","archived":false,"fork":false,"pushed_at":"2018-07-13T16:46:59.000Z","size":155,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T03:40:29.757Z","etag":null,"topics":["cli","json","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catdad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-09T21:15:13.000Z","updated_at":"2023-03-10T13:42:23.000Z","dependencies_parsed_at":"2022-08-25T07:22:14.704Z","dependency_job_id":null,"html_url":"https://github.com/catdad/json-cli-toolkit","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/catdad/json-cli-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad%2Fjson-cli-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad%2Fjson-cli-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad%2Fjson-cli-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad%2Fjson-cli-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catdad","download_url":"https://codeload.github.com/catdad/json-cli-toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catdad%2Fjson-cli-toolkit/sbom","scorecard":{"id":267892,"data":{"date":"2025-08-11","repo":{"name":"github.com/catdad/json-cli-toolkit","commit":"485c652d50dcd658766a579727e9a699de528d50"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T12:36:38.491Z","repository_id":57284716,"created_at":"2025-08-17T12:36:38.491Z","updated_at":"2025-08-17T12:36:38.491Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29948228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","json","npm"],"created_at":"2024-09-24T20:47:18.270Z","updated_at":"2026-02-28T19:02:37.572Z","avatar_url":"https://github.com/catdad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json cli toolkit\n\n[![Linux Build][1]][2]\n[![Windows Build][12]][13]\n[![Test Coverage][3]][4]\n[![Code Climate][5]][6]\n[![Downloads][7]][8]\n[![Version][9]][8]\n[![Dependency Status][10]][11]\n\n[1]: https://travis-ci.org/catdad/json-cli-toolkit.svg?branch=master\n[2]: https://travis-ci.org/catdad/json-cli-toolkit\n\n[3]: https://codeclimate.com/github/catdad/json-cli-toolkit/badges/coverage.svg\n[4]: https://codeclimate.com/github/catdad/json-cli-toolkit/coverage\n\n[5]: https://codeclimate.com/github/catdad/json-cli-toolkit/badges/gpa.svg\n[6]: https://codeclimate.com/github/catdad/json-cli-toolkit\n\n[7]: https://img.shields.io/npm/dm/json-cli-toolkit.svg\n[8]: https://www.npmjs.com/package/json-cli-toolkit\n[9]: https://img.shields.io/npm/v/json-cli-toolkit.svg\n\n[10]: https://david-dm.org/catdad/json-cli-toolkit.svg\n[11]: https://david-dm.org/catdad/json-cli-toolkit\n\n[12]: https://ci.appveyor.com/api/projects/status/github/catdad/json-cli-toolkit?branch=master\u0026svg=true\n[13]: https://ci.appveyor.com/project/catdad/json-cli-toolkit\n\n## Install\n\nInstall globally so that the CLI is placed in your path.\n\n```bash\nnpm install -g json-cli-toolkit\n```\n\nThis will expose the command `json` in your path.\n\n## Use\n\n`json --help` is your friend.\n\n* Common options\n  * [`ignore`](#ignore)\n  * [`multiline`](#multiline)\n  * [`pretrim`](#pretrim)\n  * [`pretty`](#pretty)\n* Commands\n  * [`delete`](#json-delete)\n  * [`echo`](#json-echo)\n  * [`exec`](#json-exec)\n  * [`fill`](#json-fill)\n  * [`filter`](#json-filter)\n  * [`pluck`](#json-pluck)\n  * [`set`](#json-set)\n  * [`sort`](#json-sort)\n  * [`wrap`](#json-wrap)\n\n### Common options\n\n#### ignore\n\nIgnore input that is not json. By default, `json` will error for parsing errors.\n\n**Examples:**\n\n`json --ignore`\n\n`json -i`\n\n#### multiline\n\nRead multiline input as one json object per line.\n\n**Examples:**\n\n`json --multiline`\n\n`json -m`\n\n#### pretrim\n\nRemove non-json content from the beginning of the input.\n\n**Examples:**\n\n`json --pretrim`\n\n`json -r`\n\n#### pretty\n\nPretty-print the json output.\n\n**Examples:**\n\n`json --pretty`\n\n`json -p`\n\n### Commands\n\nAll commands have help in the CLI. You can access it as such:\n\n```bash\njson \u003ccommand\u003e --help\n```\n\n#### `json delete`\n\nRemove a particular property and its value from the json.\n\n`--attr`: The property to remove. Nested properties can be set using dot notation.\n\n**Examples:**\n\n```bash\njson delete --attr propname\njson delete --attr nested.prop\n\n# Delete multiple properties at the same time\njson delete --attr one --attr two\n```\n\n#### `json echo`\n\nPrint the input json to the output.\n\n**Examples:**\n\n```bash\njson echo\njson echo --pretty\n```\n\n#### `json exec`\n\nUse arbitrary JavaScript to transform or filter the input json:\n\n`--code`: The code to execute. This code will be called multiple times if running with the `multiline` flag. It has acess to the following global objects:\n  - `obj`: An object, which is the JSON being treated. You can modify this object as you like, and the result will be used for the output. Setting `obj` to `undefined` will filter the json object out of the output.\n  - `opts`: The options object for the `exec` command. This object is shared across all executions of the code, and can be used to store and share data between executions.\n  - `_`: Lodash, for convenience.\n\n**Examples:**\n\n```bash\n# Add a new property\njson exec --code \"obj.newProp = obj.one + obj.two\"\n\n# Filter out some input\njson exec --multiline --code \"if (obj.name !== 'thing') obj = undefined\"\n```\n\n#### `json fill`\n\nTransform json input using a whitelist or blacklist of properties.\n\n`--exclude`: Optional. A list of properties to exlude, if present. This list is provided as space-separated properties. They can be top-level properties or nested properties using dot notation.\n\n`--include`: Optional. A list of proerties to include, if present. This list is provided as space-separated properties. They can be top-level properties or nested properties using dot notation.\n\n**Examples:**\n\n```bash\n# Use a whitelist to transform the json input\njson fill --include thing nested.stuff\n\n# Use a blacklist to remove properties from the json\n# all json objects\njson fill --multiline --exclude thing nested.stuff\n```\n\n#### `json filter`\n\nFilter only json input entries that match specific rules:\n\n`--attr`: The property to use in order to filter entries. If this flag is used alone, the existence of a value for this property will be treated as truthy, causing the entry will appear in the output. Nested properties can be accessed through dot notation.\n\n`--above`: Optional, used with `attr`. The entry will appear in the ouput only if the `attr` property value is above the value if this flag. This flag only works with strings and numbers, and if the value defined by `attr` is any other type, the entry will not appear in the output.\n\n`--below`: Optional, used with `attr`. The entry will appear in the ouput only if the `attr` property value is below the value if this flag. This flag only works with strings and numbers, and if the value defined by `attr` is any other type, the entry will not appear in the output.\n\n`--equals`: Optional, used with `attr`. The entry will appear in the output only if the `attr` property value equals the value of this flag.\n\n`--in`: Optional, used with `attr`. The entry will appear int he output only if the `attr` property value is included in the list provided with this flag.\n\n`--matches`: Optional, used with `attr`. The entry will appear in the output only if the `attr` property value matches the regular expression defined in this flag.\n\n`--not`: Optional, used with any of the other flags. It will flip the comparison resulting from the other flags being used.\n\n**Examples:**\n\n```bash\njson filter --attr propname --equals muffins\njson filter --attr nested.prop --matches ^[0-9]{3,}\njson filter --attr propname --not --equals poptarts\njson filter --attr propname --in one two three\n```\n\n#### `json pluck`\n\nGet a value from the json object and print it to output.\n\n`--attr`: The property to get. Nested properties can be accessed through dot notation.\n\n**Examples:**\n\n```bash\njson pluck --attr propname\njson pluck --attr nested.prop\n```\n\n#### `json set`\n\nSet a particular value in the json object.\n\n`--attr`: The property to set. Nested properties can be set using dot notation.\n\n`--inc`: When set, the `value` will be incremented by the value set in this flag each time that a new json object is read in multiline mode.\n\n`--value`: The value to set to the property.\n\n**Examples:**\n\n```bash\njson set --attr propname --value muffins\njson set --attr nested.prop --value pineapples\n\n# Increment the value being set by 1 each time\njson set --multiline --attr count --value 1 --inc\n\n# Decrement the value being set by 5 each time\njson set --multiline --attr fiveLess --value 0 --inc -5\n```\n\n#### `json sort`\n\nSorts multiple json records. This is most useful when used along with the `--multiline` flag, as sorting a single json record just results in that record.\n\n_Note: since this command needs to read the entire input content, it may not work with very large datasets like the other commands. Use responsibly._\n\n`--attr`: The property in the json objects to use to sort. Nesxted properties can be defined using dot notation.\n\n`--order`: The sort order to use. The acceptable values are `ascending` (or `1`) and `descending` (or `-1`). The default order is ascending, when this flag is not defined.\n\n**Examples:**\n\n```bash\njson sort --multiline --attr propname\njson sort --multiline --attr some.property --order ascending\njson sort -m --attr propname --order -1\n```\n\n#### `json wrap`\n\nWrap the input json in a new object at a defined path.\n\n`--attr`: The property to which to assing the input json. Nested properties can be assigned using dot notation.\n\n**Examples:**\n\n```bash\njson wrap --attr propname\njson wrap --attr nested.prop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatdad%2Fjson-cli-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatdad%2Fjson-cli-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatdad%2Fjson-cli-toolkit/lists"}