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

opencode-copilot-account-switcher

v0.1.2

Published

GitHub Copilot account switcher plugin for OpenCode

Downloads

282

Readme

OpenCode GitHub Copilot Account Switcher

npm version npm downloads License: MPL-2.0

English | 中文


English

Manage and switch between multiple GitHub Copilot accounts in OpenCode. This plugin only adds account switching and quota checks — it uses the official github-copilot provider and does not require model reconfiguration.

What You Get

  • Multi-account support — add multiple Copilot accounts and switch anytime
  • Quota check — view remaining quota per account
  • Auth import — import Copilot tokens from OpenCode auth storage
  • Zero model config — no model changes required (official provider only)

Installation

Option A: Let an LLM do it

Paste this into any LLM agent (OpenCode, Claude Code, Cursor, etc.):

Install the opencode-copilot-account-switcher plugin by following: https://raw.githubusercontent.com/jiwangyihao/opencode-copilot-account-switcher/master/README.md

Option B: Manual setup

  1. Add the plugin to ~/.config/opencode/opencode.json:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-copilot-account-switcher"]
    }
  2. Restart OpenCode (it will auto-download the plugin from npm).

  3. Login to GitHub Copilot:

    opencode auth login github-copilot

Step-by-Step Instructions

  1. Edit the OpenCode configuration file at ~/.config/opencode/opencode.json

    Note: This path works on all platforms. On Windows, ~ resolves to your user home directory (e.g., C:\Users\YourName).

  2. Add the plugin to the plugin array:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-copilot-account-switcher"]
    }
  3. Restart OpenCode so it fetches the plugin automatically from npm.

Verification

opencode auth login github-copilot

Usage

Run inside the GitHub Copilot auth flow:

opencode auth login github-copilot

You will see an interactive menu (arrow keys + enter) with actions:

  • Add account
  • Import from auth.json
  • Check quotas
  • Switch account
  • Remove account
  • Remove all

Storage

Accounts are stored in:

~/.config/opencode/copilot-accounts.json

FAQ

Do I need to change model configurations? No. This plugin only manages accounts and works with the official github-copilot provider.

Does it replace the official provider? No. It uses the official provider and only adds account switching + quota checks.


中文

OpenCode 中管理并切换多个 GitHub Copilot 账号。本插件只提供账号切换与配额查询完全依赖官方 github-copilot provider,无需修改模型配置。

功能一览

  • 多账号管理 — 添加多个 Copilot 账号,随时切换
  • 配额查询 — 查看每个账号的剩余额度
  • 导入认证 — 可从 OpenCode 认证存储导入
  • 无需模型配置 — 使用官方 provider,无需改模型

安装

选项 A:让 LLM 帮你安装

把下面这段话丢给任意 LLM(OpenCode / Claude Code / Cursor 等):

请按以下说明安装 opencode-copilot-account-switcher 插件:https://raw.githubusercontent.com/jiwangyihao/opencode-copilot-account-switcher/master/README.md

选项 B:手动安装

  1. 在配置文件中添加插件 ~/.config/opencode/opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-copilot-account-switcher"]
    }
  2. 重启 OpenCode(会自动从 npm 下载插件)。

  3. 登录 GitHub Copilot

    opencode auth login github-copilot

步骤指引

  1. 打开 OpenCode 配置文件 ~/.config/opencode/opencode.json

    说明:该路径在所有平台通用;Windows 上 ~ 会解析为用户目录(例如 C:\Users\YourName)。

  2. plugin 数组中添加插件:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-copilot-account-switcher"]
    }
  3. 重启 OpenCode,使其自动拉取 npm 包。

验证

opencode auth login github-copilot

使用方式

在 Copilot 认证流程中运行:

opencode auth login github-copilot

会出现交互式菜单(方向键 + 回车):

  • 添加账号
  • 从 auth.json 导入
  • 检查配额
  • 切换账号
  • 删除账号
  • 全部删除

存储位置

账号信息保存于:

~/.config/opencode/copilot-accounts.json

常见问题

需要改模型配置吗? 不需要。本插件只做账号管理,继续使用官方 github-copilot provider。

会替换官方 provider 吗? 不会。它只是在官方 provider 基础上增加账号切换和配额查询。


License

MPL-2.0 License. See LICENSE for details.