Sink is a CLI tool that allows users to synchronize their local folders to their Google Drives. It is similar to the Git CLI and allows fast and reliable syncs with the drive.

Related tags

CLI Tools drive-sink
Overview

Sink

Sink is a CLI synchronisation tool that enables a user to synchronise local system files and folders with their Google Drives. It follows a git CLI like approach to facilitate straight-forward and easy synchronsiation. It uses the Google Drive API to interact with the Google Drive and OAuth to verify clients.

Installation

Install from zip file:

Download and extract the drive-sink-main folder to a suitable directory and run the following commands in that folder. (It is advised to install in a virutal environment)

  cd drive-sink-main
  pip install .

Install by cloning:

Set up a new folder and then clone the repo into the folder.

  git clone https://github.com/thakreyn/drive-sink.git
  cd drive-sink-main
  pip install .

After installation, run the command sink from the environment to use the tool.

Sink-main

Script Setup

In case of a virtual environment, one might use the script inside scripts folder by replacing the path inside the sink.bat with the path of sink.exe inside your env/scripts. And then add this script to your environment variables.

Assuming the path of env/scripts is : D:\Projects\trial\env\Scripts\sink.exe

@echo off

:: Replace the  with the absolute path of your env/scripts folder
:startsink  
D:\Projects\trial\env\Scripts\sink.exe %*

(NOTE: Above is applicable for windows only. Linux and Mac users need to create separate scripts)

Google Drive API Setup

As the application is based on the Google Drive API, in order to use it, you need to activate the Google Drive API for your account. Following are the steps to do so :

Enable Drive API for your account

After enabling the Drive API, you need to generate credentials for your account, the following article explains the steps to generate the credentials for your account.

Generate credentials for your account

After generating the credentials, download the .json file with credentials and rename it to credentials.json and paste it in the config folder 'after' initialising a directory.

Documentation

You can type in sink in your terminal or sink --help to see all the available commands available.

  • sink init : Initialise the folder and config details
  • sink initdrive : Verify credentials and sync files to drive
  • sink scan : Scans the directory for changes in files and folders
  • sink sync : Updates/commits the changes to the drive
  • sink log : Shows the commit log
  • sink status : Shows general config information
  • sink clean : Cleans (untracks) the given folder with option to delete drive folder as well

For further options for each command, type sink --help

Usage Demo

  1. In order to initialise a directory for synchronisation, we need to use the command sink init Sink init2
  2. (optional) You can list the files to be ignored in the ignore.txt inside .sink` folder. For ignoring folders, just use an '!' before the name.
    Sink ignore
  3. Then we paste the credentials.json file generated by Google inside the config folder in .sink.
    Sink Cred
  4. Then run sink initdrive to verify your credentials and initialise the directory on your drive. sink initdrive
  5. For just scanning the changes in the directory, we use sink scan Sink scan
  6. For syncing/commiting the changes to drive, we use the command sink sync. We can also the -m option along with sink sync to log a commit message. Sink sync
  7. To view commit messages, we can use the command sink log. Sink log can take in number of lines as an option (defalut = 5). Sink log
  8. sink status can be used to see te config details for the current directory Sink status

License

MIT

Authors

Contributing

Contributions are always welcome! Your feedback will help me grow as a developer and help me build better and more usable apps.

You might also like...
🐍The nx-python plugin allows users to create a basic python application using nx commands.
🐍The nx-python plugin allows users to create a basic python application using nx commands.

🐍 NxPy: Nx Python plugin This project was generated using Nx. The nx-python plugin allows users to create a basic python application using nx command

Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

[WIP]An ani-cli like cli tool for movies and webseries

mov-cli A cli to browse and watch movies. Installation This project is a work in progress. However, you can try it out python git clone https://github

A python based command line tool to compare Github Users or Repositories

gitcomp A simple python package with a CLI to compare GitHub users and repositories by associating a git_score to each entry which is a weighted sum o

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything.After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands. Command line util for grep.app - Search across a half million git repos
Command line util for grep.app - Search across a half million git repos

grepgithub Command line util for grep.app - Search across a half million git repos Grepgithub uses grep.app API to search GitHub repositories, providi

Trans is a dependency-free CLI for Google Translate

Trans is a dependency-free CLI for Google Translate

pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery.
pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery.

pypinfo: View PyPI download statistics with ease. pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery. Installation pypin

Comments
  • No need to delete file when Folder has been deleted already.

    No need to delete file when Folder has been deleted already.

    When a folder has been deleted first, then it's contents are moved to trash in the drive. But if the trash is cleared or disabled then it can raise an error

    enhancement 
    opened by thakreyn 1
  • OS: Source path for Linux is not working for saving credential.txt globally

    OS: Source path for Linux is not working for saving credential.txt globally

    I guess source path for is different for Linux and Windows. Please check and do update with the same!! You have done a great job!! very useful product for daily life and backup.

    opened by sujal0930 1
  • Drive Sync  during Update

    Drive Sync during Update

    There are 2 bugs that I have found during my test :

    1. During the sync of the folder, File name are not getting printed in the terminal
    2. If the folder is deleted in the drive and an edit has been made in the file, then the changes are not been shown. The file should have been uploaded once again. :)
    bug help wanted good first issue 
    opened by sachdev27 1
Releases(Stable)
Owner
Yash Thakre
Yash Thakre
A CLI tool that scans through a directory and organizes all loose files into folders by file type.

Organizer CLI Organizer CLI is a python command line tool that goes through a given directory and organizes all un-folder bound files into folders by

Mulaza Jacinto 6 Dec 14, 2022
git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

Partial Submodules for Git git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's

Nathan Reed 15 Sep 22, 2022
pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo

pyGinit pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo Requirements Requirements be

AlphaBeta 15 Feb 26, 2022
GitFun - A Simplified Automated CLI tool for GIT😃

GitFun A Simplified Automated CLI tool for GIT, It's for Lazy Developers and Newbies ?? Table of contents GitFun Installation Usage Development Contri

Astaqc 8 Feb 22, 2022
A simple command line tool for changing the icons of folders or files on MacOS.

Mac OS File Icon Changer Description A small and simple script to quickly change large amounts or a few files and folders icons to easily customize th

Eroxl 3 Jan 2, 2023
Commandline Python app to Autodownload mediafire folders and files.

Commandline Python app to Autodownload mediafire folders and files.

Tharuk Renuja 3 May 12, 2022
A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool

Privateer A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool How

Shreyash Chavan 2 Apr 4, 2022
AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

Rafael Torres 2 Dec 10, 2021
This tool is a free and unlimited python CLI for google translate. based on google_trans_new.

GoTransPy A free and unlimited python CLI for google translate based on google_trans_new. It's very easy to use and solve the problem that the old api

Youssef Mohamed 2 Jan 10, 2022
A simple file transfer tools, similar to rz / sz but compatible with tmux (control mode), which works with iTerm2 and has a nice progress bar

trzsz A simple file transfer tools, similar to rz/sz but compatible with tmux (control mode), which works with iTerm2 and has a nice progress bar. Why

null 561 Jan 5, 2023