ghvis
v1.0.1
Published
Interactive CLI tool to bulk-change GitHub repository visibility (public ↔ private)
Maintainers
Readme
ghvis
Bulk-change GitHub repository visibility (public ↔ private) through an interactive terminal interface.
Features
- Interactive multiselect to pick repositories
- Supports both directions: public → private and private → public
- Auto-detects GitHub CLI (
gh) authentication or prompts for a Personal Access Token - Handles personal and organization repositories (requires admin access)
- Paginated repository fetching
- Confirmation prompt before applying changes
- Success/failure summary after execution
Installation
# Install globally
npm install -g ghvis
# Or run directly with npx
npx ghvisUsage
Simply run the command and follow the interactive prompts:
ghvisThe tool will guide you through:
- Authentication — automatically uses
ghCLI auth if available, otherwise prompts for a PAT - Select target visibility — choose whether to make repos public or private
- Select repositories — multiselect from eligible repos (only shows repos that can be changed)
- Confirm — review your selection before applying
- Apply — changes visibility and displays a summary
Authentication
GitHub CLI (recommended)
If you have the GitHub CLI installed and authenticated, ghvis will automatically use your existing session:
gh auth login
ghvisPersonal Access Token (PAT)
If gh CLI is not available, you will be prompted to enter a PAT directly in the terminal.
How to get a PAT:
- Go to GitHub Token Settings
- Click "Generate new token" → "Generate new token (classic)"
- Fill in:
- Note:
ghvis(or any label you prefer) - Expiration: choose based on your needs (30 days, 90 days, or no expiration)
- Scopes: check
repo(full control of private repositories)
- Note:
- Click "Generate token"
- Copy the token (starts with
ghp_) — it is only shown once
Then run ghvis and paste the token when prompted:
$ ghvis
? Enter your GitHub Personal Access Token (PAT): ghp_xxxxxxxxxxxxThe token is only held in memory during the session and is never written to disk.
Requirements
- Node.js >= 18.0.0
- GitHub account with admin access to target repositories
- Either
ghCLI authenticated or a PAT withreposcope
Development
# Clone the repository
git clone [email protected]:moritakaaz/ghvis.git
cd ghvis
# Install dependencies
npm install
# Build
npm run build
# Lint (type-check only)
npm run lintConventional Commits
This project uses conventional commits enforced by commitlint + husky:
feat: add new feature → minor version bump
fix: fix a bug → patch version bump
feat!: breaking change → major version bump
chore: maintenance → no version bump
docs: documentation → no version bump
refactor: code refactor → no version bumpReleasing
# Bump version, update CHANGELOG.md, and create a git tag
npx standard-version
# Push with tags to trigger CI + npm publish
git push --follow-tagsGitHub Actions will automatically:
- Run CI checks (lint + build on Node 18, 20, 22)
- Publish to npm (triggered by
v*tag) - Create a GitHub Release with changelog
License
MIT
