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

@leonardocustodio/github-activity

v1.1.1

Published

Fetch all your GitHub PRs, issues, and reviews across repositories

Readme

GitHub Activity

A powerful CLI tool to track and report on all your GitHub activity including pull requests, issues, and code reviews across all repositories (both public and private).

Quick Start

1. Create GitHub Personal Access Token

  1. Go to GitHub Settings > Developer settings > Personal access tokens
  2. Click "Generate new token" (classic)
  3. Select the following scopes:
    • repo - Full control of private repositories (includes read access to pull requests, issues, and reviews)
    • read:org - Read organization membership (optional, for organization repos)
  4. Generate the token and copy it

2. Run the Tool

# Run directly with npx
npx github-activity fetch --token YOUR_GITHUB_TOKEN --user YOUR_USERNAME

# Or install globally
npm install -g @leonardocustodio/github-activity
github-activity fetch --token YOUR_GITHUB_TOKEN --user YOUR_USERNAME

Features

  • Fetch all pull requests created by you across all accessible repositories
  • Track issues you've created in any repository
  • Monitor code reviews you've submitted
  • No repository-level configuration needed - works at the user level
  • Supports both public and private repositories with proper authentication
  • SQLite or JSON-based storage for easy querying and portability

CLI Commands

| Command | Description | Options | |---------|-------------|---------| | fetch | Fetch all activities | --max-pages <number> | | fetch-prs | Fetch only pull requests | --max-pages <number> | | fetch-issues | Fetch only issues | --max-pages <number> | | fetch-reviews | Fetch only code reviews | --max-pages <number> | | summary | Show activity statistics | None | | list | List stored activities | --type <prs\|issues\|reviews\|all>, --limit <number> |

CLI Arguments

Pass configuration directly via command-line flags:

Available Options:

  • -t, --token <token> - GitHub Personal Access Token (required)
  • -u, --user <username> - GitHub username (required)
  • -f, --format <format> - Storage format: json or sqlite (default: json)
  • -p, --path <path> - Path to storage directory (default: ./data)
  • -o, --output <filename> - Storage filename (default: activities.json or activities.db)
  • -l, --log <level> - Log level: debug, info, warn, error (default: info)

Data Structure

Activities are stored in a JSON file with the following structure:

{
  "pullRequests": [
    {
      "id": 123456,
      "number": 42,
      "title": "Add new feature",
      "url": "https://api.github.com/repos/owner/repo/pulls/42",
      "htmlUrl": "https://github.com/owner/repo/pull/42",
      "state": "merged",
      "repository": {
        "name": "repo",
        "fullName": "owner/repo",
        "owner": "owner",
        "url": "https://github.com/owner/repo",
        "private": false
      },
      "author": "username",
      "createdAt": "2025-09-01T10:00:00Z",
      "mergedAt": "2025-09-05T14:30:00Z"
    }
  ],
  "issues": [...],
  "reviews": [...],
  "metadata": {
    "lastUpdated": "2025-09-29T12:00:00Z",
    "username": "username",
    "totalPullRequests": 45,
    "totalIssues": 23,
    "totalReviews": 127
  }
}

How It Works

1. Authentication

The tool uses GitHub Personal Access Tokens for authentication, which provides:

  • Access to both public and private repositories
  • Higher rate limits (5,000 requests/hour)
  • Ability to access organization repositories

2. Data Fetching

The tool uses GitHub's Search API to fetch activities:

  • Pull Requests: GET /search/issues?q=author:USERNAME type:pr
  • Issues: GET /search/issues?q=author:USERNAME type:issue
  • Reviews: GET /search/issues?q=reviewed-by:USERNAME type:pr + individual PR review endpoints

3. Pagination

The GitHub API returns results in pages (max 100 items per page). The tool automatically:

  • Handles pagination to fetch all results
  • Respects rate limits and implements backoff
  • Allows configuring max pages to fetch

4. Storage

Activities are stored in a JSON file with:

  • Deduplication by GitHub ID
  • Metadata tracking (last sync time, counts)
  • Easy querying and filtering

Rate Limits

GitHub API rate limits:

  • Authenticated requests: 5,000 requests/hour
  • Search API: 30 requests/minute

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT

Support

For issues, questions, or feature requests, please open an issue on GitHub.

Roadmap

Future enhancements:

  • Web dashboard for visualization
  • Date range filtering
  • Export to CSV/PDF