{"id":22358926,"url":"https://github.com/semihbkgr/yamldiff","last_synced_at":"2025-07-30T12:32:17.430Z","repository":{"id":216002571,"uuid":"729291495","full_name":"semihbkgr/yamldiff","owner":"semihbkgr","description":"compare structural differences between two yaml files","archived":false,"fork":false,"pushed_at":"2024-11-05T11:07:34.000Z","size":561,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-16T14:35:47.756Z","etag":null,"topics":["command-line","diff","tools","utility","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/semihbkgr.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":"2023-12-08T20:29:41.000Z","updated_at":"2024-11-05T11:14:46.000Z","dependencies_parsed_at":"2024-04-29T03:46:14.768Z","dependency_job_id":"3c0a2759-5e98-4143-a95b-b7b97bac68d6","html_url":"https://github.com/semihbkgr/yamldiff","commit_stats":null,"previous_names":["semihbkgr/yamldiff"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbkgr%2Fyamldiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbkgr%2Fyamldiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbkgr%2Fyamldiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbkgr%2Fyamldiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semihbkgr","download_url":"https://codeload.github.com/semihbkgr/yamldiff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228133608,"owners_count":17874511,"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":["command-line","diff","tools","utility","yaml"],"created_at":"2024-12-04T15:18:21.636Z","updated_at":"2025-07-30T12:32:17.399Z","avatar_url":"https://github.com/semihbkgr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yamldiff\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/semihbkgr/yamldiff.svg)](https://pkg.go.dev/github.com/semihbkgr/yamldiff)\n[![Go CI](https://github.com/semihbkgr/yamldiff/actions/workflows/ci.yaml/badge.svg)](https://github.com/semihbkgr/yamldiff/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/semihbkgr/yamldiff/graph/badge.svg?token=3DYZXV89VE)](https://codecov.io/gh/semihbkgr/yamldiff)\n\n`yamldiff` is a utility tool for comparing YAML files and highlighting structural changes with clarity and precision. It produces clear visual output that shows exactly what has been added, removed, or modified, making it easier to track configuration updates, analyze deployment differences, and debug YAML structures.\n\n![example](images/example.png)\n\n## Key Features\n\n- **Structural comparison** - Detects changes in YAML data structure, layout, and values\n- **Rich visual output** - Colored diff display with customizable formatting  \n- **Flexible reporting** - Detailed diffs, paths-only view, summary counts, or metadata including line numbers and value types\n- **Library support** - Import as a Go module for programmatic use\n\n## Installation\n\nInstall `yamldiff` using Go's package manager:\n\n```bash\ngo install github.com/semihbkgr/yamldiff@latest\n```\n\n## Quick Start\n\nCompare two YAML files with a simple command:\n\n```bash\nyamldiff file1.yaml file2.yaml\n```\n\nFor a complete list of options and flags:\n\n```bash\nyamldiff --help\n```\n\n## Usage\n\n```text\nstructural comparison on two yaml files\n\nUsage:\n  yamldiff [flags] \u003cfile-left\u003e \u003cfile-right\u003e\n\nFlags:\n      --color string   When to use color output. It can be one of always, never, or auto. (default \"auto\")\n  -c, --counts         Display a summary count of total added, deleted, and modified items\n  -e, --exit-code      Exit with non-zero status code when differences are found\n  -h, --help           help for yamldiff\n  -i, --ignore-order   Ignore sequence order when comparing\n  -m, --metadata       Include additional metadata such as line numbers and node types in the output. (mutually exclusive with --paths-only)\n  -p, --paths-only     Show only paths of differences without displaying the values\n  -v, --version        version for yamldiff\n```\n\n## Examples\n\n### Basic Comparison with Metadata\n\n```bash\nyamldiff --metadata examples/pod-v1.yaml examples/pod-v2.yaml\n```\n\n![example-metadata](images/example-metadata.png)\n\n### Paths-Only View with Summary\n\n```bash\nyamldiff --paths-only --counts examples/pod-v1.yaml examples/pod-v2.yaml\n```\n\n![example-paths-only](images/example-pathsOnly.png)\n\n### Additional Examples\n\n```bash\n# Ignore sequence order when comparing arrays\n$ yamldiff --ignore-order config1.yaml config2.yaml\n\n# Get only a summary count of differences\n$ yamldiff --counts deployment-old.yaml deployment-new.yaml\n\n# Exit with non-zero code if differences found (useful for CI/CD)\n$ yamldiff --exit-code expected.yaml actual.yaml\n```\n\n## Library Usage\n\nThe `yamldiff` package can be integrated into your Go applications for programmatic YAML comparison:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/semihbkgr/yamldiff/pkg/diff\"\n)\n\nfunc main() {\n    left := []byte(`\nname: Alice\ncity: New York\nitems:\n  - one\n  - two\n`)\n\n    right := []byte(`\nname: Bob\nvalue: 990\nitems:\n  - one\n  - three\n`)\n\n    diffs, err := diff.Compare(left, right)\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Println(diffs.Format(diff.Plain))\n}\n```\n\n**Output:**\n\n```text\n~ .name: Alice → Bob\n- .city: New York\n+ .value: 990\n~ .items[1]: two → three\n```\n\n### API Reference\n\nFor detailed API documentation, visit [pkg.go.dev](https://pkg.go.dev/github.com/semihbkgr/yamldiff).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemihbkgr%2Fyamldiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemihbkgr%2Fyamldiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemihbkgr%2Fyamldiff/lists"}