Is there a command line utility to script uploads to Google Drive and share items?

Posted on


Me and my team are using Google Drive to share results of our build processes. We used to have a shared drive on some server, accessible to all members. We run Windows XP and Win7.
Now, several team members from other locations have joined the team, and we have all switched to Google Drive – this decision is final. So far I have only seen the web front-end and I’m not aware of any other FEs.

However, manually copying build results into Google Drive is tedious, and I would like to automate things: Uploading, and sharing with the team. I have no intention of writing some extensive piece of software using the SDK, but a small script is not a problem.
I checked the web, and found dozens of snippets using the Drive SDK, but they still need much work; command-line utilities running on various flavors of Unix/Linux, not an option for Windows users; and one Windows tool, GoogleCL. The latter seemed promising, but has not been updated since 2011, and apparently isn’t able to share the uploaded file with a team.

I see two possibilities: An automatic synchronisation between a specific Windows folder on my machine and a specific Google Drive folder that is already and permanently shared within the team; or a command line utility like copy/xcopy/robocopy to upload and share files using Google Drive.
Any ideas?


I don’t know if I understand you right, but Google Drive provides a “local” folder, like dropbox, where you can put your file in it and it will sync with the google-drive server.

So why not create a folder inside that google-drive folder and work in there.
You can use one folder and share it with your team-members. So, every time you save your work, it will be saved and uploaded to the shared folder from google-drive.

There is a utility called gdrive which acts as a Google Drive client for Linux, Windows and macOS.

It has the following functionalitites:

  • List files
  • Download file or directory
  • Download all files and directories matching query
  • Upload file or directory
  • Upload file from stdin
  • Update file, this creates a new revision of the file
  • Show file info
  • Create directory
  • Share file or directory
  • List files permissions
  • Revoke permission
  • Delete file or directory
  • List all syncable directories on drive
  • List content of syncable directory
  • Sync drive directory to local directory
  • Sync local directory to drive
  • List file changes
  • List file revisions
  • Download revision
  • Delete file revision
  • Upload and convert file to a google document, see ‘about import’ for available conversions
  • Export a google document
  • Google drive metadata, quota usage

The tool was unmaintained for a few years but should now (soon?) be getting updates.

Leave a Reply

Your email address will not be published. Required fields are marked *