Skip to content
Google Workspace CLI: Drive

Google Workspace CLI: Drive Skill

Google Workspace's official gws skill for Google Drive: manage files, folders, permissions, comments, revisions and shared drives from an agent through the gws CLI and the Drive v3 API.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from googleworkspace/cli.

$ npx skills add googleworkspace/cli --skill gws-drive

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/gws-drive/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/googleworkspace/cli.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/skills/gws-drive ~/.claude/skills/gws-drive

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/gws-drive/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Every Drive v3 resource as gws drive commands, with Google's guide linked per method
  • Files: create, copy, list/search, download and export Workspace docs
  • Sharing through permissions on files, folders and shared drives
  • Comments, replies, revisions, change feeds and push channels
  • +upload helper with automatic metadata
  • Inherits auth and security rules from the shared gws skill

This is the Google Drive skill from googleworkspace/cli, the official repository for gws, Google Workspace's command-line tool for its APIs. It gives an agent a map of the Drive v3 API as gws drive <resource> <method> commands, so it can find, create, copy, export and share files without writing API client code.

What it covers. The skill lists every Drive v3 resource with a one-line description and a link to Google's guide for each method: files (create, copy, get, list with search queries, download, export of Workspace documents to other formats, generate IDs), permissions for sharing files, folders and shared drives, comments and replies, revisions, drives and the legacy teamdrives, changes and push-notification channels, accessproposals and approvals, installed apps, long-running operations, and about for user and quota information. It carries Google's own caveats inline, such as the fields parameter that about.get requires.

Helper and discovery. One helper, +upload, uploads a file with automatic metadata. For everything else the rule is to inspect first: gws drive --help and gws schema drive.<resource>.<method> show the required parameters, which then go into --params and --json.

Depends on the shared skill. Authentication, global flags and security rules (confirm before writes, prefer --dry-run) live in gws-shared, listed here as Google Workspace CLI (gws); the skill tells the agent to read it first. The gws binary must be installed.

Try it

Once installed, ask your agent something like:

gws drive files list --params '{"q": "name contains 'invoice'", "pageSize": 10}'
gws schema drive.permissions.create

SKILL.md

The instructions your agent loads, as published by Google Workspace.

SKILL.md
name
gws-drive
description
Google Drive: Manage files, folders, and shared drives.
metadata
version: 0.22.5 openclaw: category: "productivity" requires: bins: - gws cliHelp: "gws drive --help"

drive (v3)

PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
gws drive <resource> <method> [flags]
Helper Commands
CommandDescription
[`+upload`](../gws-drive-upload/SKILL.md)Upload a file with automatic metadata
API Resources
about
  • get — Gets information about the user, the user's Drive, and system capabilities. For more information, see Return user info. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.
accessproposals
approvals
  • get — Gets an Approval by ID.
  • list — Lists the Approvals on a file.
apps
changes
channels
comments
drives
  • create — Creates a shared drive. For more information, see Manage shared drives.
  • get — Gets a shared drive's metadata by ID. For more information, see Manage shared drives.
  • hide — Hides a shared drive from the default view. For more information, see Manage shared drives.
  • list — Lists the user's shared drives. This method accepts the q parameter, which is a search query combining one or more search terms. For more information, see the Search for shared drives guide.
  • unhide — Restores a shared drive to the default view. For more information, see Manage shared drives.
  • update — Updates the metadata for a shared drive. For more information, see Manage shared drives.
files
  • copy — Creates a copy of a file and applies any requested updates with patch semantics. For more information, see Create and manage files.
  • create — Creates a file. For more information, see Create and manage files. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types: */* (Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded.
  • download — Downloads the content of a file. For more information, see Download and export files. Operations are valid for 24 hours from the time of creation.
  • export — Exports a Google Workspace document to the requested MIME type and returns exported byte content. For more information, see Download and export files. Note that the exported content is limited to 10 MB.
  • generateIds — Generates a set of file IDs which can be provided in create or copy requests. For more information, see Create and manage files.
  • get — Gets a file's metadata or content by ID. For more information, see Search for files and folders. If you provide the URL parameter alt=media, then the response includes the file contents in the response body. Downloading content with alt=media only works if the file is stored in Drive.
  • list — Lists the user's files. For more information, see Search for files and folders. This method accepts the q parameter, which is a search query combining one or more search terms. This method returns all files by default, including trashed files. If you don't want trashed files to appear in the list, use the trashed=false query parameter to remove trashed files from the results.
  • listLabels — Lists the labels on a file. For more information, see List labels on a file.
  • modifyLabels — Modifies the set of labels applied to a file. For more information, see Set a label field on a file. Returns a list of the labels that were added or modified.
  • update — Updates a file's metadata, content, or both. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. This method supports patch semantics. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types: */* (Specify a valid MIME type, rather than the literal */* value.
  • watch — Subscribes to changes to a file. For more information, see Notifications for resource changes.
operations
  • get — Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
permissions
  • create — Creates a permission for a file or shared drive. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren't supported; only the last update is applied.
  • delete — Deletes a permission. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren't supported; only the last update is applied.
  • get — Gets a permission by ID. For more information, see Share files, folders, and drives.
  • list — Lists a file's or shared drive's permissions. For more information, see Share files, folders, and drives.
  • update — Updates a permission with patch semantics. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren't supported; only the last update is applied.
replies
revisions
  • delete — Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted. For more information, see Manage file revisions.
  • get — Gets a revision's metadata or content by ID. For more information, see Manage file revisions.
  • list — Lists a file's revisions. For more information, see Manage file revisions. Important: The list of revisions returned by this method might be incomplete for files with a large revision history, including frequently edited Google Docs, Sheets, and Slides. Older revisions might be omitted from the response, meaning the first revision returned may not be the oldest existing revision.
  • update — Updates a revision with patch semantics. For more information, see Manage file revisions.
teamdrives
  • create — Deprecated: Use drives.create instead.
  • get — Deprecated: Use drives.get instead.
  • list — Deprecated: Use drives.list instead.
  • update — Deprecated: Use drives.update instead.
Discovering Commands

Before calling any API method, inspect it:

# Browse resources and methods
gws drive --help

# Inspect a method's required params, types, and defaults
gws schema drive.<resource>.<method>

Use gws schema output to build your --params and --json flags.

Install
Featured

Google's official skill for the gws CLI — drive Gmail, Drive, Calendar, Sheets, Docs, Chat and Admin APIs from an agent, with Model Armor screening.

Skill: Obsidian CLI

by Steph Ango (kepano)

Lets an agent drive a running Obsidian app through the official obsidian CLI: read, create, append to and search notes, manage tasks, properties and daily notes, and reload, debug and screenshot plugins and themes.

Browse all skills →