gdirect README

The project's README from github.com/mizorewww/gdirect. As one markdown file: README.md.

gdirect

Release CI License

中文 · Changelog

Browse, download, upload and mount your Google Drive from networks where Google is blocked, without a proxy for the transfers themselves. gdirect finds Google front-end IPs that your network can still reach and sends Drive traffic straight to them, with multi-connection, resumable downloads.

The gdirect desktop client listing a Drive folder, with one file downloading and others queued

Download for Windows

Download for macOS (Apple silicon)

Download for macOS (Intel)

Download for Linux

Quick start

1. Install (macOS 15+, Linux x86_64 with glibc 2.35+, Windows x86_64)

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/mizorewww/gdirect/main/scripts/install.sh | bash
# or Homebrew (Homebrew 7 asks you to trust a tap before installing from it)
brew tap mizorewww/gdirect https://github.com/mizorewww/gdirect && brew trust mizorewww/gdirect
brew install mizorewww/gdirect/gdirect
# or Arch Linux (AUR)
paru -S gdirect-bin # or yay -S gdirect-bin (use gdirect-git to build from VCS)
# Windows PowerShell
& ([scriptblock]::Create((Invoke-RestMethod 'https://raw.githubusercontent.com/mizorewww/gdirect/main/scripts/install.ps1')))

Add --with-mount (PowerShell: -WithMount) to also install what mount needs. Archives for every platform are on the releases page.

2. Create your Google client — once, about 10 minutes: follow the Google setup guide to download a Desktop app OAuth client JSON.

3. Sign in — a browser opens; signing in needs normal access to Google, so keep a proxy on for this step if Google is blocked:

gdirect login --client-secret ~/Downloads/client_secret.json
# or, without the file: gdirect login --client-id ID   (asks for the secret)

4. Use it

gdirect                          # browse your Drive; press ? for keys, d to download, u to upload
gdirect download FILE_ID_OR_URL  # saves to ./downloads
gdirect upload ./photos -r       # upload a folder; run again to resume
gdirect mount                    # Drive at ~/GoogleDrive

The first transfer scans for reachable Google IPs, which can take about a minute.

[!IMPORTANT] Using a TUN-mode proxy or VPN (sing-box, Clash TUN…)? Nothing to set up: gdirect binds its Google connections to your network adapter, so the tunnel never carries them; sign-in still uses the proxy. Turn this off with gdirect scan --bypass-tun off or in the desktop client's Settings › Network. See Network and proxies.

Desktop app (preview)

The same engine in a Material 3 window: browse and manage files, drag files in to upload, watch the transfer queue, scan and pin endpoints, and switch accounts. It shares the command line's sign-in and settings, follows your system's language (English or Chinese), and adapts to narrow windows.

Transfers Routes Settings
Transfer queue with finished downloads Routes page with latencies Appearance settings

Download it with the buttons at the top, or from the releases page:

To build it yourself, see Building from source.

Documentation

License

GPL-2.0-or-later

gdirect (mizorewww/gdirect)

sni
Searching Database…

What is this?gdirect is a Rust command-line tool that browses, downloads, uploads, and mounts your Google Drive from the terminal, routing Drive traffic through scanned Google IPs for fast, resumable multi-connection transfers.
Is this a GUI app or a terminal tool?It's a terminal CLI with an interactive, file-manager-style TUI for browsing and transferring Drive files, no separate GUI app is provided.
How do I install and get started?Install a prebuilt binary via the curl (macOS/Linux) or PowerShell (Windows) installer, or via Homebrew, then do a one-time Google Cloud setup to create your own OAuth client and run gdirect login.
Do I need my own Google API credentials?Yes, gdirect doesn't ship a shared Google client, so you must create your own OAuth client in a Google Cloud project (about 10 minutes) before you can log in.
Will this let me reach Drive if Google itself is blocked?Only Drive API traffic (browse, download, upload) is routed through scanned reachable Google IPs; sign-in and token refresh still go through your normal network, so you still need a proxy or VPN just for login if Google is blocked there.
Which platforms have ready-to-use builds?Prebuilt binaries cover macOS 15+ (Apple Silicon or Intel), Linux x86_64 with glibc 2.35+, and Windows x86_64; Alpine/musl, older glibc, and Linux ARM64 need a source build instead.
Where are my credentials and settings stored?Credentials, scanned IPs, and settings all live in one private local SQLite file (for example ~/.local/share/gdirect/state.sqlite3 on Linux) and aren't sent anywhere else.
How does gdirect find a working route to Google Drive?It scans candidate Google IPs reachable from your network, probes each with the real TLS SNI then with a forged identity (g.cn as the TLS name, real host in the Host header), and caches the fastest working IP for 24 hours.
How does mounting Google Drive as a filesystem work?Mount uses rclone together with the built-in NFS client on macOS or FUSE3 on Linux (WinFsp on Windows); writes go to a local cache first and upload in the background.
Can I use gdirect in scripts without an interactive login?Yes, the GDIRECT_ACCESS_TOKEN environment variable can supply an access token instead of logging in for most commands, though mount still requires gdirect login.
How does it make sure it's really talking to Google?Certificates are checked against Google's own GTS roots embedded in the binary rather than the system CA bundle, so a compromised third-party CA can't impersonate Google for gdirect.
Creator
mizorewww
Size
7.7 MB
Stars
825
Age
1mo
Commits · 90 Days