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.
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.
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 :
@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 :
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.
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.
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
- In order to initialise a directory for synchronisation, we need to use the command
- (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.
- Then we paste the
credentials.jsonfile generated by Google inside the config folder in .sink.
- Then run
sink initdriveto verify your credentials and initialise the directory on your drive.
- For just scanning the changes in the directory, we use
- For syncing/commiting the changes to drive, we use the command
sink sync. We can also the
-moption along with
sink syncto log a commit message.
- 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 statuscan be used to see te config details for the current directory
- Yash Thakre : @thakreyn
Contributions are always welcome! Your feedback will help me grow as a developer and help me build better and more usable apps.