{"id":27961920,"url":"https://github.com/rgeraskin/godiffyaml","last_synced_at":"2025-08-19T20:17:06.054Z","repository":{"id":291313858,"uuid":"977248157","full_name":"rgeraskin/godiffyaml","owner":"rgeraskin","description":"Human-readable diffs for yamls with multiple documents","archived":false,"fork":false,"pushed_at":"2025-05-05T23:27:01.000Z","size":433,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T19:13:05.800Z","etag":null,"topics":["diff","k8s","kubernetes","yaml"],"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/rgeraskin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.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}},"created_at":"2025-05-03T18:58:28.000Z","updated_at":"2025-05-06T10:33:56.000Z","dependencies_parsed_at":"2025-05-07T19:13:05.925Z","dependency_job_id":null,"html_url":"https://github.com/rgeraskin/godiffyaml","commit_stats":null,"previous_names":["rgeraskin/godiffyaml"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rgeraskin/godiffyaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fgodiffyaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fgodiffyaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fgodiffyaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fgodiffyaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgeraskin","download_url":"https://codeload.github.com/rgeraskin/godiffyaml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fgodiffyaml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271215037,"owners_count":24720098,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"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":["diff","k8s","kubernetes","yaml"],"created_at":"2025-05-07T19:13:03.523Z","updated_at":"2025-08-19T20:17:06.031Z","avatar_url":"https://github.com/rgeraskin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# godiffyaml\n\nHuman-readable diffs for yamls with multiple documents.\n\n![Demo](./demo.gif)\n\n**godiffyaml** is a command-line tool for generating pretty diffs of YAML files, with special support for Kubernetes manifests and sorting YAML documents. It leverages [difftastic](https://github.com/Wilfred/difftastic) for visually rich and accurate diffs.\n\nIt can split multi-document YAML files into documents and diff them document-by-document using custom keys. This makes the diff to be human-readable and easier to understand.\n\nCheck out my blog post [here](https://blog.rgeraskin.dev/godiffyaml) for more details.\n\n## Features\n\n- **Diff YAML files**: Split multi-document YAML files and diff them document-by-document using custom keys.\n- **Kubernetes-aware diff**: Diff Kubernetes manifests using `apiVersion`, `kind`, `metadata.namespace`, and `metadata.name` as document keys.\n- **Sort YAML documents**: Output YAML files with documents sorted by specified fields.\n- **Rich diff output**: Uses difftastic for side-by-side, inline, or JSON diff views.\n\n## Installation\n\n### Homebrew\n\n```sh\nbrew install rgeraskin/homebrew/godiffyaml\n```\n\n### Go\n\n[Difftastic](https://github.com/Wilfred/difftastic) is required to run `diff` and `k8s` subcommands.\n\n```sh\ngo install github.com/rgeraskin/godiffyaml/cmd/godiffyaml@master\n```\n\n## Build from source\n\n```sh\ngit clone https://github.com/rgeraskin/godiffyaml.git\ncd godiffyaml\ngo build -o godiffyaml ./cmd/godiffyaml\n```\n\n## Usage\n\n```\ngodiffyaml \u003csubcommand\u003e [options] \u003cfile(s)\u003e\n```\n\n### Subcommands\n\n#### `diff`\n\nDiff two YAML files by splitting them into documents and comparing each document by custom keys.\n\n```\ngodiffyaml diff --paths=key1,key2 \u003cfile1.yaml\u003e \u003cfile2.yaml\u003e\n```\n\n- `--paths`: Comma-separated list of YAML paths to use as document keys (required).\n- `--display`: Output format (`side-by-side`, `side-by-side-show-both`, `inline`, `json`). Default: `side-by-side-show-both`.\n\n#### `k8s`\n\nDiff two Kubernetes YAML files using `apiVersion,kind,metadata.namespace,metadata.name` as keys.\n\n```\ngodiffyaml k8s \u003cfile1.yaml\u003e \u003cfile2.yaml\u003e\n```\n\n- `--display`: Output format (see above).\n\n#### `sort`\n\nSort documents in a YAML file by specified fields and print to stdout.\n\n```\ngodiffyaml sort --order=field1,field2 \u003cfile.yaml\u003e\n```\n\n- `--order`: Comma-separated list of fields to sort by.\n\n### Passing difftastic options\n\nAll unrecognized flags are passed directly to difftastic (except `--display`). Use `--flag=value` notation.\n\n## Example\n\n```sh\ngodiffyaml diff --paths=kind,metadata.name a.yaml b.yaml\ngodiffyaml k8s a.yaml b.yaml\ngodiffyaml sort --order=kind,metadata.name a.yaml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgeraskin%2Fgodiffyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgeraskin%2Fgodiffyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgeraskin%2Fgodiffyaml/lists"}