npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ghgrab/ghgrab

v1.2.0

Published

A terminal-based tool for downloading specific files and folders from GitHub repositories

Readme

ghgrab - "grab anything you want"

A simple, pretty terminal tool that lets you search and download files from GitHub without leaving your CLI.

Rust crates.io npm version PyPI version license

ghgrab demo

ghgrab provides a streamlined command-line interface for cherry-picking specific files or folders from any GitHub repository, powered by the Rust tokio and ratatui ecosystem. Focused on speed and ease of use, it offers a beautiful TUI that lets you grab exactly what you need; all without the wait times of a full git clone.

Why use ghgrab?

  • No more clone-and-delete: Grab exactly what you need, when you need it.
  • Easy on the eyes: A clean terminal interface that makes browsing feel smooth.
  • Works where you are: Installs quickly via NPM, Cargo, or PIP.
  • Find things fast: Quickly search and navigate through any repo's folders with fuzzy search.
  • Repo discovery built in: Type a repo keyword from home to search GitHub repos, filter them, then open instantly.
  • File Preview: Preview source code and text files directly in the TUI.
  • Handles the big stuff: Built-in support for GitHub LFS (Large File Storage).
  • Batch mode: Select a bunch of files and folders to download them all at once.

Installation

NPM

npm install -g @ghgrab/ghgrab

Cargo

cargo install ghgrab

pipx (Recommended for Python)

pipx install ghgrab

Nix

To have the latest commit:

nix run github:abhixdd/ghgrab

To have a specific tagged version:

nix run "github:abhixdd/ghgrab/<tag>"

Quick Start

Just type ghgrab to start browsing:

ghgrab

Or, if you already have a link, just paste it in:

# Browse a repository
ghgrab https://github.com/rust-lang/rust

# Download to current directory directly
ghgrab https://github.com/rust-lang/rust --cwd --no-folder

You can also type a repository keyword on the home screen (for example ratatui) and press Enter to open repository search mode.

CLI Flags

| Flag | Description | | ----------------- | -------------------------------------------------------------------- | | --cwd | Forces download to the current working directory. | | --no-folder | Downloads files directly without creating a subfolder for the repo. | | --token <TOKEN> | Use a specific GitHub token for this run (doesn't save to settings). |

Agent Mode

For scripts, agents, and other non-interactive workflows, ghgrab includes a machine-friendly agent command that prints a stable JSON envelope with api_version, ok, command, and either data or error.

# Fetch the repository tree as JSON
ghgrab agent tree https://github.com/rust-lang/rust

# Fetch the repository tree with an explicit token for scripts or agents
ghgrab agent tree https://github.com/rust-lang/rust --token YOUR_TOKEN

# Download specific paths from a repository
ghgrab agent download https://github.com/rust-lang/rust src/tools README.md --out ./tmp

# Download an explicit subtree
ghgrab agent download https://github.com/rust-lang/rust --subtree src/tools --out ./tmp

# Download the entire repository
ghgrab agent download https://github.com/rust-lang/rust --repo --out ./tmp

# Download into the current working directory without creating a repo folder
ghgrab agent download https://github.com/rust-lang/rust src/tools --cwd --no-folder

You can pass --token <TOKEN> to agent tree and agent download when an external tool, CI job, or coding agent should authenticate without relying on saved local config.

Configuration

To manage your settings:

# Set your token
ghgrab config set token YOUR_TOKEN

# Set a custom download folder
ghgrab config set path "/your/custom/path"

# View your current settings (token is masked)
ghgrab config list

# Remove settings
ghgrab config unset token
ghgrab config unset path

Keyboard Shortcuts (How to move around)

We've kept it pretty standard, but here's a quick cheat sheet:

| Key | Action | | --------------------------------- | ------------------------------------------------------------------------ | | Enter (home) | Open URL or start repository search | | Enter / l / Right (browser) | Enter directory | | Backspace / h / Left | Go back to previous folder | | Delete (home) | Delete character at cursor | | Tab | Auto-fill https://github.com/ (Home page) | | / | Start Searching (File list) | | Esc | Exit Search or Return Home (file list) or Quit (home screen) | | q / Q | Quit (from file list) | | Ctrl+q | Force Quit (anywhere) | | Space | Toggle selection for the current item | | p / P | Preview current file | | a | Select All items | | u | Unselect all items | | d / D | Download selected items | | i | Toggle Icons (Emoji / ASCII) | | g / Home | Jump to Top | | G / End | Jump to Bottom |

Repository Search Mode Shortcuts

| Key | Action | | --------------------- | ------------------------------------------------------------------ | | j / k / / | Move selection | | Enter | Open selected repository | | f | Toggle include/exclude forks | | m | Cycle minimum stars (Any, 10+, 50+, 100+, 500+, 1000+) | | l | Cycle language filter | | s | Cycle sort (Stars, Updated, Name) | | x | Reset all filters | | r | Refresh current search | | Esc | Return to home input |


Join the community

If you find a bug, have an idea for a cool new feature, or just want to help out, we'd love to hear from you! Check out our Contributing Guide to see how you can get involved.

License

Distributed under the MIT License. It's open, free, and yours to play with. See LICENSE for the fine print.