{"id":13562774,"url":"https://github.com/cli/go-gh","last_synced_at":"2025-05-14T03:07:13.293Z","repository":{"id":37423297,"uuid":"401809473","full_name":"cli/go-gh","owner":"cli","description":"A Go module for interacting with gh and the GitHub API from the command line. ","archived":false,"fork":false,"pushed_at":"2025-03-31T14:38:25.000Z","size":472,"stargazers_count":361,"open_issues_count":18,"forks_count":54,"subscribers_count":13,"default_branch":"trunk","last_synced_at":"2025-04-10T23:12:11.581Z","etag":null,"topics":["cli","github","golang"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/cli/go-gh/v2","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/cli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE-OF-CONDUCT.md","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":"2021-08-31T18:44:31.000Z","updated_at":"2025-04-10T17:44:41.000Z","dependencies_parsed_at":"2024-01-22T17:14:44.504Z","dependency_job_id":"b187fa5b-f7d5-4d1a-b884-1f30045f1331","html_url":"https://github.com/cli/go-gh","commit_stats":{"total_commits":158,"total_committers":24,"mean_commits":6.583333333333333,"dds":0.5189873417721519,"last_synced_commit":"65bd8d766abd062846dd5cffe21defab7c0fe4c5"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cli%2Fgo-gh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cli%2Fgo-gh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cli%2Fgo-gh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cli%2Fgo-gh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cli","download_url":"https://codeload.github.com/cli/go-gh/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312135,"owners_count":21082638,"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","github","golang"],"created_at":"2024-08-01T13:01:12.142Z","updated_at":"2025-04-10T23:12:35.161Z","avatar_url":"https://github.com/cli.png","language":"Go","readme":"# Go library for the GitHub CLI\n\n`go-gh` is a collection of Go modules to make authoring [GitHub CLI extensions][extensions] easier.\n\nModules from this library will obey GitHub CLI conventions by default:\n\n- [`repository.Current()`](https://pkg.go.dev/github.com/cli/go-gh/v2/pkg/repository#current) respects the value of the `GH_REPO` environment variable and reads from git remote configuration as fallback.\n\n- GitHub API requests will be authenticated using the same mechanism as `gh`, i.e. using the values of `GH_TOKEN` and `GH_HOST` environment variables and falling back to the user's stored OAuth token.\n\n- [Terminal capabilities](https://pkg.go.dev/github.com/cli/go-gh/v2/pkg/term) are determined by taking environment variables `GH_FORCE_TTY`, `NO_COLOR`, `CLICOLOR`, etc. into account.\n\n- Generating [table](https://pkg.go.dev/github.com/cli/go-gh/v2/pkg/tableprinter) or [Go template](https://pkg.go.dev/github.com/cli/go-gh/pkg/template) output uses the same engine as gh.\n\n- The [`browser`](https://pkg.go.dev/github.com/cli/go-gh/v2/pkg/browser) module activates the user's preferred web browser.\n\n## Usage\n\nSee the full `go-gh`  [reference documentation](https://pkg.go.dev/github.com/cli/go-gh/v2) for more information\n\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"github.com/cli/go-gh/v2\"\n\t\"github.com/cli/go-gh/v2/pkg/api\"\n)\n\nfunc main() {\n\t// These examples assume `gh` is installed and has been authenticated.\n\n\t// Shell out to a gh command and read its output.\n\tissueList, _, err := gh.Exec(\"issue\", \"list\", \"--repo\", \"cli/cli\", \"--limit\", \"5\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(issueList.String())\n\n\t// Use an API client to retrieve repository tags.\n\tclient, err := api.DefaultRESTClient()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tresponse := []struct{\n\t\tName string\n\t}{}\n\terr = client.Get(\"repos/cli/cli/tags\", \u0026response)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(response)\n}\n```\n\nSee [examples][] for more demonstrations of usage.\n\n## Contributing\n\nIf anything feels off, or if you feel that some functionality is missing, please check out our [contributing docs][contributing]. There you will find instructions for sharing your feedback and for submitting pull requests to the project. Thank you!\n\n[extensions]: https://docs.github.com/en/github-cli/github-cli/creating-github-cli-extensions\n[examples]: ./example_gh_test.go\n[contributing]: ./.github/CONTRIBUTING.md\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcli%2Fgo-gh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcli%2Fgo-gh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcli%2Fgo-gh/lists"}