gclone
Lightweight GitHub private repository clone CLI for macOS.
PyPI package:
codesyariah-gclone. The command remainsgclone.
gclone is a simple command-line tool built with Python that makes cloning private GitHub repositories easier without manually putting a Personal Access Token (PAT) into the Git URL.
Features
- Clone private GitHub repositories
- Store GitHub credentials securely in macOS Keychain
- No GitHub CLI required
- No PAT in Git remote URLs
- No plaintext credential file
- Simple
owner/repositorysyntax - Automatically clone repositories into
~/Projects - Automatically open the cloned project in VS Code
- Built using Python standard library and native macOS tools
Requirements
- macOS
- Python 3
- Git
- GitHub account with access to the repository
- GitHub Personal Access Token (PAT)
Installation
From PyPI
python3 -m pip install --user --upgrade codesyariah-gclone
Verify the installation:
gclone help
From source
Clone this repository:
git clone https://github.com/YOUR_USERNAME/gclone.git
cd gclone
Make the installer executable:
chmod +x install.sh
Run the installer:
./install.sh
Reload your shell:
source ~/.zshrc
Verify the installation:
which gclone
Expected:
/Users/YOUR_USERNAME/.local/bin/gclone
Then:
gclone help
Authentication
Before cloning a private repository, configure your GitHub credential:
gclone auth
You will be asked for:
GitHub username:
GitHub Personal Access Token:
The PAT is entered securely and is not displayed in the terminal.
The credential is stored in the macOS Keychain.
Check authentication status:
gclone auth --status
Example:
✓ GitHub credential ditemukan.
Username : your-github-username
Token : ********
Clone a Repository
The simplest way to clone a repository:
gclone owner/repository
Example:
gclone wanguntechno/fe-wangun-compro
The repository will be cloned into:
~/Projects/fe-wangun-compro
After cloning, gclone displays:
- Repository location
- Current branch
- Git remote URL
It also offers to open the project automatically in VS Code.
Explicit Clone Command
You can also use:
gclone clone owner/repository
Example:
gclone clone wanguntechno/fe-wangun-compro
Custom Clone Directory
Specify a custom directory:
gclone clone owner/repository --dir ~/Work
Example:
gclone clone wanguntechno/fe-wangun-compro --dir ~/Work
Open in VS Code
After cloning, gclone can automatically open the project using the code command.
Example:
Buka project di VS Code? [Y/n]: Y
✓ VS Code dibuka.
Make sure the VS Code code command is available in your PATH.
Check:
which code
Logout
Remove the stored GitHub credential from macOS Keychain:
gclone logout
Example:
✓ Credential 'your-github-username' berhasil dihapus.
Security
gclone is designed to avoid putting the GitHub PAT directly into the repository URL.
Recommended
https://github.com/owner/repository.git
Not recommended
https://<PERSONAL_ACCESS_TOKEN>@github.com/owner/repository.git
The Git remote created by gclone does not contain the PAT.
For example:
git remote -v
returns:
origin https://github.com/wanguntechno/fe-wangun-compro.git (fetch)
origin https://github.com/wanguntechno/fe-wangun-compro.git (push)
The PAT is stored separately using macOS Keychain.
Available Commands
gclone owner/repository
gclone clone owner/repository
gclone clone owner/repository --dir ~/Projects
gclone auth
gclone auth --status
gclone auth --verify
gclone logout
gclone help
Project Structure
gclone/
├── gclone.py
├── pyproject.toml
├── LICENSE
├── install.sh
└── README.md
gclone.py
Main CLI application.
Responsible for:
- CLI commands
- Git clone
- GitHub credential handling
- macOS Keychain integration
- VS Code integration
install.sh
Installation script that:
- Creates the local executable directory
- Installs
gclone - Creates the CLI launcher
- Adds
~/.local/binto the shell PATH
README.md
Project documentation.
How It Works
The basic workflow is:
gclone owner/repository
│
▼
Read credential
from Keychain
│
▼
Git clone
│
▼
Private GitHub
repository
│
▼
~/Projects/repo
│
▼
VS Code
The Git remote remains clean and does not contain the PAT.
Roadmap
Planned improvements:
- GitHub credential verification
- Support GitHub repository URLs
- Clone specific branches
--no-codeoption- Repository access checking
- Recent repositories
- Open previously cloned repositories
- Git repository status
- Improved interactive CLI
- Modular project architecture
License
MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codesyariah_gclone-0.1.0.tar.gz.
File metadata
- Download URL: codesyariah_gclone-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4782b2a588ff6555ccd95fe8a939a9c006e1f667d0b9a6dbaaf2decb410d5310
|
|
| MD5 |
d46d12038861915668dd487fecb3ff0d
|
|
| BLAKE2b-256 |
f332d764bc188181458b6f1de700dc672c287a43deb293a11ddc28a7b5f1b852
|
File details
Details for the file codesyariah_gclone-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codesyariah_gclone-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c33063892364355ede03a4c7982605fa54add872e206dbfc1c9212d15672f96
|
|
| MD5 |
6c76e9498447a30d2176aaa5d13ff1ef
|
|
| BLAKE2b-256 |
d996d73c70bacecd3a742cc737d1c1e9e87bd0eac3d2ee940bcc083181d09daa
|