Skip to content

abdianrizky/gh-clone-org

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

gh-clone-org

Interactively bulk-clone GitHub organization repositories with a fuzzy-search TUI picker and parallel cloning support.

Demo

  > Fetching repository list for my-company (limit: 500)…
  > Found 87 repositories.

╭─ gh-clone-org ──────────────────────────────────────────────────────────────╮
│  my-company  (87 repos)  │  Space/Tab: select  │  ↑↓: navigate  │  Enter: clone  │
├─────────────────────────────────────────────────────────────────────────────┤
│  Search: _                                                                  │
│                                                                             │
│ ▶ api-gateway               private    Go              2026-03-28           │
│   auth-service              private    TypeScript      2026-03-25           │
│ ✓ backend-core              private    Go              2026-04-01           │
│ ✓ frontend-app              private    TypeScript      2026-04-02           │
│   legacy-monolith           private    PHP             2024-11-10  archived │
╰─────────────────────────────────────────────────────────────────────────────╯

Features

  • Interactive multi-select TUI powered by fzf — fuzzy search, arrow-key navigation, Space/Tab to select
  • Live preview panel — shows description, language, stars, topics, SSH URL per repo
  • Parallel cloning — clone multiple repos simultaneously (-j flag, default: 4)
  • Smart handling — skips already-cloned repos, optionally pulls updates with --pull
  • Filters — exclude archived repos, cap fetch limit
  • Works with private organization repos — uses your existing gh auth

Requirements

Tool Version Install
gh >= 2.0 brew install gh
fzf >= 0.48 brew install fzf
jq any brew install jq
git any pre-installed on macOS

Your gh token needs repo and read:org scopes:

gh auth refresh -s repo,read:org

Installation

# 1. Download the script
curl -fsSL https://raw.githubusercontent.com/abdianrizky/gh-clone-org/main/gh-clone-org \
  -o ~/bin/gh-clone-org

# 2. Make it executable
chmod +x ~/bin/gh-clone-org

# 3. Make sure ~/bin is in your PATH (add to ~/.zshrc if needed)
export PATH="$HOME/bin:$PATH"

Or clone this repo and symlink:

git clone https://github.com/abdianrizky/gh-clone-org.git
ln -sf "$PWD/gh-clone-org/gh-clone-org" ~/bin/gh-clone-org
chmod +x ~/bin/gh-clone-org

Usage

gh-clone-org [OPTIONS] [ORG]

Options

Flag Default Description
[ORG] (prompt) GitHub organization name
-d, --dir DIR ~/repos Target directory for clones
-p, --pull skip git pull repos that are already cloned
-n, --no-archived include Exclude archived repositories
-l, --limit N 500 Max repos to fetch (1–1000)
-j, --jobs N 4 Parallel clone jobs (1–20)
-h, --help Show help and exit

Examples

# Basic — prompts for org name
gh-clone-org

# Explicit org, clone into current directory
gh-clone-org --dir ./ my-company

# Custom directory, pull already-cloned repos
gh-clone-org --dir ~/code --pull my-company

# 8 parallel jobs, skip archived, fetch up to 1000 repos
gh-clone-org -j 8 -n -l 1000 my-company

TUI Key Bindings

Key Action
/ Navigate
Space / Tab Toggle selection (cursor stays)
Ctrl+A Select all
Ctrl+D Deselect all
Ctrl+T Toggle all
? Toggle preview panel
Enter Confirm and clone selected repos
Esc Quit without cloning

How It Works

  1. Fetches the org's repo list via gh repo list (JSON, cached to a temp file)
  2. Pipes the list into fzf for interactive multi-select with a live preview panel
  3. After confirmation, launches up to --jobs parallel git clone processes
  4. Each background job writes its output and exit status to temp files
  5. Results are collected in order as jobs finish and a summary is printed

License

MIT — see LICENSE

About

Interactively bulk-clone GitHub org repos with fzf TUI multi-select and parallel cloning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages