No description
  • JavaScript 100%
Find a file
2026-05-27 09:09:51 +10:00
.gitignore Switch to interactive Node CLI for repo archiving 2026-05-27 08:59:08 +10:00
archive-repos.mjs Improve interactive output and document npm link usage 2026-05-27 09:09:51 +10:00
package-lock.json Add package-lock.json 2026-05-27 09:00:32 +10:00
package.json Switch to interactive Node CLI for repo archiving 2026-05-27 08:59:08 +10:00
README.md Improve interactive output and document npm link usage 2026-05-27 09:09:51 +10:00

Bulk Archive GitHub Repos

Interactive CLI to bulk archive repositories using GitHub CLI (gh).

Prerequisites

  • Node.js 18+
  • gh installed and authenticated (gh auth login)

Install

npm install

Usage

Run directly with Node:

node archive-repos.mjs <owner> [--name-regex <regex>] [--dry-run] [--all]

Or via npm script:

npm run archive -- <owner>

Or install the CLI command globally from this repo:

npm link
archive-repos <owner> [--name-regex <regex>] [--dry-run] [--all]

To remove the global link later:

npm unlink -g github-repo-bulk-archiver

Examples

Interactive picker (multi-select):

node archive-repos.mjs my-org

Filter by regex:

node archive-repos.mjs my-org --name-regex '^my-org/legacy-'

Dry run:

node archive-repos.mjs my-org --dry-run

Skip picker and archive all matches:

node archive-repos.mjs my-org --all

Notes

  • Picker controls: space to toggle, enter to confirm.
  • Script skips repos already archived.
  • It tries owner as an org first, then as a user.