How to control Insync 1.x via command line interface (CLI)

You can download our 1.x Headless build here. For non-servers, you can install our GUI build and access CLI via Terminal.

*Note that you’ll be getting our version 1.5.7 and can only sync with Google Drive. We will not be officially supporting Headless on Insync 3 and will only be under community support.

Now let’s get started:

*A small caveat: if you’re running Insync on GUI and would like to use terminal, make sure to use insync instead of insync-headless in all your commands!

To install Insync on your Linux machine: sudo apt install insync-headless

To run Insync after installation: insync-headless start

To add your account , please follow these steps:

  1. Go to https://insynchq.com/auth
  2. Allow Insync access
  3. Copy the given code
  4. On your terminal, type in insync-headless add_account -a CODE

*With CODE as the code you’re given on step 4. The step above will always fail without -a CODE

You should be logged in by now! Welcome to Insync headless :slight_smile:

Here are the basic app commands you’ll need. Alternatively, you can get more information about Insync commands by running insync -h or insync-headless -h

insync-headless start to run Insync

insync-headless quit to stop Insync

insync-headless set_autostart YES|NO is used to set whether or not Insync will automatically boot when starting your computer. Use either yes/no depending on your preference.

To access basic account information, check out the commands below:

insync-headless get_account_information will show information like account quota, folder location, and license type to all accounts connected to Insync.

insync-headless move_folder PREV_PATH NEW_PATH to move your Insync Base Folder with “PREV_PATH” as previous path and “NEW_PATH” as the new path.

insync-headless remove_account EMAIL will remove your account from Insync. Don’t forget to replace EMAIL with the actual email address you want to remove. Please note that all files synced to your machine will remain.

Here are the commands that will help you manage your syncing and your files!

insync-headless pause_syncing will pause all ongoing syncing activities.

insync-headless resume_syncing will resume syncing activities.

insync-headless get_sync_progress will allow you to get an overview of the status of your syncing activities: what files are currently being synced and the remaining files on queue.

insync-headless set_export_option EMAIL SETTING to set how Insync will treat downloaded files.

  • You’ll need to replace EMAIL with the email address of the account that you’re setting the export option for.
  • The values for SETTING are as follows: open-document if you want to convert Google format files to Open Document formats, ms-office if you want to convert to MS Office formats, or link if you want to download the files as links.

Insync will automatically begin downloading your files once you’ve logged in your account, the commands below will allow you to manage your files and folders.

insync-headless manage_selective_sync EMAIL will open a curses interface that will allow you to selectively manage your files. Remember to replace EMAIL with the email of the account you want to selectively sync.

If you’d like to begin to manage other parts of your Drive like Shared With Me or Team Drives, you can simply type? Ctrl + X . This will bring up a menu that will allow you to select your preferred option.

For Team Drives, you will also get the option to simply view your files, sync to a default location, or sync to a separate/custom location. If you want to sync to a separate or custom location, you’ll be given an interface where you can specify the path you want to sync the Team Drives to.

insync-headless get_root_drive_files EMAIL will allow you to check selective sync information for root Drive files and folders of account.

insync-headless set_selective_sync EMAIL FILE_ID SETTING - Set selective sync preference of specified file for given email. The FILE_ID can be found using the insync-headless get_root_drive_files EMAIL command above.

insync-headless manage-ignore-list EMAIL will open a curses interface that will allow you to manage your Ignore List. Don’t forget to add in your email. All the instructions needed for you to manage your Ignore List will be there.

For file commands, don’t forget to include the FULL_PATH of the specific file after the command.

insync-headless force_sync FULL_PATH will force Insync to do a scan on a file to see for changes that need syncing.

‘Insync-headless get_domain_link FULL_PATH` will get the domain link for the file chosen.

‘Insync-headless get_private_link FULL_PATH` will get the private sharing link of the file.

insync-headless get_public_link FULL_PATH will get the public sharing link of the file.

insync-headless get_file_status FULL_PATH will get the syncing status of the file.

insync-headless remove_from_insync FULL_PATH will remove/unsynced file/folder from Insync.

Shared With Me

To view and navigate Shared with Me, run insync-headless manage_selective_sync EMAIL and then type Ctrl+X to open the curses menu that will allow you to access “Shared with me”.

Since Shared With Me is an email-based setting and not an app setting, you should always remember to input your email at the end of the command.

insync-headless accept_all_new_shares EMAIL - Accept all new shares to given account.

insync-headless accept_share FILENAME EMAIL - Accepts a specific shared file to given account. You can find the name of the files using the insync-headless get_new_shares command below.

insync-headless get_new_shares - Shows all new shares across all syncing accounts.

insync-headless reject_share FILENAME EMAIL - Rejects a specific shared file to given account. You can find the name of the files with the insync-headless get_new_shares command below.

insync-headless reject_all_new_shares EMAIL - Reject all new shares to given account.

Below are status commands that allow you to check on your actions required, errors, and syncing status.

insync-headless get_actions_required - Will show required actions (across all accounts) that you need to address.

insync-headless get_recent_changes - Show 20 most recent changes across all accounts.

insync-headless get_sync_progress - Show progress of files being downloaded/uploaded and how many files are queued.

insync-headless get_errors - Will show error messages across all accounts.

insync-headless retry_errors - Retry all errors

insync-headless get_status - Show general syncing status of the app. Below are the meaning of the values that come out when

  • ERROR - There are syncing errors or actions that the user needs to address. Errors can be shown with the insync-headless get_errors command while required actions can be shown with the ‘insync-headless get_actions_required’ command
  • OFFLINE - The client can’t establish a connection to the internet.
  • PAUSED - The client is paused
  • SHARE - There are new files that were shared to the user. These can be viewed with the insync-headless get_new_shares command. You can manage these with the sharing commands or by running insync-headless manage_selective_sync EMAIL and viewing the “Shared with me” section
  • SYNCED - All files are synced
  • SYNCING - Insync is performing syncing activities, which includes getting the metadata of the files from Google Drive
  • UNLINKED - No account is being synced. If an account was added but it is not being synced check the output of insync-headless get_errors and insync-headless get_actions_required

Using insync-headless with proxies.

insync-headless get_proxy - Will show your actual proxy configuration

insync-headless set_proxy MODE TYPE HOST PORT USERNAME PASSWORD - Set the proxy settings as described below

  • MODE can be replaced with SYSTEM, NONE, or MANUAL. If SYSTEM is set , you do not need to input anything else
  • TYPE can be replaced by HTTP, SOCKS4, or SOCKS5
  • HOST is your proxy host
  • PORT is the proxy port
  • USERNAME is the username for proxy authentication (optional)
  • PASSWORD is the password for proxy authentication (optional)

Uninstallation

To uninstall Insync, use the sudo apt-get remove insync-headless command

3 Likes