gws-drive
Google Drive — Manage Files, Folders, and Shared Drives
Requires the gws CLI on $PATH. Authenticate with gws auth login before first use.
gws drive <resource> <method> [flags]
Security Rules
- Never output secrets (API keys, tokens) directly.
- Always confirm with user before executing write/delete commands.
- Prefer
--dry-runfor destructive operations.
Global Flags
| Flag | Description |
|---|---|
--format <FORMAT> |
Output format: json (default), table, yaml, csv |
--dry-run |
Validate locally without calling the API |
--params '{"key": "val"}' |
URL/query parameters |
--json '{"key": "val"}' |
Request body |
-o, --output <PATH> |
Save binary responses to file |
--upload <PATH> |
Upload file content (multipart) |
--page-all |
Auto-paginate (NDJSON output) |
--page-limit <N> |
Max pages when using --page-all (default: 10) |
Helper Commands
+upload — Upload a file with automatic metadata
gws drive +upload <file>
| Flag | Required | Default | Description |
|---|---|---|---|
<file> |
yes | — | Path to file to upload |
--parent |
— | — | Parent folder ID |
--name |
— | — | Target filename (defaults to source filename) |
gws drive +upload ./report.pdf
gws drive +upload ./report.pdf --parent FOLDER_ID
gws drive +upload ./data.csv --name 'Sales Data.csv'
MIME type is detected automatically. Filename is inferred from the local path unless --name is given.
WRITE command — confirm with the user before executing.
Raw API Resources
For operations not covered by helper commands, use the raw API:
gws schema drive.<resource>.<method>
files
list— List files. Acceptsqparameter for search queries. Returns all files including trashed by default; usetrashed=falseto exclude.get— Get file metadata or content by ID. Usealt=mediato download content.create— Create a file. Supports upload via--upload. Max file size: 5,120 GB.copy— Copy a file with patch semantics.update— Update file metadata, content, or both. Supports--upload.download— Download file content. Operations valid for 24 hours.export— Export Google Workspace documents to requested MIME type. Limited to 10 MB.generateIds— Generate file IDs for use in create/copy requests.listLabels— List labels on a file.modifyLabels— Modify labels applied to a file.watch— Subscribe to changes to a file.
permissions
create— Create a permission for a file or shared drive. Warning: concurrent permission operations on the same file are not supported.delete— Delete a permission.get— Get a permission by ID.list— List permissions on a file or shared drive.update— Update a permission with patch semantics.
drives (shared drives)
create— Create a shared drive.get— Get shared drive metadata by ID.list— List the user's shared drives. Acceptsqparameter for search.hide— Hide a shared drive from the default view.unhide— Restore a shared drive to the default view.update— Update shared drive metadata.
comments
create— Create a comment on a file.delete— Delete a comment.get— Get a comment by ID.list— List comments on a file.update— Update a comment.
replies
create— Create a reply to a comment.delete— Delete a reply.get— Get a reply by ID.list— List replies to a comment.update— Update a reply.
revisions
delete— Delete a file version (binary content only, not Google Docs/Sheets/Slides).get— Get revision metadata or content by ID.list— List file revisions (may be incomplete for files with large revision history).update— Update a revision.
about
get— Get user info, Drive info, and system capabilities. Requiresfieldsparameter.
changes
getStartPageToken— Get starting pageToken for listing future changes.list— List changes for a user or shared drive.watch— Subscribe to changes.
accessproposals
get— Get an access proposal by ID.list— List access proposals on a file (approvers only).resolve— Approve or deny an access proposal.
Common Workflows
List recent files
gws drive files list --params '{"pageSize": 10, "orderBy": "modifiedTime desc", "fields": "files(id,name,modifiedTime)"}'
Search for files
gws drive files list --params '{"q": "name contains '\''report'\'' and mimeType = '\''application/pdf'\''", "fields": "files(id,name)"}'
Upload a file to a folder
gws drive +upload ./report.pdf --parent FOLDER_ID
Download a file
gws drive files get --params '{"fileId": "FILE_ID", "alt": "media"}' -o ./downloaded_file.pdf
Export a Google Doc as PDF
gws drive files export --params '{"fileId": "DOC_ID", "mimeType": "application/pdf"}' -o ./document.pdf
Create a folder
gws drive files create --json '{"name": "New Folder", "mimeType": "application/vnd.google-apps.folder"}'
Share a file
gws drive permissions create \
--params '{"fileId": "FILE_ID"}' \
--json '{"role": "reader", "type": "user", "emailAddress": "user@example.com"}'
List shared drives
gws drive drives list --params '{"fields": "drives(id,name)"}'
Shell Tips
Wrap --params and --json values in single quotes so the shell does not interpret inner double quotes:
gws drive files list --params '{"pageSize": 5}'
More from kadel/claude-plugins
jira cli usage
This skill should be used when the user asks to "interact with Jira", "list Jira issues", "create Jira issue", "manage sprints", "view epics", "search issues", "move issue status", "assign issue", or mentions using the jira command-line tool for project management.
13backstage custom resource
This skill should be used when the user asks to "create Backstage CR", "create RHDH custom resource", "configure rhdh-operator", "create Backstage manifest", "modify Backstage CR", "configure RHDH deployment", "add dynamic plugins to CR", "configure Backstage database", "set up Backstage route", "configure app-config for RHDH", "create rhdh.redhat.com/v1alpha Backstage", or mentions creating or modifying a Backstage Custom Resource for the rhdh-operator.
10worktree feature development
This skill should be used when the user asks to "start a new feature", "create feature branch in worktree", "set up isolated feature development", "work on feature in separate directory", or mentions git worktree for feature isolation.
10generate frontend wiring
This skill should be used when the user asks to "generate frontend wiring", "show frontend wiring", "create RHDH binding", "generate dynamic plugin config", "show plugin wiring for RHDH", "create app-config for frontend plugin", or wants to generate the RHDH dynamic plugin wiring configuration for an existing Backstage frontend plugin. The skill analyzes the plugin's source code and generates the appropriate configuration.
9rhdh frontend dynamic plugin bootstrap
This skill should be used when the user asks to "create RHDH frontend plugin", "bootstrap frontend dynamic plugin", "create UI plugin for RHDH", "new frontend plugin for Red Hat Developer Hub", "add entity card to RHDH", "create dynamic route", "add sidebar menu item", "configure mount points", "create theme plugin", or mentions creating frontend components, UI pages, entity cards, or visual customizations for Red Hat Developer Hub or RHDH. This skill is specifically for frontend plugins - for backend plugins, use the separate backend plugin skill.
9backstage-custom-resource
This skill should be used when the user asks to "create Backstage CR", "create RHDH custom resource", "configure rhdh-operator", "create Backstage manifest", "modify Backstage CR", "configure RHDH deployment", "add dynamic plugins to CR", "configure Backstage database", "set up Backstage route", "configure app-config for RHDH", "create rhdh.redhat.com/v1alpha Backstage", or mentions creating or modifying a Backstage Custom Resource for the rhdh-operator.
6