mirror of
https://github.com/treetrum/github-repo-bulk-archiver.git
synced 2026-06-06 08:40:58 +10:00
No description
- JavaScript 100%
| .gitignore | ||
| archive-repos.mjs | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
Bulk Archive GitHub Repos
Interactive CLI to bulk archive repositories using GitHub CLI (gh).
Prerequisites
- Node.js 18+
ghinstalled 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.