Google Drive Upload

Google Drive Upload

A Claude Code skill for google drive upload workflows and automation

Category: development Source: davepoon/buildwithclaude

What Is Google Drive Upload?

The Google Drive Upload skill is a Claude Code extension designed to streamline the process of uploading files directly to Google Drive. By leveraging a lightweight Google Apps Script web app and simple configuration, this tool enables users to save documents, reports, scripts, or any generated files to their Google Drive account from within Claude-powered workflows. Whether the request is issued in English or Hebrew, Google Drive Upload detects and responds to user intent, automating file storage and minimizing manual steps.

This skill is especially valuable in development and automation contexts where seamless integration with cloud storage is critical. Instead of juggling download/upload steps, users can instruct Claude to handle the entire upload process through natural language commands or as part of programmatic workflows.

Why Use Google Drive Upload?

Storing files in the cloud is a best practice for backup, collaboration, and accessibility. However, the manual process of downloading files to a local machine and then uploading them to Google Drive can be tedious and error-prone, particularly when working with frequent outputs or automating data processing pipelines.

The Google Drive Upload skill offers several advantages:

  • Workflow Automation: Integrates file upload seamlessly into your workflow, eliminating repetitive manual tasks.
  • Natural Language Triggers: Easily invoked through conversational requests, such as "Upload this to Google Drive" or "Save in Drive," including support for Hebrew commands.
  • Cross-Platform Convenience: Works from any environment where Claude Code is available, regardless of the operating system.
  • Quick Setup: Utilizes a Google Apps Script, requiring minimal configuration and no heavyweight dependencies.

By automating the upload process, this skill supports efficient, scalable, and reliable file management, making it ideal for developers, analysts, and power users.

How to Get Started

Prerequisites

Before using the Google Drive Upload skill, you must complete a one-time setup:

  1. Deploy the Google Apps Script Web App:

    • Clone or download the script from the official repository.
    • In Google Drive, create a new Apps Script project, paste in the provided script, and deploy it as a web app with appropriate permissions (typically "Anyone with the link").
    • Copy the deployment URL for later use.
  2. Configure Your Local Environment:

    • Create a configuration file at ~/.cowork-gdrive-config.json with the following structure:
      {
        "script_url": "https://script.google.com/macros/s/your-deployment-id/exec",
        "api_key": "your-optional-api-key"
      }
      
    • Replace the script_url with your web app’s URL. Add an API key if required for access control.

Usage Example

Once configured, you can trigger uploads with simple requests to Claude:

  • “Upload this report to Google Drive”
  • “Save the presentation in Clients/Acme on Drive”
  • “תעלה את זה לדרייב” (Hebrew for "Upload this to Drive")

Behind the scenes, Claude will:

  1. Read your configuration file for the script URL and API key.
  2. Base64-encode the file you want to upload.
  3. Make a POST request to the deployed Apps Script.
  4. Return the resulting Google Drive file link.

Manual Bash Upload Example

Advanced users can replicate the upload process via shell commands:

## Read config
cat "$HOME/.cowork-gdrive-config.json"

## Set file path
FILE="/path/to/file"

## Encode file as base64
B64=$(base64 "$FILE" | tr -d '\n')

## Detect MIME type
MIME=$(file --mime-type -b "$FILE")

## Upload via curl
curl -s -L -H "Content-Type: application/json" \
  -d "{\"file\":\"$B64\",\"filename\":\"$(basename $FILE)\",\"mimeType\":\"$MIME\"}" \
  "https://script.google.com/macros/s/your-deployment-id/exec?api_key=your-optional-api-key"

Key Features

  • Direct Uploads to Google Drive: Seamlessly transfer files to your Drive without leaving your workflow.
  • Language Awareness: Responds to commands in both English and Hebrew.
  • Flexible Triggers: Activated by a variety of natural language requests such as "upload to Drive," "save to Drive," and their Hebrew equivalents.
  • Configurable Security: Optionally requires an API key for enhanced security.
  • Automatic MIME Type Handling: Determines the correct file type for uploads, ensuring compatibility and proper rendering in Google Drive.
  • Instant Link Generation: Returns the URL of the uploaded file for immediate access or sharing.

Best Practices

  • Secure Your Web App: Restrict access to the deployed Google Apps Script using API keys, OAuth, or Google account authentication to prevent unauthorized uploads.
  • Organize Uploaded Files: Specify destination folders within your upload requests (e.g., "Save in Clients/Acme on Drive") to keep Drive organized.
  • Monitor Quotas: Be aware of Google Apps Script and Google Drive API quotas, especially if automating large or frequent uploads.
  • Audit and Manage API Keys: Rotate and secure API keys regularly to reduce security risks.
  • Automate Where Appropriate: Integrate this skill into larger automation pipelines for data analysis, reporting, or backup tasks.

Important Notes

  • Permissions: The deployed Apps Script must have permission to write to your Google Drive. On first use, authorize the script with the required Google account.
  • Privacy: Files are transmitted to a Google Apps Script endpoint. Ensure you trust the deployment and secure the endpoint appropriately.
  • File Size Limits: Google Apps Script has size limits for HTTP POST payloads (typically up to 50MB). For larger files, consider alternative upload methods.
  • Configuration Location: The skill expects the config file at ~/.cowork-gdrive-config.json. Ensure this file is present and correctly formatted.
  • Language Support: While Hebrew and English are supported, add additional language triggers as needed by modifying the skill’s code.

By adopting the Google Drive Upload skill in your Claude Code environment, you can automate, simplify, and secure your file management workflows, making Google Drive an integrated part of your productivity toolkit.