{"id":20081544,"url":"https://github.com/homeport/yft","last_synced_at":"2025-05-06T00:31:19.703Z","repository":{"id":39165872,"uuid":"233070234","full_name":"homeport/yft","owner":"homeport","description":"/j f t/ - YAML file tool","archived":false,"fork":false,"pushed_at":"2025-04-05T20:20:17.000Z","size":281,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:23:55.181Z","etag":null,"topics":["convenience","gopatch","path","spruce","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/homeport.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":"2020-01-10T15:00:36.000Z","updated_at":"2025-04-05T20:20:20.000Z","dependencies_parsed_at":"2023-10-16T16:43:04.877Z","dependency_job_id":"0ad4b36f-b15f-4296-ada4-763b7e6671ac","html_url":"https://github.com/homeport/yft","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Fyft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Fyft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Fyft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Fyft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homeport","download_url":"https://codeload.github.com/homeport/yft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252598290,"owners_count":21774232,"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":["convenience","gopatch","path","spruce","yaml"],"created_at":"2024-11-13T15:39:25.241Z","updated_at":"2025-05-06T00:31:19.430Z","avatar_url":"https://github.com/homeport.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ytf\n\n[![License](https://img.shields.io/github/license/homeport/yft.svg)](https://github.com/homeport/yft/blob/main/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/homeport/yft)](https://goreportcard.com/report/github.com/homeport/yft)\n[![Tests](https://github.com/homeport/yft/workflows/Tests/badge.svg)](https://github.com/homeport/yft/actions?query=workflow%3A%22Tests%22)\n[![Codecov](https://img.shields.io/codecov/c/github/homeport/yft/main.svg)](https://codecov.io/gh/homeport/yft)\n[![Go Reference](https://pkg.go.dev/badge/github.com/homeport/yft.svg)](https://pkg.go.dev/github.com/homeport/yft)\n[![Release](https://img.shields.io/github/release/homeport/yft.svg)](https://github.com/homeport/yft/releases/latest)\n\n## Introducing YAML File Tool\n\nThe YAML File tool was originally written to serve a CLI for the [`ytbx`](https://github.com/gonvenience/ytbx) Go library. It serves as a convenience layer for the following use cases:\n\n- Support for handling Dot-Style (`some.key.in.structure`) and Go-Patch paths (`/some/key/in/name=structure`)\n- Retrieving a value from a YAML file at a specific location, described by a path\n- Restructure the order of keys in a mapping to be more human friendly and readable\n\n### Notable Use Cases\n\n- Retrieve a value from the YAML file:\n\n  ```sh\n  $ yft get foobar.yml /list/name=one/somekey\n  foobar\n  ```\n\n- Restructure the order of keys in a mapping context to be more readable:\n\n  ```sh\n  $ yft get restructure.yml /\n  releases:\n  - sha1: 5ab3b7e685ca18a47d0b4a16d0e3b60832b0a393\n    name: binary-buildpack\n    version: 1.0.32\n    url: https://bosh.io/d/github.com/cloudfoundry/binary-buildpack-release?v=1.0.32\n\n  $ yft restructure restructure.yml\n  releases:\n  - name: binary-buildpack\n    url: https://bosh.io/d/github.com/cloudfoundry/binary-buildpack-release?v=1.0.32\n    version: 1.0.32\n    sha1: 5ab3b7e685ca18a47d0b4a16d0e3b60832b0a393\n  ```\n\n- List all paths in a YAML file:\n\n  ```sh\n  $ yft paths foobar.yml\n  /list/name=one/somekey\n  /list/name=two/somekey\n  /map/foobar/key\n  ```\n\n- Create a list of paths that are common in two YAML files:\n\n  ```sh\n  $ yft compare foo.yml bar.yml\n  /list/name=one/somekey\n  ```\n\n## How do I get started\n\nThere are different ways to get `yft`. You are free to pick the one that makes the most sense for your use case.\n\n- On macOS systems, a Homebrew tap is available to install `yft`:\n\n  ```sh\n  brew install homeport/tap/yft\n  ```\n\n- Use a convenience script to download the latest release to install it in a suitable location on your local machine:\n\n  ```sh\n  curl -sL https://git.io/JvUjf | bash\n  ```\n\n## Contributing\n\nWe are happy to have other people contributing to the project. If you decide to do that, here's how to:\n\n- get Go (`yft` requires Go version 1.20 or greater)\n- fork the project\n- create a new branch\n- make your changes\n- open a PR.\n\nGit commit messages should be meaningful and follow the rules nicely written down by [Chris Beams](https://chris.beams.io/posts/git-commit/):\n\u003e The seven rules of a great Git commit message\n\u003e\n\u003e 1. Separate subject from body with a blank line\n\u003e 1. Limit the subject line to 50 characters\n\u003e 1. Capitalize the subject line\n\u003e 1. Do not end the subject line with a period\n\u003e 1. Use the imperative mood in the subject line\n\u003e 1. Wrap the body at 72 characters\n\u003e 1. Use the body to explain what and why vs. how\n\n### Running test cases and binaries generation\n\nThere are multiple make targets, but running `all` does everything you want in one call.\n\n```sh\nmake all\n```\n\n### Test it with Linux on your macOS system\n\nBest way is to use Docker to spin up a container:\n\n```sh\ndocker run \\\n  --interactive \\\n  --tty \\\n  --rm \\\n  --volume $GOPATH/src/github.com/homeport/yft:/go/src/github.com/homeport/yft \\\n  --workdir /go/src/github.com/homeport/yft \\\n  golang:1.20 /bin/bash\n```\n\n## License\n\nLicensed under [MIT License](https://github.com/homeport/yft/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomeport%2Fyft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomeport%2Fyft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomeport%2Fyft/lists"}