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 🙏

© 2024 – Pkg Stats / Ryan Hefner

gh-issues-utils

v0.1.0

Published

Github repository command-line utilities

Downloads

1

Readme

gh-issues-utils: A set of command-line utilties to browse github issues

Quick and dirty implementation of two small command-line utilities that query Github for Issues and PRs information.

  • ghprompt is an interactive command line interface that can be used to query github for issues and pull-requests information in an almost natural language
  • ghquery just demonstrate how to use the Github API module to query for various statistics in case you want to write your own script

Install

npm install -g gh-issues-cli

This will install utilties ghprompt and ghquery.

Usage

Both ghprompt and ghquery take the same parameters:

  • --user <github username> (optional) Username to send when authenticating with github to raise API call rate limits.
  • --password <github security token> (optional) Security token (or password) to send when authenticating with github to raise API call rate limits.
  • <owner> (mandatory) name of the repository owner.
  • <repository> (mandatory) repository for which you want to get numbers.

Why authenticate? Github limits the number of unauthenticated calls that can be made to its API to 60 per hour. That limit might be maxed out quickly if you're using these utilities intensively. In that case, authenticating raise the limit to 5000 calls per hour (which should be more than enough).

ghprompt

The basic idea is to allow a user to query for issues and pull requests statistics. queries can be written in almost natural language, although it doesn't pretend like it's a chat bot. It's actually not even intelligent. it just recognizes keywords. A few commands:

  • usage will show usage examples
  • help will show help about a specific command or keyword
  • load will load issues and pull requests from the repository and into a database for later querying. If you don't load, you can't query. Mandatory first step.
  • list will list stuff
  • count will count stuff
  • link will show the link to take you to the github page of the issue/pull-request

And now a few examples of queries:

> count open issues assigned to pierreca

> list closed issues created in the last 7 days

> list issues not assigned

> count closed issues labeled bug in the past 4 weeks

> list open issues not updated in the last 24 hours

ghquery

Run ghquery with the aforementionned parameters and it will spit out stats about open and closed issues and pull requests in the past 24 hours, 7 days, and overall. Not much here. it's intended more as a sample code.

Features

Current search criteria supported:

  • type (issue or pull request)
  • current state (open, closed)
  • time and type of last update (created, updated, closed)
  • assignee
  • labels

TODOs

Housekeeping

  • [ ] Issue type (issue or PR) and state (open/closed) are currently treated differently from other filtering mechanisms. unify this.
  • [ ] Write tests
  • [ ] Better docs
  • [ ] Better decoupling of the command parser
  • [x] Better Github API file structure
  • [ ] Find a way to not grow the call stack when looping between commands
  • [ ] Turn all commands into promises?
  • [ ] Custom issue interface from github json object (for type-safety and stuff)

Features

  • [ ] Save and load configuration from a file
  • [ ] Save and load database to a file
  • [ ] Differential queries to update the database
  • [ ] Show and handle Github API calls rate limits
  • [ ] Save query results to a file
  • [ ] Add an option to specify a query directly from the command line
  • [ ] Index the database
  • [ ] Figure out a way to make multiple-word labels work (probably by dynamically creating a collection of labels from the Github JSON)
  • [ ] Detailed view of an issue (with timestamps etc)