How can I do the equivalent of "Add to My Drive" in rclone?

My workflow 8s usually like below.

  1. Have a set of folders that’s shared with me.
  2. Go to Drive website and “Add to My Drive” for those folders
  3. Work on the shared folder via rclone

I want to eliminate no 2 and do it via rclone. How can I do that?
Something like rclone --addshares myremote:

You can use the --drive-shared-with-me flag which will only show you stuff shared with you. Not sure that will work with your workflow, but it might…

That flag only work after they shared the folder to your account. My workflow is more of finding shared folders not necessarily being shared to my specific account. Then I usually click “Add to My Drive” which then after that it will be available to the flag you mention.

I was looking for more into adding a folder into my shared folder via rclone.

For example

Above file or folder are publicly shared. 8 would then click “Add to My Drive” so they are available as my Shared Drive.

What I’m looking to do via rclone is above. Something like

“rclone --addshares GDriveremote:”

to add that folder into my GDrive account as my shared folder.

I see. The API for doing this is straight forward. Why do you want to do it with rclone - will you have a list of URLs somewhere?

Yes. So typically I already have list of urls ready. I add them to my drive,work on them and either keep it that way or delete the shared folders from my drive. Currently I have to add them via gui Web browser, very time consuming…
So if I can use rclone to do this it will save a lot of time.

Something like rclone --addshares and rclone --removeshares

I could add this to rclone, but since it only applies to one backend (drive) I’m reluctant to!

Are the other command line tools which could help?

I could add this to rclone, but since it only applies to one backend (drive) I’m reluctant to!

I understand your point. I’m not familiar with other cloud providers way of sharing files and folders but I would think they all need a way to add folder and file as shared folders.

There’s no other command line tools that could help for Google Drive. For other cloud provider such as there’s megaous tool etc. But not for Google drive.

If you are reluctant to add for only Google drive, I understand, but this also similarly applies to other backend. In I have to use website to add folders into my account before I can work on them with rclone.

For Microsoft one drive too. I have to use onedrive website to save shared folders to my corporate domain onedrive account. Without this I can’t access it from rclone. It’s even worse in the case of Microsoft onedrive because that action above means a real copy of those folders and files that will take long time to finish. This is as opposed to Google drive that does this instantly because it only links the folders and put them inside “My Drive”

If it is applicable to more than one cloud provider then I’d be willing to entertain the idea!

It would be a separate command rclone addobject remote: ID let’s say.

Can you please make a new issue on github about this with as much detail as possible as how you’d like the new command to work.

Better still - maybe you could help with the implementation?

I was wondering if there has been any progress about this.

I got a list of lot of google drive file urls that I would like to Add to My Drive using the command line, rather than opening every single file in the web browser and then clicking the “Add to My Drive” button manually

I don’t think an issue ever got made.

Do you fancy making one?

Could you work on it?

Thank you ncw. I will create an issue just in case it’s followed with someone who also would like to have that feature.

I won’t be able to work on it though… my programming knowledge is zero unfortunately.

1 Like

Created a new feature issue
Hoping to get this feature added real soon

1 Like