prasmussen /gdrive

Google Drive CLI Client

★ 8,938⑂ 1,151👁 0⑃ 74● 593▤ 2
GoMITCreated 2013-01-01
Download: 2.1.12.1.1 ↓2.1.12021-05-28
+0
Daily
8,938
stars
1,151
forks
0
watchers
74
prs
593
issues
2
releases

README

IMPORTANT
This repository is not maintained anymore. Gdrive 3 is its successor.




















 Prerequisites
None, binaries are statically linked.
If you want to compile from source you need the go toolchain.
Version 1.5 or higher.

 Installation
 With Homebrew on Mac

brew install gdrive

 Other
Download gdrive from one of the links in the latest release.
The first time gdrive is launched (i.e. run gdrive about in your
terminal not just gdrive), you will be prompted for a verification code.
The code is obtained by following the printed url and authenticating with the
google account for the drive you want access to. This will create a token file
inside the .gdrive folder in your home directory. Note that anyone with access
to this file will also have access to your google drive.
If you want to manage multiple drives you can use the global --config flag
or set the environment variable GDRIVE_CONFIG_DIR.
Example: GDRIVE_CONFIG_DIR="/home/user/.gdrive-secondary" gdrive list
You will be prompted for a new verification code if the folder does not exist.

 Compile from source
bash
go get github.com/prasmussen/gdrive

The gdrive binary should now be available at $GOPATH/bin/gdrive


 Syncing
Gdrive supports basic syncing. It only syncs one way at the time and works
more like rsync than e.g. dropbox. Files that are synced to google drive
are tagged with an appProperty so that the files on drive can be traversed
faster. This means that you can't upload files with gdrive upload into
a sync directory as the files would be missing the sync tag, and would be
ignored by the sync commands.
The current implementation is slow and uses a lot of memory if you are
syncing many files. Currently only one file is uploaded at the time,
the speed can be improved in the future by uploading several files concurrently.
To learn more see usage and the examples below.

 Service Account
For server to server communication, where user interaction is not a viable option, 
is it possible to use a service account, as described in this Google document.
If you want to use a service account, instead of being interactively prompted for
authentication, you need to use the --service-account  
global option, where serviceAccountCredentials is a file in JSON format obtained
through the Google API Console, and its location is relative to the config dir. 

 .gdriveignore
Placing a .gdriveignore in the root of your sync directory can be used to
skip certain files from being synced. .gdriveignore follows the same
rules as .gitignore, except that gdrive only reads the .gdriveignore file in the root of the sync directory, not ones in any subdirectories.


 Usage

gdrive [global] list [options]                                 List files
gdrive [global] download [options]                     Download file or directory
gdrive [global] download query [options]                Download all files and directories matching query
gdrive [global] upload [options]                         Upload file o

Top issues

Latest release

2.1.1 2.1.1 2021-05-28
Testing release action

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON