A simple and convenient CLI tool to streamline the GitHub repository cloning process. gclone
allows you to clone repositories with shorter commands and provides additional features like automatically opening projects in VSCode and managing a temporary project directory.
- 🚀 Quick clone with shortened commands
- 📂 Default username configuration
- 💻 Optional VSCode integration
- 📁 Temporary directory management
- ⚙️ User-configurable settings
-
Download the latest release from the releases page.
-
Add the executable to your system's PATH:
- Windows: Move
gclone.exe
to a directory in your PATH (e.g.,C:\Users\YourUsername\bin\
) - Linux/MacOS: Move
gclone
to/usr/local/bin/
or another directory in your PATH
- Windows: Move
-
Run the configuration:
gclone -config
# Clone your own repository (uses configured username)
gclone myrepo
# Clone from specific user/organization
gclone kubernetes/kubernetes
# Clone and open in VSCode
gclone -c myrepo
# Clone to temporary directory
gclone -tmp myrepo
# Combine flags
gclone -c -tmp myrepo
# Run initial setup or update configuration
gclone -config
The configuration will prompt you for:
- Your default GitHub username
- Custom temporary directory path (optional)
Configuration is stored in ~/.gclone/config.json
:
{
"default_username": "yourusername",
"tmp_directory": "C:\\Dev\\tmp"
}
- Git installed and accessible in PATH
- VSCode installed and
code
command available in PATH (only for-c
flag) - Write permissions for temporary directory creation
# Clone your repository 'awesome-project'
gclone awesome-project
# Equivalent to: git clone https://github.com/yourusername/awesome-project
# Clone specific repository
gclone microsoft/vscode
# Equivalent to: git clone https://github.com/microsoft/vscode
# Clone and open in VSCode
gclone -c myproject
# Clone to temporary directory
gclone -tmp experimental-feature
Flag | Description |
---|---|
-c |
Open cloned repository in VSCode |
-tmp |
Clone into configured temporary directory |
-config |
Configure gclone settings |
Contributions are welcome! Please feel free to submit a Pull Request.
# Clone the repository
git clone https://github.com/setsudan/gclone
# Navigate to the directory
cd gclone
# Build the executable
go build -o gclone.exe
MIT License - see the LICENSE file for details
- Inspired by the need for a more streamlined git clone workflow
- Built with Go for cross-platform compatibility
If you encounter any issues or have suggestions, please file an issue on the GitHub repository.