How to transfer documents to Google Docs using command line or Python scripts

Python with the Google Drive API is your best bet. I’ve done similar bulk uploads using google-api-python-client and it works great over SSH. First, set up OAuth2 credentials through Google Cloud Console and download the JSON file to your server. The tricky part is authentication since you can’t open a browser - use the out-of-band flow or run auth on a machine with a browser and copy the credentials over. After that, uploading is straightforward with the drive service API. I batch uploads and add retry logic for network issues. Files convert to Google Docs automatically when you set the right MIME type during upload.