- Add remove_user_interactive.sh with rich visual logging and progress tracking - Support wildcard patterns for repository matching (*-go-api*, frontend-*, etc.) - Handle both root account and organization repositories - Implement flexible confirmation system (yes/no/all/skip/quit) - Add comprehensive documentation and usage examples - Update README.md with tool overview and usage instructions - Create CLAUDE.md for repository guidance - Add detailed documentation in docs/remove_user_interactive.md 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3.3 KiB
3.3 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a collection of Bash-based DevOps tools for GitHub repository management, specifically designed for ByteLyst AI organization. The tools focus on repository security, user management, and multi-repository operations.
Core Components
Main CLI Interface
bytelyst-cli.sh- Unified command-line interface for all tools with both CLI and interactive modes- Requires
jqandcurldependencies - Requires
GITHUB_TOKENenvironment variable for GitHub API access
Git Safety Tools (git-work-safety-tools/)
git_repos_status.sh- Recursively scans directories for git repositories and shows status (commits, uncommitted files, unpushed changes)git_repos_rebase_commit_push.sh- Safely rebases, commits, and pushes changes across multiple reposmulti_repo_*.sh- Additional multi-repository management utilities
User Management Tools
remove_user_interactive.sh- Interactive user removal with wildcard repository matching- Supports patterns like
*-go-api*,frontend-* - Handles both root account and organization repositories
- Rich visual logging with progress tracking
- Flexible confirmation system (yes/no/all/skip/quit)
- Supports patterns like
Individual Tools
list_all_public_repos.sh- Lists public repositories for a userlist_orgs_teams_members.sh- Lists organization teams and memberslist_prs_by_user.sh- Lists pull requests by specific userlist_repos_contributors.sh- Lists contributors for repositoriesmake_repos_private.sh- Converts public repos to privatedelete_team_interactive.sh- Interactive team deletion tool
Development Commands
Setup
./setup.sh
This installs pre-commit hooks and sets up the development environment.
Code Quality
pre-commit run --all-files
Runs all pre-commit hooks including shellcheck for shell scripts.
Testing
./test.sh
Basic test script (currently minimal).
Architecture Notes
Authentication
All tools use GitHub Personal Access Tokens via GITHUB_TOKEN environment variable. The token can be set in:
- Environment variables
.envfile (loaded automatically bybytelyst-cli.sh)
Configuration Files
github_repos.json- Repository configuration for batch operationsgithub_acc_input.json- Account input configurationusers_white_list.json/users_black_list.json- User access control listsrepos.json/repos.txt- Repository lists for operations
Error Handling
- Tools validate required dependencies (
jq,curl) before execution - GitHub API responses are checked for HTTP status codes
- Interactive confirmations for destructive operations
Multi-Repository Operations
The git safety tools are designed to work across multiple repositories by:
- Recursively finding all
.gitdirectories - Operating on each repository independently
- Providing summary reports of operations
Security Considerations
- All tools require explicit confirmation for destructive operations
- GitHub tokens are validated before operations
- Pre-commit hooks include security checks (large file detection, trailing whitespace)
- Repository access is controlled via whitelist/blacklist mechanisms