Google Drive CLI Setup Google Drive can be configured headlessly with `kosmokrator integrations:configure google_drive`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure google_drive --set access_token=" $GOOGLE_DRIVE_ACCESS_TOKEN " --enable --read allow --write ask --json
kosmokrator integrations:doctor google_drive --json
kosmokrator integrations:status --json Credentials
Authentication type: OAuth browser flow oauth2_authorization_code. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Call Google Drive Headlessly Use the generic call form when another coding CLI or script needs a stable universal interface.
kosmo integrations:call google_drive.google_drive_copy '{
"file_id": "example_file_id",
"name": "example_name",
"parent_id": "example_parent_id"
}' --json Use the provider shortcut form for shorter human-facing commands.
kosmo integrations:google_drive google_drive_copy '{
"file_id": "example_file_id",
"name": "example_name",
"parent_id": "example_parent_id"
}' --json Agent Discovery Commands
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs google_drive --json
kosmo integrations:docs google_drive.google_drive_copy --json
kosmo integrations:schema google_drive.google_drive_copy --json
kosmo integrations:search "Google Drive" --json
kosmo integrations:list --json All CLI Functions
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Google Drive.
google_drive.google_drive_copy Read read Duplicate a file in Google Drive.
file_id, name, parent_id kosmo integrations:call google_drive.google_drive_copy '{"file_id":"example_file_id","name":"example_name","parent_id":"example_parent_id"}' --json copy kosmo integrations:google_drive google_drive_copy '{"file_id":"example_file_id","name":"example_name","parent_id":"example_parent_id"}' --json copy
google_drive.google_drive_create_file Write write Create an empty Google Doc, Sheet, or Presentation in Google Drive.
name, type, parent_id kosmo integrations:call google_drive.google_drive_create_file '{"name":"example_name","type":"example_type","parent_id":"example_parent_id"}' --json copy kosmo integrations:google_drive google_drive_create_file '{"name":"example_name","type":"example_type","parent_id":"example_parent_id"}' --json copy
google_drive.google_drive_create_folder Write write Create a folder in Google Drive.
name, parent_id kosmo integrations:call google_drive.google_drive_create_folder '{"name":"example_name","parent_id":"example_parent_id"}' --json copy kosmo integrations:google_drive google_drive_create_folder '{"name":"example_name","parent_id":"example_parent_id"}' --json copy
google_drive.google_drive_delete Read read Permanently delete a file from Google Drive (irreversible).
file_id kosmo integrations:call google_drive.google_drive_delete '{"file_id":"example_file_id"}' --json copy kosmo integrations:google_drive google_drive_delete '{"file_id":"example_file_id"}' --json copy
google_drive.google_drive_move Read read Move a file to a different folder in Google Drive.
file_id, target_folder_id kosmo integrations:call google_drive.google_drive_move '{"file_id":"example_file_id","target_folder_id":"example_target_folder_id"}' --json copy kosmo integrations:google_drive google_drive_move '{"file_id":"example_file_id","target_folder_id":"example_target_folder_id"}' --json copy
google_drive.google_drive_rename Read read Rename a file or folder in Google Drive.
file_id, name kosmo integrations:call google_drive.google_drive_rename '{"file_id":"example_file_id","name":"example_name"}' --json copy kosmo integrations:google_drive google_drive_rename '{"file_id":"example_file_id","name":"example_name"}' --json copy
google_drive.google_drive_get_file Read read Get file metadata by ID from Google Drive. For Google Docs/Sheets/Slides, use `export_as` to get content as text, csv, or markdown.
file_id, export_as kosmo integrations:call google_drive.google_drive_get_file '{"file_id":"example_file_id","export_as":"example_export_as"}' --json copy kosmo integrations:google_drive google_drive_get_file '{"file_id":"example_file_id","export_as":"example_export_as"}' --json copy
google_drive.google_drive_list_permissions Read read List all permissions (sharing settings) on a Google Drive file or folder.
file_id kosmo integrations:call google_drive.google_drive_list_permissions '{"file_id":"example_file_id"}' --json copy kosmo integrations:google_drive google_drive_list_permissions '{"file_id":"example_file_id"}' --json copy
google_drive.google_drive_search_files Read read Search for files in Google Drive using Drive query syntax (default: 20 results, max: 100). Trashed files are excluded by default.
Drive query syntax examples:
- By name: `name contains 'budget'` or `name = 'Q1 Report'`
- By type: `mimeType = 'application/vnd.google-apps.spreadsheet'` (also: document, presentation, folder)
- In folder: `'FOLDER_ID' in parents`
- Recent: `modifiedTime > '2026-01-01'`
- Shared with me: `sharedWithMe = true`
- Starred: `starred = true`
- By owner: `'[email protected] ' in owners`
- Combine: `name contains 'report' and mimeType = 'application/vnd.google-apps.spreadsheet'`
query, max_results, page_token, order_by kosmo integrations:call google_drive.google_drive_search_files '{"query":"example_query","max_results":1,"page_token":"example_page_token","order_by":"example_order_by"}' --json copy kosmo integrations:google_drive google_drive_search_files '{"query":"example_query","max_results":1,"page_token":"example_page_token","order_by":"example_order_by"}' --json copy
google_drive.google_drive_share_file Read read Share a Google Drive file or folder. Provide `fileId`, `role` ("reader", "writer", "commenter"), and one of:
- `email`: share with a specific user (e.g., "[email protected] ")
- `domain`: share with an entire domain (e.g., "example.com")
- `type` set to `"anyone"`: make accessible to anyone with the link (no email/domain needed)
- `notify` (optional, default true): send email notification (only for email shares)
file_id, role, type, email, domain, notify kosmo integrations:call google_drive.google_drive_share_file '{"file_id":"example_file_id","role":"example_role","type":"example_type","email":"example_email","domain":"example_domain","notify":"example_notify"}' --json copy kosmo integrations:google_drive google_drive_share_file '{"file_id":"example_file_id","role":"example_role","type":"example_type","email":"example_email","domain":"example_domain","notify":"example_notify"}' --json copy
google_drive.google_drive_unshare_file Read read Remove a permission from a Google Drive file or folder. Use google_drive_list_permissions first to find the permission ID.
file_id, permission_id kosmo integrations:call google_drive.google_drive_unshare_file '{"file_id":"example_file_id","permission_id":"example_permission_id"}' --json copy kosmo integrations:google_drive google_drive_unshare_file '{"file_id":"example_file_id","permission_id":"example_permission_id"}' --json copy
google_drive.google_drive_star Read read Mark a file as starred/favorite in Google Drive.
file_id kosmo integrations:call google_drive.google_drive_star '{"file_id":"example_file_id"}' --json copy kosmo integrations:google_drive google_drive_star '{"file_id":"example_file_id"}' --json copy
google_drive.google_drive_trash Read read Move a file to trash in Google Drive (reversible).
file_id kosmo integrations:call google_drive.google_drive_trash '{"file_id":"example_file_id"}' --json copy kosmo integrations:google_drive google_drive_trash '{"file_id":"example_file_id"}' --json copy
google_drive.google_drive_unstar Read read Remove star from a file in Google Drive.
file_id kosmo integrations:call google_drive.google_drive_unstar '{"file_id":"example_file_id"}' --json copy kosmo integrations:google_drive google_drive_unstar '{"file_id":"example_file_id"}' --json copy
google_drive.google_drive_untrash Read read Restore a file from trash in Google Drive.
file_id kosmo integrations:call google_drive.google_drive_untrash '{"file_id":"example_file_id"}' --json copy kosmo integrations:google_drive google_drive_untrash '{"file_id":"example_file_id"}' --json copy Function Schemas Use these parameter tables when building CLI payloads without calling integrations:schema first.
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_copy --json
Operation Write write
Schema command kosmo integrations:schema google_drive.google_drive_create_file --json
Operation Write write
Schema command kosmo integrations:schema google_drive.google_drive_create_folder --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_delete --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_move --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_rename --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_get_file --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_list_permissions --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_search_files --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_share_file --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_unshare_file --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_star --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_trash --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_unstar --json
Operation Read read
Schema command kosmo integrations:schema google_drive.google_drive_untrash --json Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.