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

ghqcd

v0.1.6

Published

Pick a ghq repository with fzf and cd into it.

Readme

ghqcd

Pick a ghq repository with fzf and cd into it.

$ ghqcd
  repo>
  ▌ /Users/you/ghq/github.com/you/api
    /Users/you/ghq/github.com/you/web
    /Users/you/ghq/git.example.com/team/infra
  ╭───────────────────────────────────────╮
  │ 8f2c1a9 Fix the retry budget          │
  │ 3b7d004 Bump the client               │
  ╰───────────────────────────────────────╯
$ pwd
/Users/you/ghq/github.com/you/api

Install

npm install -g ghqcd

Then add the shell integration:

# zsh  — ~/.zshrc
eval "$(command ghqcd --init zsh)"

# bash — ~/.bashrc
eval "$(command ghqcd --init bash)"

# fish — ~/.config/fish/config.fish
command ghqcd --init fish | source

command matters: each tool defines a shell function with its own name, so on a second source ~/.zshrc the function would answer, capture the --init output and try to cd into it. command skips functions and goes to the binary.

Reload the shell and ghqcd moves it.

Prefer a different name? eval "$(ghqcd --init zsh --cmd gcd)" gives you gcd.

Without installing

eval "$(npx -y ghqcd --init zsh)"

The emitted function resolves its binary in three steps — ghqcd on PATH, then the script that generated the snippet, then npx -y ghqcd@<version> — so it keeps working after npm garbage-collects the npx cache. It is still worth a global install: npx adds about a second to every jump.

Requires git, ghq and fzf on PATH (brew install git ghq fzf), and Node >= 20.12. git is needed because ghq shells out to it.

Why --init exists

A child process cannot change its parent shell's working directory. npx ghqcd therefore can only print where you wanted to go — which it does, in a copyable box:

$ npx ghqcd api
╭─ next ────────────────────────────────────╮
│                                           │
│  cd "/Users/you/ghq/github.com/you/api"   │
│                                           │
╰───────────────────────────────────────────╯
   press c to copy · any other key to exit

--init emits a shell function, and a function runs inside your shell, so it can cd. This is the same mechanism zoxide and starship use.

Usage

ghqcd [options] [<query>]

| Option | Meaning | | --- | --- | | --init <shell> | print shell integration for zsh | bash | fish | | --cmd <name> | function name emitted by --init (default: ghqcd) | | --query <q> | initial fzf query (same as the positional) | | --list | print every candidate instead of picking one | | --json | stdout = 1-line JSON, never opens the fzf UI | | --quiet | stdout = path only | | --no-color | disable ANSI colors (also respects NO_COLOR) | | -h, --help | show help | | -V, --version | show version |

A query pre-filters fzf and auto-selects a unique match, so ghqcd api usually lands without a keystroke.

For scripts and AI agents

--json never opens a UI, so it is safe in a pipeline or an agent session.

$ ghqcd --json api
{"schemaVersion":1,"path":"/Users/you/ghq/github.com/you/api","slug":"github.com/you/api","root":"/Users/you/ghq","matches":1}

$ ghqcd --list --json
{"schemaVersion":1,"count":3,"root":"/Users/you/ghq","repos":[{"path":"…","slug":"…"}]}

matches tells you whether the query was unique — > 1 means the best-scoring candidate was returned but the query was ambiguous.

Errors go to stderr as JSON, and stdout stays empty:

$ ghqcd --json durian
{"schemaVersion":1,"error":{"code":"E_NO_MATCH","message":"no repository matched 'durian'"},"exitCode":2}

| Exit | Code | Meaning | | --- | --- | --- | | 0 | — | success | | 1 | E_VALIDATION, E_GHQ, E_FZF | bad flags, or an upstream command failed | | 2 | E_NO_MATCH | no repository matched | | 3 | E_AMBIGUOUS | non-interactive with no query — pass one, or use --list | | 127 | E_DEPS | ghq or fzf not installed | | 130 | E_INTERRUPTED | Esc or Ctrl-C in fzf |

Cancelling the picker exits 130 silently — no error line lands above your next prompt.

Related

  • gwqcd — same idea for gwq worktrees
  • gwqpull — clone with ghq, add a gwq worktree, and cd into it
  • gwqadd — create a branch and its gwq worktree in the repo you are in
  • ghnew — create a GitHub repo, ghq-get it, and cd into it

License

MIT © ryoshin0830