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

omp-github-copilot-legacy

v0.1.0

Published

omp extension: github-copilot-legacy provider via OAuth device flow + Copilot REST API (no Copilot CLI/SDK)

Readme

omp-github-copilot-legacy

An omp extension that registers a github-copilot-legacy provider. It talks to GitHub Copilot through the classic editor REST flow — OAuth device flow plus copilot_internal/v2/token exchange — with no Copilot CLI / SDK involved.

How it differs from the built-in github-copilot provider

| | built-in github-copilot | github-copilot-legacy (this extension) | | ------------------- | -------------------------------------- | --------------------------------------------- | | OAuth app | Copilot CLI app (Ov23ct…) | Legacy editor app (Iv1.b507a08c87ecfe98) | | API credential | GitHub OAuth token used directly | Short-lived Copilot token from GET api.github.com/copilot_internal/v2/token, auto-refreshed | | Token lifetime | ~10 years (far-future expiry) | ~30 min (expires_at/refresh_in), minus 2 min safety margin | | Request identity | Copilot-Integration-Id: copilot-developer-cli, Copilot-Harness-Id: copilot-sdk | Copilot-Integration-Id: vscode-chat, GitHubCopilotChat UA, no SDK headers | | Transport | Per-model routes (completions / responses / Anthropic) | openai-completions (<api>/chat/completions) for every model | | Model catalog | Bundled + live discovery | 3 static fallbacks + live /models discovery |

Install

Use it once:

omp -e /path/to/omp-github-copilot-legacy/src/index.ts

Or link it persistently as a plugin:

omp plugin link /path/to/omp-github-copilot-legacy

Login

In omp, run /login and pick GitHub Copilot (Legacy REST). A device code is shown; approve it at https://github.com/login/device. Login exchanges the GitHub token for a short-lived Copilot token and stores:

  • refresh: long-lived GitHub OAuth token (ghu_/gho_)
  • access: short-lived Copilot bearer (drives omp auto-refresh via expires)
  • apiEndpoint: plan-specific host (api.githubcopilot.com or api.business.githubcopilot.com, drives per-request routing)

Then select a model, e.g.:

omp --model github-copilot-legacy/gpt-4o

Environment

  • GITHUB_COPILOT_LEGACY_CLIENT_ID — override the legacy OAuth app id (default Iv1.b507a08c87ecfe98).
  • GITHUB_COPILOT_LEGACY_BASE_URL — redirect the transport (forward proxy or local test server). Normal use never sets this.

Limitations

  • Personal github.com OAuth only; no Enterprise-host prompt in v1 (business-plan accounts still work — the token exchange advertises the api.business.githubcopilot.com endpoint automatically).
  • No thinking-effort dial: models register with reasoning: false, so the effort selector is hidden. Models themselves work normally.
  • Usage is billed against your Copilot subscription; recorded cost is 0.

Development

bun install
bun test        # 24 unit tests, mocked fetch, no network
bunx tsc --noEmit

src/copilot-legacy.ts holds all protocol logic behind an injectable fetch; src/index.ts is the thin pi.registerProvider wiring. End-to-end wire verification is done against a local capture server (GITHUB_COPILOT_LEGACY_BASE_URL=http://127.0.0.1:PORT + --api-key), asserting the request line, Bearer auth, legacy headers, and SSE parsing.