{"id":19865711,"url":"https://github.com/juev/gclone","last_synced_at":"2026-02-18T09:07:28.426Z","repository":{"id":230854393,"uuid":"780010187","full_name":"juev/gclone","owner":"juev","description":"  Smart Git repository cloner that organizes repos into structured directories based on URL paths. Perfect for developers who want clean, predictable project organization.","archived":false,"fork":false,"pushed_at":"2025-09-07T07:23:54.000Z","size":117,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T14:42:45.600Z","etag":null,"topics":["automation","cli-tool","developer-tools","devtools","directory-structure","filesystem-organization","git","git-clone","golang","productivity","project-organization","repository-management","shell-integration"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-31T12:48:26.000Z","updated_at":"2025-09-07T07:23:20.000Z","dependencies_parsed_at":"2024-04-01T07:31:12.189Z","dependency_job_id":"dec340b1-b388-40d6-9b67-2e6434bb1efc","html_url":"https://github.com/juev/gclone","commit_stats":null,"previous_names":["juev/gclone"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/juev/gclone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fgclone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fgclone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fgclone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fgclone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juev","download_url":"https://codeload.github.com/juev/gclone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juev%2Fgclone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29574068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","cli-tool","developer-tools","devtools","directory-structure","filesystem-organization","git","git-clone","golang","productivity","project-organization","repository-management","shell-integration"],"created_at":"2024-11-12T15:23:50.249Z","updated_at":"2026-02-18T09:07:28.422Z","avatar_url":"https://github.com/juev.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# 📁 gclone\n\n\u003e **🚀 Smart Git Repository Cloner** - Clone repositories into organized directory structures with parallel processing\n\n[![Go Version](https://img.shields.io/badge/go-%3E%3D1.22-00ADD8?style=flat-square\u0026logo=go)](https://golang.org)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/juev/gclone?style=flat-square)](https://goreportcard.com/report/github.com/juev/gclone)\n\n## ✨ Why gclone?\n\nEver tired of manually creating nested directories for your Git repositories? **gclone** automatically organizes your repos into a clean, predictable structure that mirrors the repository's URL path, **with blazing-fast parallel processing**.\n\n```text\n~/src/\n├── github.com/\n│   ├── golang/go/\n│   ├── kubernetes/kubernetes/\n│   └── juev/gclone/\n├── gitlab.com/\n│   └── company/project/\n└── bitbucket.org/\n    └── team/service/\n```\n\n## 🚀 Key Features\n\n- **⚡ Parallel Processing** - Clone multiple repositories simultaneously with configurable workers\n- **🎯 Zero Configuration** - Works out of the box with sensible defaults  \n- **📂 Organized Structure** - Mirrors repository URLs in your filesystem\n- **🔒 Security First** - Comprehensive URL validation and path sanitization\n- **💾 Smart Caching** - Intelligent directory existence checking with LRU cache\n- **🌊 Shallow Clones** - Optional `--depth=1` for faster clones\n- **🛡️ Graceful Shutdown** - Handles interrupts cleanly with signal handling\n- **🤫 Quiet Mode** - Suppress output when needed\n- **🐚 Shell Integration** - Perfect for scripts and aliases\n\n## 📦 Installation\n\n```bash\ngo install github.com/juev/gclone@latest\n```\n\n## 🔧 Quick Start\n\n### Basic Usage\n\n```bash\n# Set your preferred projects directory\nexport GIT_PROJECT_DIR=\"$HOME/src\"\n\n# Clone a single repository\ngclone https://github.com/golang/go.git\n# Result: ~/src/github.com/golang/go/\n\n# Clone multiple repositories in parallel\ngclone https://github.com/golang/go.git \\\n       https://github.com/kubernetes/kubernetes.git \\\n       https://gitlab.com/company/project.git\n\n# Fast shallow clone\ngclone --shallow https://github.com/large/repository.git\n```\n\n### Advanced Usage\n\n```bash\n# Use 8 parallel workers for faster cloning\ngclone -w 8 \\\n  https://github.com/repo1/project.git \\\n  https://github.com/repo2/project.git \\\n  https://github.com/repo3/project.git\n\n# Quiet mode for scripts\ngclone --quiet --shallow https://github.com/user/repo.git\n\n# Chain with other commands\ncd \"$(gclone https://github.com/user/repo.git)\"\ncode \"$(gclone --quiet https://github.com/user/repo.git)\"\n```\n\n## 💡 Command Line Options\n\n```bash\ngclone [-h] [-v] [-q] [-s] [-w WORKERS] [REPOSITORY...]\n\nOptions:\n  -h, --help         Show this help message and exit\n  -v, --version      Show the version number and exit\n  -q, --quiet        Suppress output\n  -s, --shallow      Perform shallow clone with --depth=1\n  -w, --workers      Number of parallel workers (default: 4, max: 32)\n\nEnvironment Variables:\n  GIT_PROJECT_DIR    Directory to clone repositories (default: current dir)\n\nExamples:\n  GIT_PROJECT_DIR=\"$HOME/src\" gclone https://github.com/user/repo\n  gclone -w 8 https://github.com/user/repo1 https://github.com/user/repo2\n```\n\n## 🎨 Shell Integration\n\n### Bash/Zsh Functions\n\n```bash\n# Clone and cd into repository\ngcd() {\n    cd \"$(gclone \"$1\")\"\n}\n\n# Clone and open in VS Code\ngcode() {\n    code \"$(gclone \"$1\")\"\n}\n\n# Clone and open in your editor\ngedit() {\n    $EDITOR \"$(gclone \"$1\")\"\n}\n\n# Bulk clone with parallel processing\ngbulk() {\n    gclone -w 8 \"$@\"\n}\n```\n\n### Fish Shell Functions\n\n```fish\nfunction gcd --argument repo\n    test -n \"$repo\"; or return 1\n    cd (gclone $repo)\nend\n\nfunction gcode --argument repo\n    test -n \"$repo\"; or return 1\n    code (gclone $repo)\nend\n\nfunction gbulk\n    gclone -w 8 $argv\nend\n```\n\n### PowerShell Functions\n\n```powershell\nfunction gcd($repo) {\n    Set-Location (gclone $repo)\n}\n\nfunction gcode($repo) {\n    code (gclone $repo)\n}\n\nfunction gbulk {\n    gclone -w 8 @args\n}\n```\n\n## 🏗️ How It Works\n\n1. **Parse \u0026 Validate** - Security validation of repository URLs\n2. **Normalize** - Convert URLs to filesystem paths (with caching)\n3. **Parallel Process** - Distribute work across configurable workers\n4. **Smart Check** - Cache-optimized directory existence checking\n5. **Secure Clone** - Timeout-protected git operations\n6. **Signal Handling** - Graceful shutdown on interrupts\n\n## 🔒 Security Features\n\n- **URL Validation** - Comprehensive security checks against malicious URLs\n- **Path Sanitization** - Protection against directory traversal attacks\n- **Command Safety** - No shell interpretation, direct git execution\n- **Timeout Protection** - 10-minute timeout per repository\n- **Safe Defaults** - Conservative permissions (0750) for created directories\n\n## ⚡ Performance Features\n\n- **Parallel Workers** - Configurable concurrent cloning (1-32 workers)\n- **Smart Caching** - LRU cache for directory existence checks\n- **Sequential Fallback** - Automatic optimization for single repositories\n- **Memory Efficient** - Streaming directory reads, minimal allocations\n\n## 🎯 Use Cases\n\n- **📚 Learning** - Quickly clone course materials and tutorials\n- **🔧 Development** - Maintain consistent project structure across teams\n- **🤖 CI/CD** - Bulk repository setup in automation pipelines\n- **🔍 Research** - Rapidly explore multiple open source projects\n- **📋 Backup** - Mirror repositories locally with organized structure\n- **🏢 Enterprise** - Standardized repository organization\n\n## 📊 Status \u0026 Monitoring\n\nThe tool provides detailed feedback during operation:\n\n```bash\n# Progress indicators for multiple repositories\ngclone repo1.git repo2.git repo3.git\n# processed 3 repositories: 2 successful, 1 failed\n\n# Existing repositories are detected\ngclone https://github.com/existing/repo.git\n# repository already exists: /home/user/src/github.com/existing/repo\n\n# Graceful interrupt handling\n^C Received signal interrupt, initiating graceful shutdown...\nGraceful shutdown completed.\n```\n\n## 🤝 Contributing\n\nContributions are welcome! The codebase features:\n\n- **Dependency Injection** - Clean interfaces for testability\n- **Comprehensive Testing** - Full test coverage with mocks\n- **Security Focus** - Multiple layers of validation\n- **Performance Optimization** - Caching and parallelization\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n---\n\nMade with ❤️ by developers, for developers\n\n⭐ **Star this repo if it helps you stay organized and productive!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuev%2Fgclone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuev%2Fgclone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuev%2Fgclone/lists"}