{"id":19453287,"url":"https://github.com/bianchidotdev/yahr","last_synced_at":"2026-05-06T15:37:43.903Z","repository":{"id":65373812,"uuid":"589785269","full_name":"bianchidotdev/yahr","owner":"bianchidotdev","description":"A simple yaml-based http request CLI (ie. postman for the CLI)","archived":false,"fork":false,"pushed_at":"2023-08-04T00:44:18.000Z","size":93,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T00:34:38.204Z","etag":null,"topics":["cli","curl","http-client","rest-api","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/bianchidotdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-01-16T23:35:03.000Z","updated_at":"2023-02-25T02:15:36.000Z","dependencies_parsed_at":"2024-06-20T16:24:01.046Z","dependency_job_id":"018b63f5-81ef-450e-a6a2-a4fc0f0badf1","html_url":"https://github.com/bianchidotdev/yahr","commit_stats":null,"previous_names":["bianchidotdev/yahr","michaeldbianchi/yahr"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bianchidotdev%2Fyahr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bianchidotdev%2Fyahr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bianchidotdev%2Fyahr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bianchidotdev%2Fyahr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bianchidotdev","download_url":"https://codeload.github.com/bianchidotdev/yahr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240645366,"owners_count":19834405,"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":["cli","curl","http-client","rest-api","yaml"],"created_at":"2024-11-10T17:03:23.764Z","updated_at":"2026-05-06T15:37:38.849Z","avatar_url":"https://github.com/bianchidotdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yahr\n\nYahr (YAml Http Request) is a tool for making HTTP requests based on YAML files.\n\nIt's goal is to provide a simple interface for testing APIs or retrieving data in a structure format (YAML)\nthat is also easy to share with friends and coworkers.\n\nThe primary motivation is to be able to build a set of requests for testing an API that can live\nwithin the repo and be shared by a team of developers. Think Postman or Insomnia with git syncing\nand a CLI interface.\n\n\u003e **Note**\n\u003e This is an alpha project and should not be considered stable\n\n## Features\n\n* Makes HTTP requests (GET, POST, PUT, DELETE)\n* Supports dynamic path parameters\n* Supports sending JSON data\n* Supports custom headers\n* Supports gotemplate in YAML files for more dynamic requests (ie. Auth tokens) + reading from `.env` file`\n\n## Installation\n\n``` sh\ngo install github.com/bianchidotdev/yahr@latest\nyahr -v\n```\n\n\n## Usage\n\n`yahr` will read from the current directory's `./yahr.yaml` file if it exists. You can specify a different\nconfig file with `yahr -c ~/other_yahr_file.yaml` or by using the `YAHR_CONFIG_FILE` environment variable.\n\nList requests and run them:\n\n``` sh\nyahr requests list\n\n# +---------+--------+--------+--------------------------------+\n# | Group   | Name   | Method | Endpoint                       |\n# +---------+--------+--------+--------------------------------+\n# | httpbin | get200 | get    | https://httpbin.org/status/200 |\n# | httpbin | post   | post   | https://httpbin.org/post       |\n# | httpbin | get    | get    | https://httpbin.org/get        |\n# | local   | get    | get    | http://localhost:8080/get      |\n# +---------+--------+--------+--------------------------------+\n\nyahr run httpbin get\n\n# Request:\n# GET /get HTTP/1.1\n# Host: httpbin.org\n# User-Agent: Go-http-client/1.1\n# Accept-Encoding: gzip\n# \n# Status: 200\n# Response Body:\n#  {\n#   \"args\": {},\n#   \"headers\": {\n#     \"Accept-Encoding\": \"gzip\",\n#     \"Host\": \"httpbin.org\",\n#     \"User-Agent\": \"Go-http-client/2.0\",\n#     \"X-Amzn-Trace-Id\": \"Root=1-63cb33d6-0e6501db48f84bf2260e7dc3\"\n#   },\n#   \"origin\": \"89.188.181.42\",\n#   \"url\": \"https://httpbin.org/get\"\n# }\n\n# use the -s silent flag for piping output\n\nyahr run -s httpbin get | jq .origin\n\n# \"89.188.181.42\"\n\n# with dynamic path parameters\n\nyahr -c fixtures/github.yaml run -p owner=bianchidotdev -p repo=yahr -s github get_repo | jq \"{stargazers_count, open_issues}\"\n\n# {\n#   \"stargazers_count\": 0,\n#   \"open_issues\": 0\n# }\n\n```\n\n### Scripting\n\nRight now, `yahr` as a tool can only make a single request at a time.\nHowever, if you are interested in stringing together requests, you can absolutely do that primitively\nthrough using a shell script.\n\nCheck out [examples/series_of_requests.sh](examples/series_of_requests.sh) for a simple example.\n\nIn a future release, I expect to refine the `yahr` core library so it's\nalso possible to use this tool easily within go scripts.\n\n## Reference\n\nYAML spec\n\n``` yaml\nrequests:\n  httpbin:\n    host: httpbin.org\n    requests:\n      get:\n        path: /get\n\n      get200:\n        path: /status/200\n\n      post:\n        path: /post\n        # should we allow yaml map and translate it into json?\n        # how do we deal with non json payloads\n        payload: {\"test_payload\": \"yep. this is a test\"}\n\n  private_server:\n    host: localhost\n    port: 2222\n    scheme: http\n    headers:\n      Authorization: Bearer {{ .PRIVATE_SERVER_ENV_VAR }}_\n    requests:\n      get:\n        path: /opl/health\n```\n\n## Roadmap\n\n* [x] Functional http requests based off yaml file - v0.1.0\n* [ ] brew install\n* [ ] Use of yahr as a go library (not just a cli app) - v0.2.0\n  * [ ] with examples\n* [ ] Environments for changing http config across a series of requests (dev, staging, prod) - v0.3.0\n* [ ] Sequences of requests\n* [ ] Inherit/import from other configuration files\n\nAdditional nice-to-haves:\n* [ ] Output request as curl (maybe in yahr requests show GROUP NAME)\n* [ ] Import from postman/insomnia collection\n* [ ] Import from OpenAPI spec (probably out of scope)\n\n### Anti-features\n\nThis is a set of features I don't foresee ever implementing in this project, usually because I foresee the complexity overwhelming what should be a straightforward tool.\n\n* Arbitrarily nestable groups for deduplication of auth/headers/base-urls\n* Feeding output from one request into another (I think this would be too complex for the codebase and can be done easily with light scripting)\n\n## Contributing\n\nPlease take a look at our [contributing guide](CONTRIBUTING.md).\n\n## Appendix\n\nPotential future spec\n\n``` yaml\nrequests:\n  httpbin:\n    host: httpbin.org\n    requests:\n      get:\n        path: /get\n\n      get200:\n        path: /status/200\n\n      post:\n        path: /post\n        # should we allow yaml map and translate it into json?\n        # how do we deal with non json payloads\n        payload: {\"test_payload\": \"yep. this is a test\"}\n\n  httpbin2:\n    requests:\n      get:\n        path: /get\n\n# TODO: spec out sequences\nsequences:\n\nenvironments:\n  dev:\n    scheme: http\n    host: localhost:2222\n    headers:\n      Authorization: Bearer fake-api-key\n\n  prod:\n    headers:\n      Authorization: Bearer {{ .SECRET_KEY_ENV_VAR }}\n```\n\n``` sh\nyahr run httpbin get -e dev\n# sends GET http://localhost:2222/get with fake-api-key bearer token\n\nyahr run httpbin post -e prod\n# sends POST https://httpbin.org/post with the sample payload and a bearer token from the env var SECRET_KEY_ENV_VAR\n\nyahr run httpbin get200\n# sends GET https://httpbin.org/status/200 with no bearer tokens\n\nyahr run httpbin2 get -e dev\n# sends GET http://localhost:2222/get with fake-api-key bearer token\n\nyahr run httpbin2 get\n# errors because it is missing a required host\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbianchidotdev%2Fyahr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbianchidotdev%2Fyahr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbianchidotdev%2Fyahr/lists"}