1.1.1 ⢠Published 11 months ago
@relbns/github-cloner v1.1.1
GitHub Cloner
š Interactive CLI tool for effortlessly cloning your GitHub repositories and managing branches
Features
- š Interactive list of all your GitHub repositories
- š Smart organization by users and organizations
- šÆ Branch management within git repositories:
- View and checkout branches from open PRs
- Browse and checkout remote branches
- Auto-detect existing branches
- Pull latest changes for local branches
- š Quick search functionality with autocomplete
- ā” Clone repositories directly to your current directory
- šÆ Duplicate detection to prevent accidental re-cloning
- āļø Configurable sorting options (by name or last update)
Installation
npm install -g @relbns/github-clonerPrerequisites
- Node.js >=18.0.0
- npm >=9.5.1
- GitHub account with a personal access token
Setting up GitHub Token
Create a GitHub personal access token:
- Go to GitHub Settings ā Developer Settings ā Personal Access Tokens
- Generate new token with
reposcope - GitHub's guide on creating tokens
Add token to your shell profile:
# For bash users (in ~/.bashrc or ~/.bash_profile): export GITHUB_TOKEN=your_token_here # For zsh users (in ~/.zshrc): export GITHUB_TOKEN=your_token_hereReload your shell or run:
source ~/.bashrc # or ~/.zshrc for zsh users
Usage
Simply run:
cloneRepository Cloning
When run in a non-git directory:
- Displays an interactive menu of your repositories
- Allows you to search and select a repository
- Clones the selected repository to your current directory
Branch Management
When run inside a git repository:
- Choose between:
- Browse branches from open PRs
- Browse all remote branches
- Clone a new repository
- For PR branches:
- View all branches with open PRs
- See which branches exist locally
- Pull latest changes for existing branches
- For remote branches:
- View branches that don't exist locally
- Easily checkout new branches
Navigation
- Use ā/ā arrows to navigate
- Start typing to search repositories
- Press Enter to select
- Choose "Go back" to return to previous menu
- Choose "Exit" to quit
Settings
Access settings menu to:
- Configure sorting preferences
- Adjust display options
- Manage GitHub token
Support
For bugs and feature requests, please open an issue.
License
MIT Ā© Ariel Benesh