{"id":13581522,"url":"https://github.com/backplane/ghlatest","last_synced_at":"2026-01-21T09:05:16.956Z","repository":{"id":39876603,"uuid":"430181273","full_name":"backplane/ghlatest","owner":"backplane","description":"CLI util for retrieving the latest release from a GitHub repo","archived":false,"fork":false,"pushed_at":"2024-11-18T21:47:15.000Z","size":203,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T10:42:51.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/backplane.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":"2021-11-20T18:36:17.000Z","updated_at":"2024-09-18T10:29:49.000Z","dependencies_parsed_at":"2024-05-16T10:48:36.350Z","dependency_job_id":"00aad904-ec03-4306-9e01-c70b3888d2e1","html_url":"https://github.com/backplane/ghlatest","commit_stats":{"total_commits":62,"total_committers":2,"mean_commits":31.0,"dds":"0.27419354838709675","last_synced_commit":"008c71dbc78a9952537f1f29a2bf21a102fe646f"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/backplane/ghlatest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fghlatest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fghlatest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fghlatest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fghlatest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backplane","download_url":"https://codeload.github.com/backplane/ghlatest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fghlatest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28630939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T15:02:04.284Z","updated_at":"2026-01-21T09:05:16.927Z","avatar_url":"https://github.com/backplane.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# ghlatest\n\nThis is a tool for downloading the latest release of a package from GitHub and optionally extracting the contents.\n\n**NOTE**: This project is not yet ready for production use!\n\n## Installation\n\nThis app is statically compiled for various platforms, binaries can be downloaded from the [ghlatest releases](https://github.com/backplane/ghlatest/releases) page.\n\n**Note:** Your system or container will need to have PKI trust roots of some kind in order to run `ghlatest`. One common package that provides these on unix systems is called `ca-certificates`.\n\n## Usage\n\nThis is the general help text produced by the program. Each command has additional help text available, you can access this text with a command-line like: `ghlatest list -h`\n\n### General Help\n\n```\n$ ghlatest -h\nNAME:\n   ghlatest - Release locator for software on github\n\nUSAGE:\n   ghlatest [global options] command [command options] [arguments...]\n\nVERSION:\n   dev\n\nCOMMANDS:\n   list, ls      list available releases\n   download, dl  download the latest available release\n   json, j       print json doc representing latest release from github api\n   extract, x    Extract files from the given archive (supports zip, gzip, bzip2, xz, 7z, and tar formats)\n   help, h       Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --verbosity value  Sets the verbosity level of the log messages printed by the program, should be one of the following:\n      \"debug\", \"error\", \"fatal\", \"info\", \"panic\", \"trace\", or \"warn\"\n   --help, -h     show help\n   --version, -v  print the version\n```\n\n### Download Help\n\n```\nNAME:\n   ghlatest download - download the latest available release\n\nUSAGE:\n   ghlatest download [command options] [arguments...]\n\nOPTIONS:\n   --filter value, -f value [ --filter value, -f value ]  Filter release assets with the given regular expression\n   --ifilter value, -i value                              Filter release assets with the given CASE-INSENSITIVE regular expression\n   --current-arch                                         Filter release assets with a regex describing the current processor architecture (default: false)\n   --current-os                                           Filter release assets with a regex describing the current operating system (default: false)\n   --source, -s                                           List/download source zip files instead of released assets (default: false)\n   --outputpath value, -o value                           The name of the file to write to\n   --mode value, -m value                                 Set the output file's protection mode (ala chmod) (default: \"0755\")\n   --extract, -x                                          Extract files from the downloaded archive (supports zip, gzip, bzip2, xz, 7z, and tar formats) (default: false)\n   --keep value, -k value [ --keep value, -k value ]      When extracting, only keep the files matching this/these regex(s)\n   --overwrite                                            When extracting, if one of the output files already exists, overwrite it (default: false)\n   --remove-archive, --rm                                 After extracting the archive, delete it (default: false)\n   --help, -h                                             show help\n```\n\n### List Help\n\n```\n$ ghlatest list -h\nNAME:\n   ghlatest list - list available releases\n\nUSAGE:\n   ghlatest list [command options] [arguments...]\n\nOPTIONS:\n   --filter value, -f value [ --filter value, -f value ]  Filter release assets with the given regular expression\n   --ifilter value, -i value                              Filter release assets with the given CASE-INSENSITIVE regular expression\n   --current-arch                                         Filter release assets with a regex describing the current processor architecture (default: false)\n   --current-os                                           Filter release assets with a regex describing the current operating system (default: false)\n   --source, -s                                           List/download source zip files instead of released assets (default: false)\n   --help, -h                                             show help\n```\n\n### Extract Help\n\n```\nNAME:\n   ghlatest extract - Extract files from the given archive (supports zip, gzip, bzip2, xz, 7z, and tar formats)\n\nUSAGE:\n   ghlatest extract [command options] [arguments...]\n\nOPTIONS:\n   --outputpath value, -o value                       The name of the file to write to\n   --mode value, -m value                             Set the output file's protection mode (ala chmod) (default: \"0755\")\n   --keep value, -k value [ --keep value, -k value ]  When extracting, only keep the files matching this/these regex(s)\n   --overwrite                                        When extracting, if one of the output files already exists, overwrite it (default: false)\n   --remove-archive, --rm                             After extracting the archive, delete it (default: false)\n   --help, -h                                         show help\n```\n\n## Example Session\n\nI want to find out the what files are available in the latest release of the repo [`glvnst/snakeeyes`](https://github.com/glvnst/snakeeyes).\n\n```\n$ ghlatest ls glvnst/snakeeyes\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/checksums.txt\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_dragonfly_amd64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_freebsd_amd64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_freebsd_armv7.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_linux_amd64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_linux_arm64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_linux_armv7.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_macOS_all.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_macOS_amd64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_netbsd_amd64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_netbsd_armv7.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_openbsd_amd64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_openbsd_arm64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_openbsd_armv7.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_windows_amd64.zip\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_windows_armv7.zip\n```\n\nI only care about the ones for my current operating system (linux) so I'll filter for those:\n\n```\n$ ghlatest ls --current-os glvnst/snakeeyes\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_linux_amd64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_linux_arm64.tar.gz\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_linux_armv7.tar.gz\n```\n\nI also only want the release for my current processor architecture so I apply that filter as well:\n\n```\n$ ghlatest ls --current-os --current-arch glvnst/snakeeyes\nhttps://github.com/glvnst/snakeeyes/releases/download/v0.2.3/snakeeyes_0.2.3_linux_arm64.tar.gz\n```\n\nNow that I have that down to just a single URL I can change `ls` to `dl` to download the release, I also want to extract it, so I'll add the `--extract` flag:\n\n```\n$ ghlatest dl --current-os --current-arch --extract glvnst/snakeeyes\nINFO[0001] wrote 825399 bytes to snakeeyes_0.2.3_linux_arm64.tar.gz\nINFO[0001] extracting (tgz) snakeeyes_0.2.3_linux_arm64.tar.gz\nINFO[0001] created COPYING mode: 0644\nINFO[0001] created README.md mode: 0644\nINFO[0001] created snakeeyes mode: 0755\nINFO[0001] extraction complete\n$ ls -al\ntotal 3156\ndrwxr-xr-x    6 user     user           192 Feb 20 09:23 .\ndrwxr-xr-x   21 user     user           672 Feb 20 09:23 ..\n-rw-r--r--    1 user     user         34523 Feb 20 09:23 COPYING\n-rw-r--r--    1 user     user          7080 Feb 20 09:23 README.md\n-rwxr-xr-x    1 user     user       2359296 Feb 20 09:23 snakeeyes\n-rwxr-xr-x    1 user     user        825399 Feb 20 09:23 snakeeyes_0.2.3_linux_arm64.tar.gz\n```\n\nThat produced a lot of files that I don't want at the moment. So I'll add a `--keep snakeeyes` filter so that I'm only extracting that solitary file. I'll also add `--rm` to remove the downloaded archive (`snakeeyes_0.2.3_linux_arm64.tar.gz`) after I'm done with it.\n\n```\n$ ghlatest dl --current-os --current-arch --extract --keep snakeeyes --rm glvnst/snakeeyes\nINFO[0001] wrote 825399 bytes to snakeeyes_0.2.3_linux_arm64.tar.gz\nINFO[0001] extracting (tgz) snakeeyes_0.2.3_linux_arm64.tar.gz\nINFO[0001] created snakeeyes mode: 0755\nINFO[0001] extraction complete\nINFO[0001] removed \"snakeeyes_0.2.3_linux_arm64.tar.gz\" after extraction\n$ $ ls -al\ntotal 2304\ndrwxr-xr-x    3 user     user            96 Feb 20 09:26 .\ndrwxr-xr-x   21 user     user           672 Feb 20 09:23 ..\n-rwxr-xr-x    1 user     user       2359296 Feb 20 09:26 snakeeyes\n```\n\nNow that we have a command which produces the file that I want from the latest release of the given GitHub repo, we can use it in scripting contexts or in container infrastructure, such as this `Dockerfile`:\n\n```Dockerfile\nFROM backplane/ghlatest as downloader\nRUN ghlatest dl --current-os --current-arch --extract --keep snakeeyes --rm glvnst/snakeeyes\n\nFROM scratch\nCOPY --from=downloader /work/snakeeyes /\nENTRYPOINT [\"/snakeeyes\"]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackplane%2Fghlatest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackplane%2Fghlatest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackplane%2Fghlatest/lists"}