{"id":50276058,"url":"https://github.com/chaifeng/ghri","last_synced_at":"2026-05-27T20:32:34.485Z","repository":{"id":329967436,"uuid":"1118291193","full_name":"chaifeng/ghri","owner":"chaifeng","description":"GitHub Release Installer","archived":false,"fork":false,"pushed_at":"2025-12-31T11:25:26.000Z","size":873,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T22:24:16.179Z","etag":null,"topics":["cli","command-line","command-line-tool","package","package-manager"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaifeng.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-17T14:37:01.000Z","updated_at":"2025-12-31T11:22:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chaifeng/ghri","commit_stats":null,"previous_names":["chaifeng/ghri"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chaifeng/ghri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaifeng%2Fghri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaifeng%2Fghri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaifeng%2Fghri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaifeng%2Fghri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaifeng","download_url":"https://codeload.github.com/chaifeng/ghri/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaifeng%2Fghri/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33583394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","command-line","command-line-tool","package","package-manager"],"created_at":"2026-05-27T20:32:33.470Z","updated_at":"2026-05-27T20:32:34.478Z","avatar_url":"https://github.com/chaifeng.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ghri - GitHub Release Installer\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n**ghri** is a command-line tool to download and install binaries from GitHub Releases. It detects your system architecture, downloads the right asset, and manages multiple versions.\n\n## ✨ Features\n\n- 🚀 **One-command install** - Install binaries directly from GitHub Releases\n- 🔄 **Version management** - Install, switch, and manage multiple versions\n- 🔗 **Symlink management** - Create symlinks to any location\n- 🎯 **Smart matching** - Auto-detect system architecture and select the right asset\n- 🔒 **Private repo support** - Access private repos with GitHub Token\n- 📦 **No root needed** - Install to user directory by default\n\n## 📥 Installation\n\n### One-line Install (Recommended)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/chaifeng/ghri/main/install.sh | sh\n```\n\nOr specify a custom bin directory:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/chaifeng/ghri/main/install.sh | sh -s -- /custom/bin/path\n```\n\n### Manual Install\n\n1. Download the archive for your platform from [Releases](https://github.com/chaifeng/ghri/releases)\n2. Extract to any directory\n3. Add the `ghri` binary to your PATH\n\n### Supported Platforms\n\n| OS | Architecture | Filename |\n|----|--------------|----------|\n| macOS | Apple Silicon (M1/M2) | `ghri-*-aarch64-apple-darwin.tar.gz` |\n| macOS | Intel | `ghri-*-x86_64-apple-darwin.tar.gz` |\n| Linux | ARM64 | `ghri-*-aarch64-unknown-linux-gnu.tar.gz` |\n| Linux | x86_64 | `ghri-*-x86_64-unknown-linux-gnu.tar.gz` |\n| Windows | ARM64 | `ghri-*-aarch64-pc-windows-msvc.zip` |\n| Windows | x86_64 | `ghri-*-x86_64-pc-windows-msvc.zip` |\n\n## 🚀 Quick Start\n\n### Install a Package\n\n```bash\n# Install latest stable version\nghri install chaifeng/zidr\n\n# Install a specific version\nghri install chaifeng/zidr@v0.1.0\n\n# Install latest version (including pre-release)\nghri install chaifeng/zidr --pre\n\n# Install a shell script library\nghri install bach-sh/bach\n```\n\n### List Installed Packages\n\n```bash\nghri list\n```\n\n### Show Package Details\n\n```bash\nghri show chaifeng/zidr\n```\n\n### Update Package Info\n\n```bash\n# Update release info for all installed packages\nghri update\n```\n\n## 📖 Commands\n\n### install - Install a Package\n\nInstall a package from a GitHub repository. ghri auto-detects your system and downloads the matching asset.\n\nBefore installing, ghri shows you what files will be downloaded and what changes will be made to your system. You need to confirm before proceeding.\n\n```bash\nghri install \u003cOWNER/REPO[@VERSION]\u003e [OPTIONS]\n```\n\n**Arguments:**\n- `OWNER/REPO` - GitHub repository in `owner/repo` format\n- `@VERSION` - Optional. Specify a version (e.g., `@v1.0.0`)\n\n**Options:**\n- `-f, --filter \u003cPATTERN\u003e` - Filter assets by glob pattern (can use multiple times; matches ANY pattern)\n- `--pre` - Allow installing pre-release versions\n- `-y, --yes` - Skip confirmation prompt\n- `--api-url \u003cURL\u003e` - Custom GitHub API URL (for GitHub Enterprise)\n- `-r, --root \u003cPATH\u003e` - Custom install root directory\n\n**Examples:**\n\n```bash\n# Install zidr (a binary tool)\nghri install chaifeng/zidr\n\n# Install a specific version\nghri install chaifeng/zidr@v0.1.0\n\n# Install bach (Bach Unit Testing Framework)\nghri install bach-sh/bach\n\n# Install a pre-release version\nghri install chaifeng/zidr --pre\n\n# Skip confirmation prompt (useful for scripts)\nghri install chaifeng/zidr -y\n\n# Install to custom directory\nghri install bach-sh/bach --root ~/src/my-project/vendor # Install bach-sh/bach to your project's vendor directory\nghri install chaifeng/zidr --root ~/my-apps\n```\n\n### list - List Installed Packages\n\n```bash\nghri list\n```\n\nExample output:\n```\nbach-sh/bach    v1.0.0 (current)\nchaifeng/zidr   v0.1.0 (current)\n```\n\n### show - Show Package Details\n\n```bash\nghri show chaifeng/zidr\n```\n\nShows detailed info about a package:\n- Current version\n- All installed versions\n- Symlink rules\n- Metadata\n\n### update - Update Release Info\n\nFetch latest release info from GitHub API for installed packages.\n\n```bash\nghri update [OWNER/REPO]...\n```\n\n**Arguments:**\n- `OWNER/REPO` - Optional. Packages to update. If not specified, updates all installed packages.\n\n**Examples:**\n\n```bash\n# Update all installed packages\nghri update\n\n# Update specific packages only\nghri update chaifeng/zidr bach-sh/bach\n```\n\nThis does not upgrade packages. It only updates the local release info cache. To upgrade, run `ghri install` again.\n\n### link - Create Symlinks\n\nLink files from an installed package to a destination path.\n\n```bash\nghri link \u003cOWNER/REPO[@VERSION][:PATH]\u003e \u003cDEST\u003e\n```\n\n**Arguments:**\n- `OWNER/REPO` - Package name\n- `@VERSION` - Optional. Specify a version (default: current)\n- `:PATH` - Optional. File path inside the package\n- `DEST` - Destination path for the symlink\n\n**Version Behavior:**\n- **Without version** (`owner/repo:file`) - Link follows the `current` symlink. When you install a new version, the link auto-updates to the new version.\n- **With version** (`owner/repo@v1.0.0:file`) - Link points to that specific version. It stays unchanged when you install new versions.\n\n**Link Uniqueness:**\nEach destination path can only have one link type. If you create a versioned link to a destination that already has a default link, the default link record is removed (and vice versa).\n\n**Examples:**\n\n```bash\n# Link zidr binary to ~/.local/bin/zidr (auto-updates on new install)\nghri link chaifeng/zidr:zidr ~/.local/bin/zidr\n\n# Link bach.sh to your project's test directory (auto-updates)\nghri link bach-sh/bach:bach.sh ~/my-project/test/bach.sh\n\n# Install and link bach.sh to your project's test directory\nghri --root ~/src/my-project/vendor link bach-sh/bach:bach.sh ~/src/my-project/tests/bach.sh\n\n\n# Link a specific version (stays at v0.1.0 forever)\nghri link chaifeng/zidr@v0.1.0:zidr ~/.local/bin/zidr\n```\n\n### unlink - Remove Symlinks\n\nRemove symlinks and link rules.\n\n```bash\nghri unlink \u003cOWNER/REPO[:PATH]\u003e [DEST] [OPTIONS]\n```\n\n**Options:**\n- `-a, --all` - Remove all link rules for the package\n\n**Examples:**\n\n```bash\n# Remove a specific link\nghri unlink chaifeng/zidr ~/.local/bin/zidr\n\n# Remove all links for a package\nghri unlink bach-sh/bach --all\n```\n\n### links - Show Link Rules\n\nShow all symlink rules for a package.\n\n```bash\nghri links chaifeng/zidr\n```\n\n### remove - Remove a Package\n\nRemove an installed package or a specific version.\n\nBefore removing, ghri shows you what files and directories will be deleted. You need to confirm before proceeding.\n\n```bash\nghri remove \u003cOWNER/REPO[@VERSION]\u003e [OPTIONS]\n```\n\n**Options:**\n- `-f, --force` - Force removal of current version\n- `-y, --yes` - Skip confirmation prompt\n\n**Examples:**\n\n```bash\n# Remove entire package\nghri remove chaifeng/zidr\n\n# Remove a specific version\nghri remove chaifeng/zidr@v0.1.0\n\n# Force remove current version\nghri remove chaifeng/zidr@v0.1.0 --force\n\n# Skip confirmation (useful for scripts)\nghri remove bach-sh/bach -y\n```\n\n## ⚙️ Configuration\n\n### Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `GHRI_ROOT` | Install root directory | `~/.ghri` |\n| `GHRI_API_URL` | GitHub API URL | `https://api.github.com` |\n| `GITHUB_TOKEN` | GitHub access token | - |\n\n### GitHub Token\n\nSet `GITHUB_TOKEN` to:\n- Access private repositories\n- Increase API rate limit (from 60/hour to 5000/hour)\n\n```bash\nexport GITHUB_TOKEN=ghp_xxxxxxxxxxxx\n```\n\n### Directory Structure\n\nghri stores installed packages in this structure:\n\n```\n~/.ghri/\n├── owner1/\n│   └── repo1/\n│       ├── meta.json          # Metadata file\n│       ├── current -\u003e v1.0.0  # Current version symlink\n│       ├── v1.0.0/            # Version directory\n│       │   └── ...            # Extracted files\n│       └── v0.9.0/\n│           └── ...\n└── owner2/\n    └── repo2/\n        └── ...\n```\n\n## 🔧 Advanced Usage\n\n### Using Filters\n\nWhen a release has multiple assets, ghri tries to auto-match your system. If auto-match fails or you want a specific build, use `--filter`:\n\n```bash\n# Select musl static build\nghri install chaifeng/zidr --filter \"*musl*\"\n\n# Match multiple patterns (OR logic)\n# This will match assets containing \"aarch64\" OR \"x86_64\"\nghri install chaifeng/zidr --filter \"*aarch64*\" --filter \"*x86_64*\"\n```\n\nFilters are saved to metadata. They apply automatically on future updates.\n\n### GitHub Enterprise Support\n\nFor GitHub Enterprise servers, use `--api-url`:\n\n```bash\nghri install myorg/myrepo --api-url https://github.mycompany.com/api/v3\n```\n\nOr set the environment variable:\n\n```bash\nexport GHRI_API_URL=https://github.mycompany.com/api/v3\nghri install myorg/myrepo\n```\n\n### Custom Install Directory\n\n```bash\n# Use once\nghri install chaifeng/zidr --root ~/my-apps\n\n# Or set environment variable\nexport GHRI_ROOT=~/my-apps\nghri install chaifeng/zidr\n```\n\n### Switch Versions\n\nghri supports multiple versions. You can switch between them:\n\n```bash\n# Install multiple versions\nghri install chaifeng/zidr@v0.1.0\nghri install chaifeng/zidr@v0.2.0\n\n# Switch back to old version (re-install updates the current link)\nghri install chaifeng/zidr@v0.1.0\n```\n\n## 👨‍💻 Development\n\n### Pre-commit Hooks\n\nThis project uses [pre-commit](https://pre-commit.com/) to ensure code quality. The hooks verify:\n- ✅ Code compiles without warnings\n- ✅ Clippy lints pass\n- ✅ Code formatting is correct\n- ✅ Tests pass\n\n#### Setup\n\n1. Install pre-commit:\n   ```bash\n   # macOS\n   brew install pre-commit\n   \n   # or using pip\n   pip install pre-commit\n   ```\n\n2. Install the git hooks:\n   ```bash\n   pre-commit install\n   ```\n\n3. (Optional) Run hooks manually on all files:\n   ```bash\n   pre-commit run --all-files\n   ```\n\nNow, every time you `git commit`, the hooks will run automatically. If any check fails, the commit will be blocked until you fix the issues.\n\n#### What Each Hook Does\n\n- **cargo check** - Compiles with `-D warnings` to treat all warnings as errors\n- **cargo clippy** - Runs Rust linter with `-D warnings`\n- **cargo fmt** - Checks code formatting\n- **cargo test** - Runs all tests\n\n#### Skip Specific Hooks\n\nTo temporarily skip specific hooks during commit:\n\n```bash\n# Skip only cargo-clippy and cargo-fmt\nSKIP=cargo-clippy,cargo-fmt git commit -m \"your message\"\n\n# Skip only cargo-test (useful for quick WIP commits)\nSKIP=cargo-test git commit -m \"WIP: work in progress\"\n\n# Skip all pre-commit hooks (not recommended)\ngit commit --no-verify -m \"your message\"\n```\n\n### Manual Verification\n\nIf you prefer not to use pre-commit, ensure your code passes these checks before committing:\n\n```bash\n# Check compilation without warnings\nRUSTFLAGS=\"-D warnings\" cargo check --all-targets --all-features\n\n# Run clippy\ncargo clippy --all-targets --all-features -- -D warnings\n\n# Check formatting\ncargo fmt --all -- --check\n\n# Run tests\ncargo test --all-features\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Feel free to open issues or pull requests.\n\n## 📄 License\n\nThis project is licensed under [GNU General Public License v3.0](LICENSE).\n\n---\n\n**ghri** - Install GitHub Releases with ease 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaifeng%2Fghri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaifeng%2Fghri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaifeng%2Fghri/lists"}