Skip to main content

gclone

Lightweight GitHub private repository clone CLI for macOS.

PyPI package: codesyariah-gclone. The command remains gclone.

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/repository syntax
  • 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.

https://github.com/owner/repository.git
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/bin to 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-code option
  • Repository access checking
  • Recent repositories
  • Open previously cloned repositories
  • Git repository status
  • Improved interactive CLI
  • Modular project architecture

License

MIT License.

Metadata

Release files for codesyariah-gclone 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codesyariah-gclone 0.1.0
File Size Uploaded Provenance Actions
codesyariah_gclone-0.1.0.tar.gz 7.7 kB Without provenance Details for codesyariah_gclone-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codesyariah-gclone 0.1.0
File Interpreter ABI Platform Actions
codesyariah_gclone-0.1.0-py3-none-any.whl Python 3 none any Details for codesyariah_gclone-0.1.0-py3-none-any.whl

Total release size: 15.7 kB

Release files / codesyariah_gclone-0.1.0.tar.gz

Download URL codesyariah_gclone-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4782b2a588ff6555ccd95fe8a939a9c006e1f667d0b9a6dbaaf2decb410d5310
BLAKE2b-256 checksum
How to use checksums
f332d764bc188181458b6f1de700dc672c287a43deb293a11ddc28a7b5f1b852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / codesyariah_gclone-0.1.0-py3-none-any.whl

Download URL codesyariah_gclone-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c33063892364355ede03a4c7982605fa54add872e206dbfc1c9212d15672f96
BLAKE2b-256 checksum
How to use checksums
d996d73c70bacecd3a742cc737d1c1e9e87bd0eac3d2ee940bcc083181d09daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for codesyariah-gclone 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page