{"id":50472472,"url":"https://github.com/sdkks/nesdit","last_synced_at":"2026-06-01T11:04:02.262Z","repository":{"id":354255991,"uuid":"1221389328","full_name":"sdkks/nesdit","owner":"sdkks","description":"nesdit aka NestedEdit: Edit and convert your json(l),yaml,toml files in place or on the fly through streaming","archived":false,"fork":false,"pushed_at":"2026-04-27T19:32:43.000Z","size":1030,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T21:04:55.579Z","etag":null,"topics":["ansible","argo","argocd","configuration","jq","json","jsonl","kubernetes","ndjson","serialization","spinnaker","toml","yaml","yml","yq"],"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/sdkks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-26T06:15:22.000Z","updated_at":"2026-04-27T19:32:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sdkks/nesdit","commit_stats":null,"previous_names":["sdkks/nesdit"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sdkks/nesdit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdkks%2Fnesdit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdkks%2Fnesdit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdkks%2Fnesdit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdkks%2Fnesdit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdkks","download_url":"https://codeload.github.com/sdkks/nesdit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdkks%2Fnesdit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33771632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ansible","argo","argocd","configuration","jq","json","jsonl","kubernetes","ndjson","serialization","spinnaker","toml","yaml","yml","yq"],"created_at":"2026-06-01T11:04:02.059Z","updated_at":"2026-06-01T11:04:02.256Z","avatar_url":"https://github.com/sdkks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nesdit\n\nA CLI for deterministic, format-preserving edits to JSON, YAML, and TOML documents using jq-style queries. Key order and value types are preserved; comments and YAML anchors are not.\n\n- Reads a file (or stdin), applies a query, and writes the result — without reformatting untouched content.\n- Supports in-place editing (`-i`), dry-run diffs (`-n`), drift checking (`--check`), and editor-assisted query building (`--edit`).\n- Enforces per-run resource caps by default to handle adversarial inputs safely.\n\n**Full documentation:** https://sdkks.github.io/nesdit/\n\n## Installation\n\n**Go:**\n\n```sh\ngo install github.com/sdkks/nesdit/cmd/nesdit@latest\n```\n\n**Pre-built binaries** (linux/amd64, linux/arm64, darwin/arm64) are available on the [releases page](https://github.com/sdkks/nesdit/releases).\n\n**Homebrew**:\n\n```sh\nbrew tap sdkks/tap \u0026\u0026 brew install sdkks/tap/nesdit\n```\n\n## Quick start\n\n```sh\n# Print a YAML file after editing .replicas\nnesdit deployment.yaml --query '.replicas = 3'\n\n# Edit in-place (atomic write)\nnesdit -i config.json --query '.env = \"production\"'\n\n# Preview changes without writing (unified diff to stdout)\nnesdit -n config.yaml --query '.timeout = \"30s\"'\n\n# Check if a file is up-to-date (exit 2 on drift, 0 if identical)\nnesdit --check config.yaml --query '.'\n\n# Filter: only apply query to docs where .kind == \"Deployment\"\nnesdit -i manifests.yaml --where '.kind == \"Deployment\"' --query '.spec.replicas = 2'\n\n# Open $EDITOR on a temp copy and get a suggested query from your edits\nnesdit --edit config.yaml\n\n# Read from stdin\necho '{\"x\": 1}' | nesdit --query '.x = 2'\n\n# Transcode: convert a JSON file to YAML output\nnesdit config.json --output-format yaml --query '.'\n\n# Inject a shell variable as a typed JSON value\nnesdit -i deploy.yaml --argjson replicas \"$REPLICAS\" --query '.replicas = $replicas'\n```\n\n## Supported formats\n\n| Format | Extensions      | Notes                       |\n| ------ | --------------- | --------------------------- |\n| JSON   | `.json`         | Preserves key order; output is always compact (single-line) |\n| YAML   | `.yaml`, `.yml` | Single-document per file; anchors/aliases and merge keys (`\u003c\u003c:`) resolved on decode, not re-emitted |\n| TOML   | `.toml`         | Tables and arrays of tables; nested tables emitted as inline syntax |\n\n\u003e **Known behaviors:** Comments are stripped from all formats on output. YAML anchors/aliases are resolved and not re-emitted; merge keys (`\u003c\u003c: *anchor`) are applied at decode time. YAML quoted strings are normalized to bare scalars. TOML `[section]` headers are rewritten to inline-table syntax (`{key = value}`). JSON output is always compact (single-line). None of these affect the parsed value — only the serialized form.\n\nFormat is auto-detected from the file extension. Use `--format json|jsonl|yaml|toml` to override input format, and `--output-format json|yaml|toml` to transcode to a different output format.\n\n## Key flags\n\n| Flag                        | Description                                                                         |\n| --------------------------- | ----------------------------------------------------------------------------------- |\n| `--query \u003cjq\u003e`              | jq-style query to apply                                                             |\n| `-f, --from-file \u003cpath\u003e`    | Load query from a file                                                              |\n| `--arg K=V`                 | Bind `$K` as a string value in the query (repeatable)                               |\n| `--argjson K=V`             | Bind `$K` as a JSON-decoded value in the query (repeatable)                         |\n| `--where \u003cjq\u003e`              | Filter: only apply query to matching documents                                      |\n| `--format \u003cfmt\u003e`            | Force input format (`json\\|jsonl\\|yaml\\|toml`); default is extension-based detection  |\n| `--output-format \u003cfmt\u003e`     | Output format (`json\\|yaml\\|toml`); defaults to same as input                        |\n| `--yaml-version \u003c1.1\\|1.2\u003e` | YAML boolean dialect: `1.1` coerces `yes/no/on/off`; `1.2` (default) requires `true/false` |\n| `-i, --in-place`            | Edit file(s) atomically in place                                                    |\n| `-n, --dry-run`             | Emit a unified diff; do not write                                                   |\n| `--check`                   | Exit 2 if query would change input; exit 0 if identical                             |\n| `--edit`                    | Open `$EDITOR`, emit a suggested query from the diff                                |\n| `--backup[=.ext]`           | Write a sibling backup before each in-place edit (requires `-i`)                    |\n| `--create-missing`          | Allow queries to create keys/paths not present in the input                         |\n| `--strict`                  | Halt on first document error (default behaviour; explicit alias)                    |\n| `--keep-going`              | Continue after per-document errors; exit 1 at end if any failed                     |\n| `--log-format json`         | Emit NDJSON on stderr instead of text                                               |\n| `--timeout \u003cdur\u003e`           | Cancel query after duration (e.g. `500ms`, `30s`)                                   |\n| `--max-bytes \u003cn\u003e`           | Reject inputs larger than `n` bytes (default 10 MiB; `0` disables)                  |\n| `--max-depth \u003cn\u003e`           | Reject documents nested deeper than `n` levels (default 1000; `0` disables)         |\n| `--max-yaml-nodes \u003cn\u003e`      | YAML alias-expansion cap, billion-laughs mitigation (default 100 000; `0` disables) |\n| `--max-query-bytes \u003cn\u003e`     | Reject `--from-file` queries larger than `n` bytes (default 1 MiB; `0` disables)    |\n| `--pretty`                  | Emit human-readable TOML output (multi-line arrays, expanded tables, blank lines); silently ignored for non-TOML output |\n\nSee [`nesdit --help`](https://sdkks.github.io/nesdit/reference/nesdit/) for the full reference.\n\n## Development\n\n```sh\nmake build      # go build -o bin/nesdit ./cmd/nesdit\nmake test       # go test -race -count=1 ./...\nmake test-e2e   # integration tests (builds first)\nmake test-all   # unit + integration\nmake lint       # golangci-lint run\nmake docs       # generate reference docs + build site\n```\n\nCI runs on Go 1.22 and 1.23 across ubuntu and macOS. A weekly canary job tests against the latest Go toolchain and dependency versions (non-blocking).\n\n## License\n\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdkks%2Fnesdit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdkks%2Fnesdit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdkks%2Fnesdit/lists"}