[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5114":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":20,"defaultBranch":21,"hasWiki":19,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":26,"discoverSource":27},5114,"gdrive","prasmussen\u002Fgdrive","prasmussen","Google Drive CLI Client",null,"Go",8969,1160,8972,399,0,2,40.19,"MIT License",true,false,"master",[],"2026-06-12 02:01:08","## IMPORTANT\nThis repository is not maintained anymore. [Gdrive 3](https:\u002F\u002Fgithub.com\u002Fglotlabs\u002Fgdrive) is its successor.\n\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n```\n\n## Prerequisites\nNone, binaries are statically linked.\nIf you want to compile from source you need the [go toolchain](http:\u002F\u002Fgolang.org\u002Fdoc\u002Finstall).\nVersion 1.5 or higher.\n\n## Installation\n### With [Homebrew](http:\u002F\u002Fbrew.sh) on Mac\n```\nbrew install gdrive\n```\n### Other\nDownload `gdrive` from one of the [links in the latest release](https:\u002F\u002Fgithub.com\u002Fprasmussen\u002Fgdrive\u002Freleases).\nThe first time gdrive is launched (i.e. run `gdrive about` in your\nterminal not just `gdrive`), you will be prompted for a verification code.\nThe code is obtained by following the printed url and authenticating with the\ngoogle account for the drive you want access to. This will create a token file\ninside the .gdrive folder in your home directory. Note that anyone with access\nto this file will also have access to your google drive.\nIf you want to manage multiple drives you can use the global `--config` flag\nor set the environment variable `GDRIVE_CONFIG_DIR`.\nExample: `GDRIVE_CONFIG_DIR=\"\u002Fhome\u002Fuser\u002F.gdrive-secondary\" gdrive list`\nYou will be prompted for a new verification code if the folder does not exist.\n\n## Compile from source\n```bash\ngo get github.com\u002Fprasmussen\u002Fgdrive\n```\nThe gdrive binary should now be available at `$GOPATH\u002Fbin\u002Fgdrive`\n\n\n### Syncing\nGdrive supports basic syncing. It only syncs one way at the time and works\nmore like rsync than e.g. dropbox. Files that are synced to google drive\nare tagged with an appProperty so that the files on drive can be traversed\nfaster. This means that you can't upload files with `gdrive upload` into\na sync directory as the files would be missing the sync tag, and would be\nignored by the sync commands.\nThe current implementation is slow and uses a lot of memory if you are\nsyncing many files. Currently only one file is uploaded at the time,\nthe speed can be improved in the future by uploading several files concurrently.\nTo learn more see usage and the examples below.\n\n### Service Account\nFor server to server communication, where user interaction is not a viable option, \nis it possible to use a service account, as described in this [Google document](https:\u002F\u002Fdevelopers.google.com\u002Fidentity\u002Fprotocols\u002FOAuth2ServiceAccount).\nIf you want to use a service account, instead of being interactively prompted for\nauthentication, you need to use the `--service-account \u003CserviceAccountCredentials>` \nglobal option, where `serviceAccountCredentials` is a file in JSON format obtained\nthrough the Google API Console, and its location is relative to the config dir. \n\n#### .gdriveignore\nPlacing a .gdriveignore in the root of your sync directory can be used to\nskip certain files from being synced. .gdriveignore follows the same\nrules as [.gitignore](https:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgitignore), except that gdrive only reads the .gdriveignore file in the root of the sync directory, not ones in any subdirectories.\n\n\n## Usage\n```\ngdrive [global] list [options]                                 List files\ngdrive [global] download [options] \u003CfileId>                    Download file or directory\ngdrive [global] download query [options] \u003Cquery>               Download all files and directories matching query\ngdrive [global] upload [options] \u003Cpath>                        Upload file or directory\ngdrive [global] upload - [options] \u003Cname>                      Upload file from stdin\ngdrive [global] update [options] \u003CfileId> \u003Cpath>               Update file, this creates a new revision of the file\ngdrive [global] info [options] \u003CfileId>                        Show file info\ngdrive [global] mkdir [options] \u003Cname>                         Create directory\ngdrive [global] share [options] \u003CfileId>                       Share file or directory\ngdrive [global] share list \u003CfileId>                            List files permissions\ngdrive [global] share revoke \u003CfileId> \u003CpermissionId>           Revoke permission\ngdrive [global] delete [options] \u003CfileId>                      Delete file or directory\ngdrive [global] sync list [options]                            List all syncable directories on drive\ngdrive [global] sync content [options] \u003CfileId>                List content of syncable directory\ngdrive [global] sync download [options] \u003CfileId> \u003Cpath>        Sync drive directory to local directory\ngdrive [global] sync upload [options] \u003Cpath> \u003CfileId>          Sync local directory to drive\ngdrive [global] changes [options]                              List file changes\ngdrive [global] revision list [options] \u003CfileId>               List file revisions\ngdrive [global] revision download [options] \u003CfileId> \u003CrevId>   Download revision\ngdrive [global] revision delete \u003CfileId> \u003CrevId>               Delete file revision\ngdrive [global] import [options] \u003Cpath>                        Upload and convert file to a google document, see 'about import' for available conversions\ngdrive [global] export [options] \u003CfileId>                      Export a google document\ngdrive [global] about [options]                                Google drive metadata, quota usage\ngdrive [global] about import                                   Show supported import formats\ngdrive [global] about export                                   Show supported export formats\ngdrive version                                                 Print application version\ngdrive help                                                    Print help\ngdrive help \u003Ccommand>                                          Print command help\ngdrive help \u003Ccommand> \u003Csubcommand>                             Print subcommand help\n```\n\n#### List files\n```\ngdrive [global] list [options]\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n\noptions:\n  -m, --max \u003CmaxFiles>       Max files to list, default: 30\n  -q, --query \u003Cquery>        Default query: \"trashed = false and 'me' in owners\". See https:\u002F\u002Fdevelopers.google.com\u002Fdrive\u002Fsearch-parameters\n  --order \u003CsortOrder>        Sort order. See https:\u002F\u002Fgodoc.org\u002Fgoogle.golang.org\u002Fapi\u002Fdrive\u002Fv3#FilesListCall.OrderBy\n  --name-width \u003CnameWidth>   Width of name column, default: 40, minimum: 9, use 0 for full width\n  --absolute                 Show absolute path to file (will only show path from first parent)\n  --no-header                Dont print the header\n  --bytes                    Size in bytes\n```\n\nList file in subdirectory\n\n\n```\n.\u002Fgdrive list --query \" 'IdOfTheParentFolder' in parents\"\n```\n\n#### Download file or directory\n```\ngdrive [global] download [options] \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -f, --force           Overwrite existing file\n  -r, --recursive       Download directory recursively, documents will be skipped\n  --path \u003Cpath>         Download path\n  --delete              Delete remote file when download is successful\n  --no-progress         Hide progress\n  --stdout              Write file content to stdout\n  --timeout \u003Ctimeout>   Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300\n```\n\n#### Download all files and directories matching query\n```\ngdrive [global] download query [options] \u003Cquery>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -f, --force       Overwrite existing file\n  -r, --recursive   Download directories recursively, documents will be skipped\n  --path \u003Cpath>     Download path\n  --no-progress     Hide progress\n```\n\n#### Upload file or directory\n```\ngdrive [global] upload [options] \u003Cpath>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -r, --recursive               Upload directory recursively\n  -p, --parent \u003Cparent>         Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents\n  --name \u003Cname>                 Filename\n  --description \u003Cdescription>   File description\n  --no-progress                 Hide progress\n  --mime \u003Cmime>                 Force mime type\n  --share                       Share file\n  --delete                      Delete local file when upload is successful\n  --timeout \u003Ctimeout>           Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300\n  --chunksize \u003Cchunksize>       Set chunk size in bytes, default: 8388608\n```\n\n#### Upload file from stdin\n```\ngdrive [global] upload - [options] \u003Cname>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -p, --parent \u003Cparent>         Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents\n  --chunksize \u003Cchunksize>       Set chunk size in bytes, default: 8388608\n  --description \u003Cdescription>   File description\n  --mime \u003Cmime>                 Force mime type\n  --share                       Share file\n  --timeout \u003Ctimeout>           Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300\n  --no-progress                 Hide progress\n```\n\n#### Update file, this creates a new revision of the file\n```\ngdrive [global] update [options] \u003CfileId> \u003Cpath>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -p, --parent \u003Cparent>         Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents\n  --name \u003Cname>                 Filename\n  --description \u003Cdescription>   File description\n  --no-progress                 Hide progress\n  --mime \u003Cmime>                 Force mime type\n  --timeout \u003Ctimeout>           Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300\n  --chunksize \u003Cchunksize>       Set chunk size in bytes, default: 8388608\n```\n\n#### Show file info\n```\ngdrive [global] info [options] \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --bytes   Show size in bytes\n```\n\n#### Create directory\n```\ngdrive [global] mkdir [options] \u003Cname>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -p, --parent \u003Cparent>         Parent id of created directory, can be specified multiple times to give many parents\n  --description \u003Cdescription>   Directory description\n```\n\n#### Share file or directory\n```\ngdrive [global] share [options] \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --role \u003Crole>     Share role: owner\u002Fwriter\u002Fcommenter\u002Freader, default: reader\n  --type \u003Ctype>     Share type: user\u002Fgroup\u002Fdomain\u002Fanyone, default: anyone\n  --email \u003Cemail>   The email address of the user or group to share the file with. Requires 'user' or 'group' as type\n  --discoverable    Make file discoverable by search engines\n  --revoke          Delete all sharing permissions (owner roles will be skipped)\n```\n\n#### List files permissions\n```\ngdrive [global] share list \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n```\n\n#### Revoke permission\n```\ngdrive [global] share revoke \u003CfileId> \u003CpermissionId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n```\n\n#### Delete file or directory\n```\ngdrive [global] delete [options] \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -r, --recursive   Delete directory and all it's content\n```\n\n#### List all syncable directories on drive\n```\ngdrive [global] sync list [options]\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --no-header   Dont print the header\n```\n\n#### List content of syncable directory\n```\ngdrive [global] sync content [options] \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --order \u003CsortOrder>        Sort order. See https:\u002F\u002Fgodoc.org\u002Fgoogle.golang.org\u002Fapi\u002Fdrive\u002Fv3#FilesListCall.OrderBy\n  --path-width \u003CpathWidth>   Width of path column, default: 60, minimum: 9, use 0 for full width\n  --no-header                Dont print the header\n  --bytes                    Size in bytes\n```\n\n#### Sync drive directory to local directory\n```\ngdrive [global] sync download [options] \u003CfileId> \u003Cpath>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --keep-remote         Keep remote file when a conflict is encountered\n  --keep-local          Keep local file when a conflict is encountered\n  --keep-largest        Keep largest file when a conflict is encountered\n  --delete-extraneous   Delete extraneous local files\n  --dry-run             Show what would have been transferred\n  --no-progress         Hide progress\n  --timeout \u003Ctimeout>   Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300\n```\n\n#### Sync local directory to drive\n```\ngdrive [global] sync upload [options] \u003Cpath> \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --keep-remote             Keep remote file when a conflict is encountered\n  --keep-local              Keep local file when a conflict is encountered\n  --keep-largest            Keep largest file when a conflict is encountered\n  --delete-extraneous       Delete extraneous remote files\n  --dry-run                 Show what would have been transferred\n  --no-progress             Hide progress\n  --timeout \u003Ctimeout>       Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300\n  --chunksize \u003Cchunksize>   Set chunk size in bytes, default: 8388608\n```\n\n#### List file changes\n```\ngdrive [global] changes [options]\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -m, --max \u003CmaxChanges>     Max changes to list, default: 100\n  --since \u003CpageToken>        Page token to start listing changes from\n  --now                      Get latest page token\n  --name-width \u003CnameWidth>   Width of name column, default: 40, minimum: 9, use 0 for full width\n  --no-header                Dont print the header\n```\n\n#### List file revisions\n```\ngdrive [global] revision list [options] \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --name-width \u003CnameWidth>   Width of name column, default: 40, minimum: 9, use 0 for full width\n  --no-header                Dont print the header\n  --bytes                    Size in bytes\n```\n\n#### Download revision\n```\ngdrive [global] revision download [options] \u003CfileId> \u003CrevId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -f, --force           Overwrite existing file\n  --no-progress         Hide progress\n  --stdout              Write file content to stdout\n  --path \u003Cpath>         Download path\n  --timeout \u003Ctimeout>   Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300\n```\n\n#### Delete file revision\n```\ngdrive [global] revision delete \u003CfileId> \u003CrevId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n```\n\n#### Upload and convert file to a google document, see 'about import' for available conversions\n```\ngdrive [global] import [options] \u003Cpath>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -p, --parent \u003Cparent>   Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents\n  --no-progress           Hide progress\n```\n\n#### Export a google document\n```\ngdrive [global] export [options] \u003CfileId>\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  -f, --force     Overwrite existing file\n  --mime \u003Cmime>   Mime type of exported file\n  --print-mimes   Print available mime types for given file\n```\n\n#### Google drive metadata, quota usage\n```\ngdrive [global] about [options]\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n  \noptions:\n  --bytes   Show size in bytes\n```\n\n#### Show supported import formats\n```\ngdrive [global] about import\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n```\n\n#### Show supported export formats\n```\ngdrive [global] about export\n\nglobal:\n  -c, --config \u003CconfigDir>         Application path, default: \u002FUsers\u002F\u003Cuser>\u002F.gdrive\n  --refresh-token \u003CrefreshToken>   Oauth refresh token used to get access token (for advanced users)\n  --access-token \u003CaccessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)\n  --service-account \u003CaccountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)\n```\n\n\n## Examples\n#### List files\n```\n$ gdrive list\nId                             Name                    Type   Size     Created\n0B3X9GlR6EmbnZ3gyeGw4d3ozbUk   drive-windows-x64.exe   bin    6.6 MB   2015-07-18 16:43:58\n0B3X9GlR6EmbnTXlSc1FqV1dvSTQ   drive-windows-386.exe   bin    5.2 MB   2015-07-18 16:43:53\n0B3X9GlR6EmbnVjIzMDRqck1aekE   drive-osx-x64           bin    6.5 MB   2015-07-18 16:43:50\n0B3X9GlR6EmbnbEpXdlhza25zT1U   drive-osx-386           bin    5.2 MB   2015-07-18 16:43:41\n0B3X9GlR6Embnb095MGxEYmJhY2c   drive-linux-x64         bin    6.5 MB   2015-07-18 16:43:38\n```\n\n#### List largest files\n```\n$ gdrive list --query \"name contains 'gdrive'\" --order \"quotaBytesUsed desc\" -m 3\nId                             Name                     Type   Size     Created\n0B3X9GlR6EmbnZXpDRG1xblM2LTg   gdrive-linux-mips64      bin    8.5 MB   2016-02-22 21:07:04\n0B3X9GlR6EmbnNW5CTV8xdFkxTjg   gdrive-linux-mips64le    bin    8.5 MB   2016-02-22 21:07:07\n0B3X9GlR6EmbnZ1NGS25FdEVlWEk   gdrive-osx-x64           bin    8.3 MB   2016-02-21 20:22:13\n```\n\n#### Upload file\n```\n$ gdrive upload gdrive-osx-x64\nUploading gdrive-osx-x64\nUploaded 0B3X9GlR6EmbnZ1NGS25FdEVlWEk at 3.8 MB\u002Fs, total 8.3 MB\n```\n\n#### Make directory\n```\n$ gdrive mkdir gdrive-bin\nDirectory 0B3X9GlR6EmbnY1RLVTk5VUtOVkk created\n```\n\n#### Upload file to directory\n```\n$ gdrive upload --parent 0B3X9GlR6EmbnY1RLVTk5VUtOVkk gdrive-osx-x64\nUploading gdrive-osx-x64\nUploaded 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E at 2.5 MB\u002Fs, total 8.3 MB\n```\n\n#### Download file\n```\n$ gdrive download 0B3X9GlR6EmbnZ1NGS25FdEVlWEk\nDownloading gdrive-osx-x64 -> gdrive-osx-x64\nDownloaded 0B3X9GlR6EmbnZ1NGS25FdEVlWEk at 8.3 MB\u002Fs, total 8.3 MB\n```\n\n#### Share a file\n```\n$ gdrive share 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E\nGranted reader permission to anyone\n```\n\n#### Pipe content directly to google drive\n```\n$ echo \"Hello World\" | gdrive upload - hello.txt\nUploading hello.txt\nUploaded 0B3X9GlR6EmbnaXVrOUpIcWlUS0E at 8.0 B\u002Fs, total 12.0 B\n```\n\n#### Print file to stdout\n```\n$ gdrive download --stdout 0B3X9GlR6EmbnaXVrOUpIcWlUS0E\nHello World\n```\n\n#### Get file info\n```\n$ gdrive info 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E\nId: 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E\nName: gdrive-osx-x64\nPath: gdrive-bin\u002Fgdrive-osx-x64\nMime: application\u002Foctet-stream\nSize: 8.3 MB\nCreated: 2016-02-21 20:47:04\nModified: 2016-02-21 20:47:04\nMd5sum: b607f29231a3b2d16098c4212516470f\nShared: True\nParents: 0B3X9GlR6EmbnY1RLVTk5VUtOVkk\nViewUrl: https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F0B3X9GlR6EmbnNTk0SkV0bm5Hd0E\u002Fview?usp=drivesdk\nDownloadUrl: https:\u002F\u002Fdocs.google.com\u002Fuc?id=0B3X9GlR6EmbnNTk0SkV0bm5Hd0E&export=download\n```\n\n#### Update file (create new revision)\n```\n$ gdrive update 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E gdrive-osx-x64\nUploading gdrive-osx-x64\nUpdated 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E at 2.0 MB\u002Fs, total 8.3 MB\n```\n\n#### List file revisions\n```\n$ gdrive revision list 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E\nId                                                    Name             Size     Modified              KeepForever\n0B3X9GlR6EmbnOFlHSTZQNWJWMGN2ckZucC9VaEUwczV1cUNrPQ   gdrive-osx-x64   8.3 MB   2016-02-21 20:47:04   False\n0B3X9GlR6EmbndVEwMlZCUldGWUlPb2lTS25rOFo1L2t6c2ZVPQ   gdrive-osx-x64   8.3 MB   2016-02-21 21:12:09   False\n```\n\n#### Download revision\n```\n$ gdrive revision download 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E 0B3X9GlR6EmbnOFlHSTZQNWJWMGN2ckZucC9VaEUwczV1cUNrPQ\nDownloading gdrive-osx-x64 -> gdrive-osx-x64\nDownload complete, rate: 8.3 MB\u002Fs, total size: 8.3 MB\n```\n\n#### Export google doc as docx\n```\n$ gdrive export --mime application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document 1Kt5A8X7X2RQrEi5t6Y9W1LayRc4hyrFiG63y2dIJEvk\nExported 'foo.docx' with mime type: 'application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document'\n```\n\n#### Import csv as google spreadsheet\n```\n$ gdrive import foo.csv\nImported 1mTl3DjIvap4tpTX_oMkDcbDT8ShtiGJRlozTfkXpeko with mime type: 'application\u002Fvnd.google-apps.spreadsheet'\n```\n\n#### Syncing directory to drive\n```\n# Create directory on drive\n$ gdrive mkdir drive-bin\nDirectory 0B3X9GlR6EmbnOEd6cEh6bU9XZWM created\n\n# Sync to drive\n$ gdrive sync upload _release\u002Fbin 0B3X9GlR6EmbnOEd6cEh6bU9XZWM\nStarting sync...\nCollecting local and remote file information...\nFound 32 local files and 0 remote files\n\n6 remote directories are missing\n[0001\u002F0006] Creating directory drive-bin\u002Fbsd\n[0002\u002F0006] Creating directory drive-bin\u002Flinux\n[0003\u002F0006] Creating directory drive-bin\u002Fosx\n[0004\u002F0006] Creating directory drive-bin\u002Fplan9\n[0005\u002F0006] Creating directory drive-bin\u002Fsolaris\n[0006\u002F0006] Creating directory drive-bin\u002Fwindows\n\n26 remote files are missing\n[0001\u002F0026] Uploading bsd\u002Fgdrive-dragonfly-x64 -> drive-bin\u002Fbsd\u002Fgdrive-dragonfly-x64\n[0002\u002F0026] Uploading bsd\u002Fgdrive-freebsd-386 -> drive-bin\u002Fbsd\u002Fgdrive-freebsd-386\n[0003\u002F0026] Uploading bsd\u002Fgdrive-freebsd-arm -> drive-bin\u002Fbsd\u002Fgdrive-freebsd-arm\n[0004\u002F0026] Uploading bsd\u002Fgdrive-freebsd-x64 -> drive-bin\u002Fbsd\u002Fgdrive-freebsd-x64\n[0005\u002F0026] Uploading bsd\u002Fgdrive-netbsd-386 -> drive-bin\u002Fbsd\u002Fgdrive-netbsd-386\n[0006\u002F0026] Uploading bsd\u002Fgdrive-netbsd-arm -> drive-bin\u002Fbsd\u002Fgdrive-netbsd-arm\n[0007\u002F0026] Uploading bsd\u002Fgdrive-netbsd-x64 -> drive-bin\u002Fbsd\u002Fgdrive-netbsd-x64\n[0008\u002F0026] Uploading bsd\u002Fgdrive-openbsd-386 -> drive-bin\u002Fbsd\u002Fgdrive-openbsd-386\n[0009\u002F0026] Uploading bsd\u002Fgdrive-openbsd-arm -> drive-bin\u002Fbsd\u002Fgdrive-openbsd-arm\n[0010\u002F0026] Uploading bsd\u002Fgdrive-openbsd-x64 -> drive-bin\u002Fbsd\u002Fgdrive-openbsd-x64\n[0011\u002F0026] Uploading linux\u002Fgdrive-linux-386 -> drive-bin\u002Flinux\u002Fgdrive-linux-386\n[0012\u002F0026] Uploading linux\u002Fgdrive-linux-arm -> drive-bin\u002Flinux\u002Fgdrive-linux-arm\n[0013\u002F0026] Uploading linux\u002Fgdrive-linux-arm64 -> drive-bin\u002Flinux\u002Fgdrive-linux-arm64\n[0014\u002F0026] Uploading linux\u002Fgdrive-linux-mips64 -> drive-bin\u002Flinux\u002Fgdrive-linux-mips64\n[0015\u002F0026] Uploading linux\u002Fgdrive-linux-mips64le -> drive-bin\u002Flinux\u002Fgdrive-linux-mips64le\n[0016\u002F0026] Uploading linux\u002Fgdrive-linux-ppc64 -> drive-bin\u002Flinux\u002Fgdrive-linux-ppc64\n[0017\u002F0026] Uploading linux\u002Fgdrive-linux-ppc64le -> drive-bin\u002Flinux\u002Fgdrive-linux-ppc64le\n[0018\u002F0026] Uploading linux\u002Fgdrive-linux-x64 -> drive-bin\u002Flinux\u002Fgdrive-linux-x64\n[0019\u002F0026] Uploading osx\u002Fgdrive-osx-386 -> drive-bin\u002Fosx\u002Fgdrive-osx-386\n[0020\u002F0026] Uploading osx\u002Fgdrive-osx-arm -> drive-bin\u002Fosx\u002Fgdrive-osx-arm\n[0021\u002F0026] Uploading osx\u002Fgdrive-osx-x64 -> drive-bin\u002Fosx\u002Fgdrive-osx-x64\n[0022\u002F0026] Uploading plan9\u002Fgdrive-plan9-386 -> drive-bin\u002Fplan9\u002Fgdrive-plan9-386\n[0023\u002F0026] Uploading plan9\u002Fgdrive-plan9-x64 -> drive-bin\u002Fplan9\u002Fgdrive-plan9-x64\n[0024\u002F0026] Uploading solaris\u002Fgdrive-solaris-x64 -> drive-bin\u002Fsolaris\u002Fgdrive-solaris-x64\n[0025\u002F0026] Uploading windows\u002Fgdrive-windows-386.exe -> drive-bin\u002Fwindows\u002Fgdrive-windows-386.exe\n[0026\u002F0026] Uploading windows\u002Fgdrive-windows-x64.exe -> drive-bin\u002Fwindows\u002Fgdrive-windows-x64.exe\nSync finished in 1m18.891946279s\n\n# Add new local file\n$ echo \"google drive binaries\" > _release\u002Fbin\u002Freadme.txt\n\n# Sync again\n$ gdrive sync upload _release\u002Fbin 0B3X9GlR6EmbnOEd6cEh6bU9XZWM\nStarting sync...\nCollecting local and remote file information...\nFound 33 local files and 32 remote files\n\n1 remote files are missing\n[0001\u002F0001] Uploading readme.txt -> drive-bin\u002Freadme.txt\nSync finished in 2.201339535s\n\n# Modify local file\n$ echo \"for all platforms\" >> _release\u002Fbin\u002Freadme.txt\n\n# Sync again\n$ gdrive sync upload _release\u002Fbin 0B3X9GlR6EmbnOEd6cEh6bU9XZWM\nStarting sync...\nCollecting local and remote file information...\nFound 33 local files and 33 remote files\n\n1 local files has changed\n[0001\u002F0001] Updating readme.txt -> drive-bin\u002Freadme.txt\nSync finished in 1.890244258s\n```\n\n#### List content of sync directory\n```\n$ gdrive sync content 0B3X9GlR6EmbnOEd6cEh6bU9XZWM\nId                             Path                             Type   Size     Modified\n0B3X9GlR6EmbnMldxMFV1UGVMTlE   bsd                              dir             2016-02-21 22:54:00\n0B3X9GlR6EmbnM05sQ3hVUnJnOXc   bsd\u002Fgdrive-dragonfly-x64         bin    7.8 MB   2016-02-21 22:54:14\n0B3X9GlR6EmbnVy1KXzA4dlU5RVE   bsd\u002Fgdrive-freebsd-386           bin    6.1 MB   2016-02-21 22:54:18\n0B3X9GlR6Embnb29QQkFtSlRiZnc   bsd\u002Fgdrive-freebsd-arm           bin    6.1 MB   2016-02-21 22:54:20\n0B3X9GlR6EmbnMkFQYVpSaHhHTXM   bsd\u002Fgdrive-freebsd-x64           bin    7.8 MB   2016-02-21 22:54:23\n0B3X9GlR6EmbnVmJRMl9hUDloVU0   bsd\u002Fgdrive-netbsd-386            bin    6.1 MB   2016-02-21 22:54:25\n0B3X9GlR6EmbnLVlTZWpxOEF4Q2s   bsd\u002Fgdrive-netbsd-arm            bin    6.1 MB   2016-02-21 22:54:28\n0B3X9GlR6EmbnOENUZmh3anJmNG8   bsd\u002Fgdrive-netbsd-x64            bin    7.8 MB   2016-02-21 22:54:30\n0B3X9GlR6EmbnWTRoQ2ZVQXRfQlU   bsd\u002Fgdrive-openbsd-386           bin    6.1 MB   2016-02-21 22:54:32\n0B3X9GlR6EmbncEtlN3ZuQ0VUWms   bsd\u002Fgdrive-openbsd-arm           bin    6.1 MB   2016-02-21 22:54:35\n0B3X9GlR6EmbnMlFLY1ptNEFyZWc   bsd\u002Fgdrive-openbsd-x64           bin    7.8 MB   2016-02-21 22:54:38\n0B3X9GlR6EmbncGtSajQyNzloVEE   linux                            dir             2016-02-21 22:54:01\n0B3X9GlR6EmbnMWVudkJmb1NZdmM   linux\u002Fgdrive-linux-386           bin    6.1 MB   2016-02-21 22:54:40\n0B3X9GlR6Embnbnpla1R2VHV5T2M   linux\u002Fgdrive-linux-arm           bin    6.1 MB   2016-02-21 22:54:42\n0B3X9GlR6EmbnM0s2cU1YWkNJSjA   linux\u002Fgdrive-linux-arm64         bin    7.7 MB   2016-02-21 22:54:45\n0B3X9GlR6EmbnNU9NNi1TdDc4S2c   linux\u002Fgdrive-linux-mips64        bin    8.5 MB   2016-02-21 22:54:47\n0B3X9GlR6EmbnSmdQNjRKZ2dWV1U   linux\u002Fgdrive-linux-mips64le      bin    8.5 MB   2016-02-21 22:54:50\n0B3X9GlR6EmbnS0g0OVgxMHY5Z3c   linux\u002Fgdrive-linux-ppc64         bin    7.8 MB   2016-02-21 22:54:52\n0B3X9GlR6EmbneVp6ZXRpR3FhWlU   linux\u002Fgdrive-linux-ppc64le       bin    7.8 MB   2016-02-21 22:54:54\n0B3X9GlR6EmbnczdJT195dFVxdU0   linux\u002Fgdrive-linux-x64           bin    7.8 MB   2016-02-21 22:54:57\n0B3X9GlR6EmbnTXZXeDRnSDdVS1E   osx                              dir             2016-02-21 22:54:02\n0B3X9GlR6EmbnWnRheXJNR0pUMU0   osx\u002Fgdrive-osx-386               bin    6.6 MB   2016-02-21 22:54:59\n0B3X9GlR6EmbnRzNqMWFXdDR1Rms   osx\u002Fgdrive-osx-arm               bin    6.6 MB   2016-02-21 22:55:01\n0B3X9GlR6EmbnaDlVWTZDd0JIeEU   osx\u002Fgdrive-osx-x64               bin    8.3 MB   2016-02-21 22:55:04\n0B3X9GlR6EmbnWW84UFBvbHlURXM   plan9                            dir             2016-02-21 22:54:02\n0B3X9GlR6EmbnTmc0a2RNdDZDRUU   plan9\u002Fgdrive-plan9-386           bin    5.8 MB   2016-02-21 22:55:07\n0B3X9GlR6EmbnT1pYZ2p4Sk9FVFk   plan9\u002Fgdrive-plan9-x64           bin    7.4 MB   2016-02-21 22:55:10\n0B3X9GlR6EmbnbnZnXzlYVHoxdk0   readme.txt                       bin    40.0 B   2016-02-21 22:59:56\n0B3X9GlR6EmbnSWF1QUlta3RnaGc   solaris                          dir             2016-02-21 22:54:03\n0B3X9GlR6EmbnaWFOV0YxSGs5Znc   solaris\u002Fgdrive-solaris-x64       bin    7.7 MB   2016-02-21 22:55:13\n0B3X9GlR6EmbnNE5ySkEzbWQ4Qms   windows                          dir             2016-02-21 22:54:03\n0B3X9GlR6EmbnX1RIT2w1TWZYWFU   windows\u002Fgdrive-windows-386.exe   bin    6.1 MB   2016-02-21 22:55:15\n0B3X9GlR6EmbndmVMU05POGRPS3c   windows\u002Fgdrive-windows-x64.exe   bin    7.8 MB   2016-02-21 22:55:18\n```\n","prasmussen\u002Fgdrive 是一个用于管理 Google Drive 的命令行工具。它允许用户通过终端执行文件上传、下载、同步等操作，支持服务账号认证以实现无交互的服务器间通信。该工具采用 Go 语言编写，具有静态链接的二进制文件，方便跨平台使用；同时支持从源码编译安装。gdrive 适用于需要脚本化或自动化处理 Google Drive 文件的场景，如数据备份、持续集成中的文件分发等。注意，此仓库已不再维护，其后续版本为 Gdrive 3。","2026-06-11 03:02:36","top_language"]