@relbns/github-cloner
v1.1.1
Published
Github Cloner is a CLI tool for cloning Github repositories with interactive lists in the terminal. the tool lists your repositories and sorts them by owners (users and organizations) and by name. choosing the repo will clone it to the current directory i
Downloads
257
Maintainers
Readme
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-cloner
Prerequisites
- 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
repo
scope - 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_here
Reload your shell or run:
source ~/.bashrc # or ~/.zshrc for zsh users
Usage
Simply run:
clone
Repository 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