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

@quietlychan/repo-sweep

v0.1.1

Published

Batch list, clone, and pull GitLab or GitHub repositories.

Readme

Repo Sweep

语言:简体中文 | English | 日本語 | Français

Repo Sweep 用于批量操作当前账号可访问的 GitLab 或 GitHub 仓库,支持一键列表、克隆和拉取。CLI 提供交互式终端 UI、并发 Git 任务、真实 Git 进度输出,并可编译成跨平台单文件可执行程序。

功能

  • 支持 GitLab 和 GitHub。
  • 使用 @clack/prompts 提供交互式选择。
  • 支持批量 listclonepull
  • 支持并发克隆/拉取,并显示“当前序号/总数”。
  • 解析 Git 真实进度并显示条状进度。
  • HTTPS Token 认证通过临时 GIT_ASKPASS 完成,不会把 Token 拼进克隆地址。
  • 使用 bun build --compile 构建单文件二进制,可执行文件包含 Bun 运行时。

运行要求

  • 系统需要安装 Git,并且 git 命令在 PATH 中可用。
  • 当前网络需要能访问配置的平台地址。
  • npm / npx 安装方式需要 Node.js 18 或更高版本,用于启动当前平台二进制。
  • 本地开发和构建二进制需要 Bun。npm 平台包和 GitHub Release 二进制都已经包含 Bun 运行时。

npm 安装

npm 上的包名是 @quietlychan/repo-sweep,安装后的命令仍然是 repo-sweep

安装时会自动下载当前平台对应的二进制包,例如 @quietlychan/repo-sweep-darwin-arm64。Node.js 只负责启动器,核心 CLI 仍由 Bun 原生 API 实现,并以单文件二进制运行。

临时执行:

npx @quietlychan/repo-sweep --help

全局安装:

npm install -g @quietlychan/repo-sweep
repo-sweep --help

如果不想安装 Node.js,可以从 GitHub Release 下载对应平台的单文件二进制。

配置

复制配置模板:

cp .env.example .env

GitLab 示例:

GIT_PROVIDER=gitlab
GIT_BASE_URL=http://127.0.0.1/
GIT_API_URL=http://127.0.0.1/api/v4/
GIT_TOKEN=个人访问令牌
GIT_TARGET_DIR=./git-projects
GIT_USERNAME=oauth2

GitHub 示例:

GIT_PROVIDER=github
GIT_BASE_URL=https://github.com/
GIT_API_URL=https://api.github.com/
GIT_TOKEN=个人访问令牌
GIT_TARGET_DIR=./git-projects
GIT_USERNAME=x-access-token

使用

下面示例假设已经通过 npm 全局安装,或正在使用 GitHub Release 下载的二进制文件。临时使用 npx 时,把 repo-sweep 替换为 npx @quietlychan/repo-sweep

交互模式:

repo-sweep

查看仓库列表:

repo-sweep list

克隆缺失仓库:

repo-sweep clone

拉取已存在仓库:

repo-sweep pull

输出 JSON:

repo-sweep list --json

克隆时顺便拉取本地已存在仓库:

repo-sweep clone --update

进度输出示例:

[克隆:进度] 07/80 group/project [############----------]  55% 接收对象(已完成 42/80)

命令参数

  • --provider gitlab|github:选择平台,默认 gitlab
  • --base-url <url>:平台地址。
  • --api-url <url>:API 地址。不传时会按平台地址推导。
  • --token <token>:个人访问令牌,推荐使用 GIT_TOKEN
  • --dir <path>:本地目标目录。
  • --clone-url http|ssh:克隆地址类型,默认 http
  • --git-username <name>:HTTPS Git 用户名。GitLab 默认 oauth2,GitHub 默认 x-access-token
  • --concurrency <n>:并发 Git 任务数,默认 4
  • --progress-interval <sec>:长时间 Git 任务的心跳日志间隔,设为 0 可关闭。
  • --skip-archived:跳过已归档仓库。
  • --dry-run:只打印计划执行的 Git 命令,不真正执行。
  • --flat:不保留 group/subgroup,只按项目名放到根目录。名称重复时可能冲突。
  • --jsonlist 命令输出 JSON。
  • --show-token:交互模式中显示完整 Token。

构建可执行文件

构建所有配置的平台:

bun run build:bin

只构建当前平台:

bun run build:bin:current

构建指定 Bun target:

bun run build:bin -- --target bun-linux-x64

默认输出:

dist/repo-sweep-darwin-arm64
dist/repo-sweep-darwin-x64
dist/repo-sweep-linux-x64
dist/repo-sweep-linux-arm64
dist/repo-sweep-windows-x64.exe
dist/README.txt

发布 Release

Release assets 通常通过 CI 流水线生成,最常见的是 GitHub Actions。流程一般是:推送 tag 后触发 workflow,安装依赖,编译跨平台文件,创建 GitHub Release,并把编译后的文件上传到 assets。

本仓库已加入 .github/workflows/release.yml。发布方式:

git tag vX.Y.Z
git push origin vX.Y.Z

GitHub Actions 会自动:

  1. 安装 Bun。
  2. 安装依赖。
  3. 执行 TypeScript 检查。
  4. 构建 dist 中的跨平台二进制文件。
  5. dist 里的文件上传到 GitHub Release assets。

workflow 使用 GitHub 内置的 GITHUB_TOKEN 上传 Release assets。需要确认仓库 Actions 权限允许 contents: write

开发

安装依赖:

bun install

类型检查:

bun run typecheck

本地运行 CLI:

bun run start

开源协议

MIT 协议。查看 LICENSE