{"id":15404542,"url":"https://github.com/k1low/viagh","last_synced_at":"2025-03-28T01:51:53.027Z","repository":{"id":45280101,"uuid":"426472850","full_name":"k1LoW/viagh","owner":"k1LoW","description":":octocat: http.Client that makes API requests via the `gh` command","archived":false,"fork":false,"pushed_at":"2021-12-24T19:09:43.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T03:29:48.211Z","etag":null,"topics":["github","github-api","golang"],"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/k1LoW.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}},"created_at":"2021-11-10T03:33:40.000Z","updated_at":"2021-12-24T19:09:46.000Z","dependencies_parsed_at":"2022-08-04T13:15:33.888Z","dependency_job_id":null,"html_url":"https://github.com/k1LoW/viagh","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fviagh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fviagh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fviagh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fviagh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k1LoW","download_url":"https://codeload.github.com/k1LoW/viagh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245955158,"owners_count":20699887,"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":["github","github-api","golang"],"created_at":"2024-10-01T16:13:37.554Z","updated_at":"2025-03-28T01:51:53.008Z","avatar_url":"https://github.com/k1LoW.png","language":"Go","readme":"# viagh [![build](https://github.com/k1LoW/viagh/actions/workflows/ci.yml/badge.svg)](https://github.com/k1LoW/viagh/actions/workflows/ci.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/k1LoW/viagh.svg)](https://pkg.go.dev/github.com/k1LoW/viagh)\n\n:octocat: `viagh.NewHTTPClient` returns a `*http.Client` that makes API requests via the `gh` command.\n\n## Why viagh?\n\nWhen writing a GitHub CLI extension, the extension needs to exec the `gh` command internally to execute API requests with credentials.\n\nBy using `http.Client` that executes API requests via the `gh` command, you can use existing useful packages such as [go-github](https://github.com/google/go-github) without modification.\n\n## Usage\n\n``` go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/google/go-github/v39/github\"\n\t\"github.com/k1LoW/viagh\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclient, _ := viagh.NewHTTPClient()\n\tgh := github.NewClient(client)\n\n\tu, _, _ := gh.Users.Get(ctx, \"k1LoW\")\n\tfmt.Println(u.GetLogin())\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fviagh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk1low%2Fviagh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fviagh/lists"}