{"id":21605979,"url":"https://github.com/archf/ghi","last_synced_at":"2025-04-11T04:04:07.154Z","repository":{"id":56720025,"uuid":"202149506","full_name":"archf/ghi","owner":"archf","description":"Retrieve and install software from a GitHub release downloadable assets","archived":false,"fork":false,"pushed_at":"2019-08-29T12:52:26.000Z","size":17,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T04:04:02.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/archf.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}},"created_at":"2019-08-13T13:21:57.000Z","updated_at":"2024-06-04T04:21:45.000Z","dependencies_parsed_at":"2022-08-16T00:20:09.961Z","dependency_job_id":null,"html_url":"https://github.com/archf/ghi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archf%2Fghi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archf%2Fghi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archf%2Fghi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archf%2Fghi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/archf","download_url":"https://codeload.github.com/archf/ghi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339286,"owners_count":21087215,"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":[],"created_at":"2024-11-24T20:18:25.632Z","updated_at":"2025-04-11T04:04:07.133Z","avatar_url":"https://github.com/archf.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ghi\n\n`ghi` retrieve and install software from a GitHub release downloadable assets.\n\n## Installation\n\nClone this repository somewhere and put this script in your PATH.\n\n```bash\ngit clone git@github.com:archf/ghi.git\n```\n\nThis script needs to be placed in the sudoers 'secure_path' to allow for\npriviledged mode execution and thus installation of archives (`.deb`)\nand/or unpacking of tarballs in some paths.\n\nQuickly create that symlink in `/usr/local/bin`:\n\n```bash\nsudo make install\n```\n\n## Uninstallation\n\n```bash\nsudo make uninstall\n```\n\n## Usage\n\n```\nNo repositories specified, defaulting to current project repository.\nGHI\n  A custom git command to install software from a github release.\n  See https://github.com/archf/git-pkg.\n\nLimitations\nUsing the 'latest' release will only work if the release is not tagged as a\n'draft' or 'prerelease'.\n\nUSAGE\n  ghi [OPTIONS] CMD [PATTERN]\n\nOPTIONS\n  -h|--help       Show this help menu.\n  -t|--tag        Output latest release 'tag_name' and exit.\n  -r|--repository Set Github repository in the '\u003cuser|org\u003e/\u003crepository_name\u003e'\n                  Defaults to use .git/config file.\n                  setting in your project directory.\n  --assets-dir    Directory where to download archives. Defaults to '~/.ghi'.\n                  This allows for later easy removal of installed software.\n  -p|--prefix     Directory where to unpack a tar archive. Defaults to\n                  '/usr/local' when this script is ran in priviledged mode,\n                  '~/' otherwise.  If the tar contains a standalone binary\n                  executable one would tipically set this to\n                  '/usr/local/bin' or '~/bin'.\n  -v|--verbose\n\nCMD\n  install     Install/unpack software from downloadable assets.\n  search      Search for assets\n  help        Show this help menu.\n```\n\n### Search all assets of latest release\n\n```\n\u003e ghi search --repository sharkdp/hyperfine\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-musl_1.6.0_amd64.deb\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-musl_1.6.0_i386.deb\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-v1.6.0-i686-unknown-linux-gnu.tar.gz\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-v1.6.0-i686-unknown-linux-musl.tar.gz\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-v1.6.0-x86_64-apple-darwin.tar.gz\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-v1.6.0-x86_64-pc-windows-msvc.zip\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-v1.6.0-x86_64-unknown-linux-gnu.tar.gz\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-v1.6.0-x86_64-unknown-linux-musl.tar.gz\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine_1.6.0_amd64.deb\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine_1.6.0_i386.deb\n```\n\n### Search for assets matching specific PATTERN\n\n```\n\u003e ghi search --repository sharkdp/hyperfine deb\n\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-musl_1.6.0_amd64.deb\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine-musl_1.6.0_i386.deb\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine_1.6.0_amd64.deb\nhttps://github.com/sharkdp/hyperfine/releases/download/v1.6.0/hyperfine_1.6.0_i386.deb\n```\n\n### Installing a specific archive\n\n```\n\u003e ./ghi install -r fgeller/kt\nError: too many possible asset to download. Current matches are:\n\nhttps://github.com/fgeller/kt/releases/download/v12.1.0/kt-v12.1.0-darwin-amd64.txz\nhttps://github.com/fgeller/kt/releases/download/v12.1.0/kt-v12.1.0-linux-amd64.txz\n\nConsider using a more specific asset filtering PATTERN than '.*'.\n```\n\nNow if we input a filtering PATTERN\n\n```\n\u003e ghi install -r fgeller/kt 'linux-amd64.txz'\nInstalling\nhttps://github.com/fgeller/kt/releases/download/v12.1.0/kt-v12.1.0-linux-amd64.txz\nfrom repository 'fgeller/kt'\n```\n\n### Get latest release's tag\n\n```\n\u003e ghi search --tag --repository sharkdp/hyperfine\nv1.6.0\n```\n\n## TODO\n\n- choosing a release other than latest\n- handle tarbals containing a directory and/or multiple files\n- add a show command to list content of downloaded archives\n- handle rpms\n\n## Other tools worth mentioning\n\nThis is inpired heavily from [ghr](https://github.com/tcnksm/ghr), a tool doing\nthe reverse operation, i.e: create a GitHub Release and upload artifacts in\nparallel.\n\nOther notable tools:\n- [hub](https://github.com/github/hub) - a git wrapper that makes git easier to use with GitHub\n- [github-release](https://github.com/aktau/github-release)\n- [gothub](https://github.com/itchio/gothub) (a fork of aktau/gitub-release)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchf%2Fghi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchf%2Fghi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchf%2Fghi/lists"}