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

remove-github-repo

v1.0.0

Published

A CLI tool to delete GitHub repositories with interactive selection

Downloads

99

Readme

GitHub Repo Delete CLI

一个用于删除 GitHub 仓库的命令行工具,支持交互式选择和 Personal Access Token 登录。

功能特性

  • 🔐 使用 Personal Access Token 登录,简单安全
  • 📦 本地存储 Token,无需重复登录
  • 📋 列出所有仓库(包括私有仓库)
  • 🎯 交互式选择界面,支持空格选中、回车确认
  • 🔍 实时筛选仓库
  • ⚡ 批量删除选中的仓库

安装

全局安装

npm install -g gh-repo-delete

本地使用

npx gh-repo-delete

使用方法

登录

gh-repo-delete login
# 或
grd login

运行后会提示你输入 GitHub Personal Access Token。

生成 Personal Access Token

  1. 访问 GitHub Settings - Tokens
  2. 点击 "Generate new token" -> "Generate new token (classic)"
  3. 填写以下信息:
    • Note: gh-repo-delete (或任意名称)
    • Expiration: 选择过期时间(建议 90 days 或 No expiration)
    • 勾选权限: repo (删除仓库需要)
  4. 点击 "Generate token"
  5. 复制生成的 token(以 ghp_github_pat_ 开头)

列出所有仓库

gh-repo-delete list
# 或
grd ls

交互式删除仓库

gh-repo-delete delete
# 或
grd rm

操作说明:

  • ↑/↓ - 移动光标
  • 空格 - 选择/取消选择仓库
  • 回车/Tab - 确认删除(会再次确认)
  • Esc - 退出
  • 输入文字 - 实时筛选仓库

直接删除指定仓库

gh-repo-delete delete-repo owner/repo-name

退出登录

gh-repo-delete logout
# 或
grd logout

命令列表

| 命令 | 别名 | 描述 | |------|------|------| | login | - | 使用 Personal Access Token 登录 GitHub | | logout | - | 退出登录并清除本地 Token | | list | ls | 列出所有仓库 | | delete | rm | 交互式删除仓库 | | delete-repo <repo> | - | 直接删除指定仓库 |

发布说明

如果你想从源代码构建并发布这个包,请按照以下步骤操作:

构建项目

npm run build

登录 npm

npm login

发布到 npm

npm publish

发布测试版本

npm publish --tag beta

权限说明

本工具需要以下 GitHub 权限:

  • repo - 访问仓库信息和删除仓库

Token 存储在 ~/.config/remove-github-repo/token.json,文件权限设置为 600,确保只有当前用户可读写。

故障排除

Token 无效

如果提示 Token 无效,请检查:

  1. Token 是否正确复制(以 ghp_github_pat_ 开头)
  2. Token 是否已过期
  3. Token 是否包含 repo 权限

重新登录:

gh-repo-delete logout
gh-repo-delete login

无法删除仓库

如果无法删除仓库,请检查:

  1. Token 是否包含 repo 权限
  2. 你是否是仓库的所有者
  3. 仓库是否被组织保护

系统要求

  • Node.js >= 16.0.0
  • 支持的操作系统:macOS, Linux, Windows

License

MIT