productivity
Google Drive CLI for Shell Scripts
Use the Google Drive CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
6 functions 4 read 2 write Manual OAuth token auth
Google Drive CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Google Drive CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Google Drive CLI for Shell Scripts
kosmokrator integrations:configure google-drive --set access_token="$GOOGLE_DRIVE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call google-drive.gdrive_list_files '{"pageSize":1,"pageToken":"example_pageToken","q":"example_q","spaces":"example_spaces","trashed":true,"corpora":"example_corpora","fields":"example_fields"}' --json Discovery Before Execution
Agents and scripts can inspect Google Drive docs and schemas before choosing a function.
kosmo integrations:docs google-drive --json
kosmo integrations:docs google-drive.gdrive_list_files --json
kosmo integrations:schema google-drive.gdrive_list_files --json
kosmo integrations:search "Google Drive" --json
kosmo integrations:list --json Useful Google Drive CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
google-drive.gdrive_list_files | Read | pageSize, pageToken, q, spaces, trashed, corpora, fields | List files and folders in Google Drive. Supports search queries (q), pagination, spaces (drive, appDataFolder, photos), and trashed filtering. |
google-drive.gdrive_get_file | Read | fileId, fields | Get metadata for a specific file or folder in Google Drive by its ID. Returns properties like name, mimeType, size, createdTime, modifiedTime, and parents. |
google-drive.gdrive_create_file | Write | name, mimeType, parents, description | Create a new file in Google Drive. Creates the file metadata (name, mimeType, parent folder). For simple file creation without content upload, use uploadType "resumable" or "multipart" via the Google Drive API directly. |
google-drive.gdrive_create_folder | Write | name, parentId | Create a new folder in Google Drive. Optionally specify a parent folder to nest it inside. |
google-drive.gdrive_list_changes | Read | pageSize, pageToken, fields | List changes to files and folders in Google Drive. Use pageToken from the initial startPageToken to begin tracking, then pass the returned next page token for subsequent requests. |
google-drive.gdrive_get_current_user | Read | fields | Get information about the authenticated Google Drive user, including display name, email address, and storage quota (usage, limit). |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.