Google Drive
The robomotion googledrive CLI connects to Google Drive API for file and folder management. It uploads, downloads, copies, moves, and deletes files; creates folders; searches by name/query; and manages sharing permissions.
When to use
- Upload or download files between local filesystem and Google Drive
- List, search, copy, move, or delete files and folders
- Create folders and manage file sharing permissions
Prerequisites
robomotionCLI installed- Package installed:
robomotion install googledrive - Google Drive OAuth2 or Service Account credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install googledrive - Connect with session:
robomotion googledrive connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion googledrive upload_file --client-id "<client-id>" --file-path <local> --parent-id <folder> --session-id "<session-id>" --output json - Disconnect when done:
robomotion googledrive disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion googledrive connect --session --output jsonConnects to Google Drive using OAuth2 or Service Account credentialsrobomotion googledrive list_folder --drive-id --folder-id --output jsonLists all files and folders within a specified folderrobomotion googledrive upload_file --drive-id --file-path --parent-folder-id --output jsonUploads a local file to Google Driverobomotion googledrive download_file --drive-id --file-id --file-path [--pattern] --output jsonDownloads a file from Google Drive to local storagerobomotion googledrive delete_file --drive-id --file-id --output jsonPermanently deletes a file or folder from Google Driverobomotion googledrive create_folder --drive-id --folder-name [--parent-folder-id] --output jsonCreates a new folder in Google Driverobomotion googledrive create_file_permission --drive-id --file-id --role --type --email-address [--email-message] --output jsonCreates a permission for a file or folder in Google Driverobomotion googledrive delete_file_permission --drive-id --file-id --permission --output jsonRemoves a permission from a file or folder in Google Driverobomotion googledrive list_file_permissions --drive-id --file-id --output jsonLists all permissions for a file or folderrobomotion googledrive search --drive-id --query --output jsonSearches for files in Google Drive using a query stringrobomotion googledrive copy_file --drive-id --file-id [--file-name] [--mime-type] [--parent-folder-id] --output jsonCreates a copy of a file in Google Driverobomotion googledrive export_file --drive-id --file-id --file-path [--mime-type] --output jsonExports a Google Workspace document to a specified formatrobomotion googledrive disconnect --drive-id --session-id "<session-id>" --output jsonCloses the Google Drive connection and releases resourcesrobomotion googledrive move_file --drive-id --file-id --from-parent-id --to-parent-id --output jsonMoves a file or folder to a different location in Google Drive
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)