ghgrab

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ghgrab

ghgrab

Use this skill when users need to quickly fetch selected files/folders/release assets from GitHub in terminal workflows.
当用户需要在终端工作流中快速从GitHub获取选定的文件/文件夹/发布资产时,可使用此工具。

When to use

使用场景

  • "GitHub에서 파일 몇 개만 가져오고 싶다"
  • Full clone is too heavy for one-off extraction
  • Need interactive repository navigation/search from CLI
  • Need release artifact download without browser
  • "只想从GitHub获取几个文件"
  • 完整克隆对于一次性提取来说过于臃肿
  • 需要从CLI进行交互式仓库导航/搜索
  • 无需浏览器即可下载发布制品

Instructions

操作步骤

Step 1: Verify availability and install path

步骤1:检查可用性并安装

bash
command -v ghgrab || true
If missing, choose one installer:
bash
undefined
bash
command -v ghgrab || true
如果未安装,选择以下一种安装方式:
bash
undefined

npm

npm

npm install -g @ghgrab/ghgrab
npm install -g @ghgrab/ghgrab

cargo

cargo

cargo install ghgrab
cargo install ghgrab

pipx

pipx

pipx install ghgrab

Then verify:

```bash
ghgrab --help
pipx install ghgrab

然后验证安装:

```bash
ghgrab --help

Step 2: Start in interactive mode or open a target repo directly

步骤2:启动交互式模式或直接打开目标仓库

bash
undefined
bash
undefined

interactive home

交互式首页

ghgrab
ghgrab

open repo directly

直接打开仓库

Step 3: Use selective download flow

步骤3:选择性下载流程

  • Navigate/search inside repository tree
  • Select only required files/folders
  • Download into current working directory (or tool prompt target)
  • Prefer small, explicit selections over bulk pulls
  • 在仓库目录树中导航/搜索
  • 仅选择所需的文件/文件夹
  • 下载到当前工作目录(或工具提示的目标路径)
  • 优先选择小范围、明确的选择,而非批量拉取

Step 4: Release artifact mode

步骤4:发布制品模式

When user needs binary assets from GitHub Releases, use ghgrab release selection mode (OS/arch-aware options if shown by tool).
当用户需要从GitHub Releases获取二进制资产时,使用ghgrab的发布选择模式(若工具显示,可选择适配操作系统/架构的选项)。

Step 5: Automation guardrails

步骤5:自动化安全准则

  • Confirm destination path before writing files
  • Prefer non-destructive paths (new folder) when unsure
  • Log selected source repo and destination in run notes for reproducibility
  • 写入文件前确认目标路径
  • 不确定时优先使用非破坏性路径(新文件夹)
  • 在运行记录中记录所选源仓库和目标路径,以便复现操作

Examples

示例

bash
undefined
bash
undefined

Browse then cherry-pick files

浏览后精选文件

Start home and search repos interactively

启动首页并交互式搜索仓库

ghgrab
undefined
ghgrab
undefined

Pitfalls

注意事项

  • Installing multiple package-manager variants can shadow binary paths; check
    which ghgrab
    .
  • Private repositories require valid GitHub auth/session context.
  • Avoid using ghgrab as a substitute for full repo history operations (use git clone when history/branch operations are required).
  • 安装多个包管理器版本可能会覆盖二进制文件路径;请检查
    which ghgrab
  • 私有仓库需要有效的GitHub认证/会话环境。
  • 避免将ghgrab作为完整仓库历史操作的替代方案(需要历史/分支操作时请使用git clone)。