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

@openagentry/adapter-repo-github

v0.1.0-alpha.0

Published

OpenAgentry RepoAdapter implementation for GitHub REST API

Readme

@openagentry/adapter-repo-github

License: Apache-2.0 Status: Alpha

RepoAdapter for OpenAgentry, backed by the GitHub REST API v3. The first concrete RepoAdapter in the OpenAgentry default adapter set.

Install

pnpm add @openagentry/adapter-repo-github @openagentry/core

Quick start

Default export (env-based, lazy)

import repo from '@openagentry/adapter-repo-github';

// Reads OA_GITHUB_TOKEN (required) and OA_GITHUB_ENDPOINT (optional) from env.
// The lazy default is constructed on the first method call.
const result = await repo.create({
  owner: 'my-org',
  name: 'my-new-repo',
  visibility: 'private',
});
console.log(result.url);

Explicit construction

import { createGithubRepoAdapter } from '@openagentry/adapter-repo-github';

const repo = createGithubRepoAdapter({
  token: process.env.GITHUB_PAT!,
  endpoint: 'https://github.example.com/api/v3', // optional — GitHub Enterprise Server
});

const found = await repo.get('my-org', 'my-repo');
if (found) {
  console.log(found.defaultBranch, found.visibility);
}

Configuration

| Env var | Required | Purpose | |---|---|---| | OA_GITHUB_TOKEN | yes | GitHub Personal Access Token (classic repo scope or fine-grained "Administration: Read and write") | | OA_GITHUB_ENDPOINT | no | API base URL — override for GitHub Enterprise Server; defaults to https://api.github.com |

Full error reference, gotchas, and GHE setup notes: see LLM.md.

API reference

All methods are declared on RepoAdapter in @openagentry/core. This adapter implements:

| Method | Signature | |---|---| | create | (opts: CreateRepoOptions) => Promise<Repository> | | delete | (repo: Repository, confirm: ConfirmToken) => Promise<void> | | get | (owner: string, name: string) => Promise<Repository \| null> | | remoteUrl | (repo: Repository, mode: 'https' \| 'ssh') => string |

All failures throw AgentryError with stable codes: E_GITHUB_AUTH, E_GITHUB_NOT_FOUND, E_GITHUB_PERMISSION, E_GITHUB_INVALID, E_GITHUB_RATE_LIMIT, E_GITHUB_NETWORK, E_GITHUB_UPSTREAM.

Known limitations (v0)

  • No branch, PR, issue, release, webhook, or Actions operations. The v0 RepoAdapter interface covers create/delete/get/remoteUrl only. Richer operations are deferred until a second RepoAdapter (GitLab/Gitea/Bitbucket) establishes what belongs in the cross-vendor interface.
  • internal repos appear as private. GitHub Enterprise Server's internal visibility is mapped to 'private' in the v0 interface. See LLM.md.
  • delete is not idempotent. GitHub returns 404 when deleting a nonexistent repo; the adapter surfaces this as E_GITHUB_NOT_FOUND. Use get first if idempotency is needed.
  • One extra GET /user on first create per adapter instance. The adapter probes the authenticated login to route user vs. org creates correctly. Result is cached for the adapter's lifetime.
  • No local-git operations. Push, fetch, branch creation, and clone belong to a local orchestrator — not a registrar adapter.

License

Apache-2.0.


See LLM.md for the concise operator reference (errors, gotchas, field mapping).