Run Google Drive via Command Line

Insync
4 min readNov 18, 2014

The way we experience computers today is largely graphical. Whether on a desktop or working out of a mobile device, GUI is what people are most familiar with; the reason we only say ‘most’, is because there are still a number of users out there who operate out of the command line.

While Google Drive hasn’t released an official client for Linux, we at Insync have built one, and we kept in mind that running Drive via the command line would mean doing so with the full functionality of our client without the dependencies of a full desktop environment.

Being able to run on the command line makes it powerful and useful in server environments. For example a user can automate certain functions via scripts, making it possible for routine work such as accepting shares from others or pausing and/or resuming sync at set periods, to be run at off-peak hours, allowing a better way to maximize bandwidth.

A set up like this works well for users who prefer to utilize the command line for its minimalist approach and simplified interface. It is also applicable in a business scenario, where instead of having all your employees install Google Drive on their individual machines, a company can opt to install an application capable of running Google Drive on a local server and in turn, that server would then sync shared files and allow users access.

CLI-Drive Integration

Running insync-headless is a simple matter of installing the client and logging in with your account (or accounts—since we do offer multiple account support). For the full installation instructions, please refer to our Linux downloads page under “Repositories”.

Here’s a look at how the process works:

If you’re a first time insync-headless user, you’ll receive this message with instructions for adding an account:

Once you’ve copied the https://insynchq.com/auth link onto your browser, you’ll be prompted to input your account information details and confirm the necessary permissions allowing Insync to manage your Drive.

To wrap things up, just type in insync-headless add_account with the code provided into the command line and you’re all set!

How Insync features translate to CLI

  • Sync progress can be easily viewed by typing in insync-headless and adding the get_sync_progress command.
  • Viewing account information includes all necessary details, such as space used, Insync license type and license expiry.
  • Selective sync divides files uploaded to the user’s Drive from those shared by others (much like it’s GUI counterpart) and single-letter commands are available to allow ease of selection for the items that need to be synced.
  • Symbolic links allow better management of shortcuts for directories, a pretty relevant feature when you’re working via CLI.
F

Whether it’s checking Drive status, sharing and syncing files, getting private, public and domain links, or setting up personal preferences and configuring proxies, there is a list of commands ready to help users maximize the use their cloud.

If you’re a user inclined to working out of CLI, or looking for a client to integrate your Google Drive onto your servers—insync-headless could just be for you.

--

--

Insync

Do more with cloud storage. Do more with Google Drive.