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

@circuitwall/github-langchain

v1.0.0

Published

LangChain tools for the GitHub REST API — direct REST calls, no MCP, no gh CLI, proxy-aware. Extracted from Jarela.

Readme

@circuitwall/github-langchain

LangChain tools for the GitHub REST API — direct REST calls, no MCP, no gh CLI, proxy-aware.

Extracted from Jarela. Works in any Node 20+ LangChain.js / LangGraph project. Inherits whatever HTTP proxy + CA bundle the host runtime configures, so it works on locked-down corp networks where the MCP install path is blocked.

Install

npm install @circuitwall/github-langchain @langchain/core zod

@langchain/core and zod are peer dependencies — bring your own version.

Quick start

import {
  setAuthResolver,
  githubGetRepoTool,
  githubSearchIssuesTool,
  githubTools,
} from "@circuitwall/github-langchain";

// Option A: rely on env vars (GITHUB_TOKEN or GH_TOKEN). Nothing to do.

// Option B: plug in your own credential source (vault, UI form, …).
setAuthResolver(() => ({
  token: process.env.MY_GITHUB_TOKEN ?? "",
}));

// Use individual tools …
const result = await githubGetRepoTool.invoke({
  owner: "CircuitWall",
  repo: "jarela",
});

// … or pass the whole array to a LangGraph agent.
const agent = await createReactAgent({ llm, tools: [...githubTools] });

What's in the box

22 tools covering the GitHub REST API.

Issues

  • github_search_issues — full GitHub search syntax (issues + PRs)
  • github_get_issue
  • github_create_issue
  • github_update_issue — title / body / labels / state
  • github_add_comment
  • github_list_issue_comments

Pull requests

  • github_list_pulls
  • github_get_pull — full detail (mergeable, additions, reviews)
  • github_create_pull
  • github_update_pull
  • github_merge_pull — execute capability
  • github_request_reviewers
  • github_create_review — APPROVE / REQUEST_CHANGES / COMMENT
  • github_list_pull_files — with capped patch text
  • github_list_pull_reviews

Repo content

  • github_get_repo
  • github_list_branches
  • github_get_file — capped UTF-8 read, binary-aware
  • github_search_code

Capability groups

For tool-policy systems that need read / write / execute partitions:

import {
  githubReadTools,    // 11 read-only tools
  githubWriteTools,   // 7 mutating tools (issues + PRs)
  githubExecuteTools, // 1 merge tool
} from "@circuitwall/github-langchain";

github_merge_pull is in execute (not write) because merging a PR triggers CI, deploys, and downstream automation — a different blast radius than editing an issue title.

Low-level escape hatch

For endpoints not yet wrapped as tools:

import { githubFetch, resolveGithubAuthFromEnv } from "@circuitwall/github-langchain";

const auth = resolveGithubAuthFromEnv();
if (!("error" in auth)) {
  const data = await githubFetch(auth, "/user");
}

Pure helpers

Exported for reuse outside the LangChain tool wrappers:

  • truncate(text, cap) — pure-fn body capping ({text, truncated})
  • decodeContentsBlob(content, encoding) — decode /contents/{path} blob, detect binary, return {binary, text?, size_bytes}

API notes

  • Token scopes: repo covers private + public repo content + issues + PRs; read:org is needed for team-based reviewer requests. Fine-grained tokens must explicitly grant each resource.
  • Code search rate limits: GitHub's /search/code endpoint has stricter limits (10/min unauthenticated, 30/min authenticated) than the rest of the REST API.
  • mergeable: null: On a freshly-pushed PR, GitHub computes mergeability asynchronously. The first call to github_get_pull may return null; call again after a few seconds.

License

Apache-2.0