gws-drive by googleworkspace/cli
npx skills add https://github.com/googleworkspace/cli --skill gws-drive前提条件: 阅读
../gws-shared/SKILL.md以了解身份验证、全局标志和安全规则。如果该文件缺失,请运行gws generate-skills来创建它。
gws drive <resource> <method> [flags]
| 命令 | 描述 |
|---|---|
+upload | 上传文件并自动处理元数据 |
get — 获取有关用户、用户的云端硬盘和系统功能的信息。更多信息,请参阅。必需:必须设置 参数。要返回您需要的精确字段,请参阅。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
fieldsget — 通过 ID 检索访问提案。更多信息,请参阅管理待处理的访问提案。list — 列出文件上的访问提案。更多信息,请参阅管理待处理的访问提案。注意:只有审批者才能列出文件上的访问提案。如果用户不是审批者,将返回 403 错误。resolve — 批准或拒绝访问提案。更多信息,请参阅管理待处理的访问提案。get — 通过 ID 获取审批。list — 列出文件上的审批。stop — 停止通过此频道监视资源。更多信息,请参阅资源更改通知。create — 在文件上创建评论。更多信息,请参阅管理评论和回复。必需:必须设置 fields 参数。要返回您需要的精确字段,请参阅返回特定字段。delete — 删除评论。更多信息,请参阅管理评论和回复。get — 通过 ID 获取评论。更多信息,请参阅管理评论和回复。必需:必须设置 fields 参数。要返回您需要的精确字段,请参阅返回特定字段。list — 列出文件的评论。更多信息,请参阅管理评论和回复。必需:必须设置 fields 参数。要返回您需要的精确字段,请参阅返回特定字段。update — 使用补丁语义更新评论。更多信息,请参阅管理评论和回复。必需:必须设置 fields 参数。要返回您需要的精确字段,请参阅返回特定字段。copy — 创建文件的副本,并使用补丁语义应用任何请求的更新。更多信息,请参阅创建和管理文件。create — 创建文件。更多信息,请参阅创建和管理文件。此方法支持 /upload URI 并接受具有以下特征的上传媒体:- 最大文件大小: 5,120 GB - 接受的媒体 MIME 类型: */*(指定有效的 MIME 类型,而不是字面值 */*。字面值 */* 仅用于表示可以上传任何有效的 MIME 类型。download — 下载文件的内容。更多信息,请参阅下载和导出文件。操作自创建之日起 24 小时内有效。export — 将 Google Workspace 文档导出为请求的 MIME 类型并返回导出的字节内容。更多信息,请参阅下载和导出文件。请注意,导出内容限制为 10 MB。generateIds — 生成一组文件 ID,可以在创建或复制请求中提供。更多信息,请参阅创建和管理文件。get — 通过 ID 获取文件的元数据或内容。更多信息,请参阅搜索文件和文件夹。如果提供 URL 参数 alt=media,则响应会在响应体中包含文件内容。使用 alt=media 下载内容仅适用于存储在云端硬盘中的文件。要下载 Google 文档、表格和幻灯片,请改用 files.export。list — 列出用户的文件。更多信息,请参阅搜索文件和文件夹。此方法接受 q 参数,该参数是组合了一个或多个搜索词的搜索查询。默认情况下,此方法返回所有文件,包括已放入回收站的文件。如果您不希望已放入回收站的文件出现在列表中,请使用 trashed=false 查询参数从结果中移除已放入回收站的文件。listLabels — 列出文件上的标签。更多信息,请参阅列出文件上的标签。modifyLabels — 修改应用于文件的标签集。更多信息,请参阅在文件上设置标签字段。返回已添加或修改的标签列表。update — 更新文件的元数据、内容或两者。调用此方法时,仅填充请求中要修改的字段。更新字段时,某些字段可能会自动更改,例如 modifiedDate。此方法支持补丁语义。此方法支持 /upload URI 并接受具有以下特征的上传媒体:- 最大文件大小: 5,120 GB - 接受的媒体 MIME 类型: */*(指定有效的 MIME 类型,而不是字面值 */*。watch — 订阅文件的更改。更多信息,请参阅资源更改通知。get — 获取长时间运行的操作的最新状态。客户端可以使用此方法按照 API 服务建议的时间间隔轮询操作结果。create — 为文件或共享云端硬盘创建权限。更多信息,请参阅共享文件、文件夹和云端硬盘。警告: 不支持对同一文件进行并发权限操作;仅应用最后一次更新。delete — 删除权限。更多信息,请参阅共享文件、文件夹和云端硬盘。警告: 不支持对同一文件进行并发权限操作;仅应用最后一次更新。get — 通过 ID 获取权限。更多信息,请参阅共享文件、文件夹和云端硬盘。list — 列出文件或共享云端硬盘的权限。更多信息,请参阅共享文件、文件夹和云端硬盘。update — 使用补丁语义更新权限。更多信息,请参阅共享文件、文件夹和云端硬盘。警告: 不支持对同一文件进行并发权限操作;仅应用最后一次更新。delete — 永久删除文件版本。您只能删除 Google 云端硬盘中具有二进制内容(如图像或视频)的文件的修订版本。其他文件(如 Google 文档或表格)的修订版本以及最后一个剩余的文件版本无法删除。更多信息,请参阅管理文件修订版本。get — 通过 ID 获取修订版本的元数据或内容。更多信息,请参阅管理文件修订版本。list — 列出文件的修订版本。更多信息,请参阅管理文件修订版本。重要提示: 对于具有大量修订历史的文件(包括频繁编辑的 Google 文档、表格和幻灯片),此方法返回的修订版本列表可能不完整。较早的修订版本可能会从响应中省略,这意味着返回的第一个修订版本可能不是现存最旧的修订版本。update — 使用补丁语义更新修订版本。更多信息,请参阅管理文件修订版本。create — 已弃用:请改用 drives.create。get — 已弃用:请改用 drives.get。list — 已弃用:请改用 drives.list。update — 已弃用:请改用 drives.update。在调用任何 API 方法之前,请先检查它:
# 浏览资源和方法
gws drive --help
# 检查方法的必需参数、类型和默认值
gws schema drive.<resource>.<method>
使用 gws schema 输出来构建您的 --params 和 --json 标志。
每周安装量
10.5K
代码仓库
GitHub 星标数
22.3K
首次出现
2026年3月4日
安全审计
安装于
codex9.9K
opencode9.8K
gemini-cli9.8K
cursor9.7K
github-copilot9.7K
amp9.7K
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
gws drive <resource> <method> [flags]
| Command | Description |
|---|---|
+upload | Upload a file with automatic metadata |
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.get — Retrieves an access proposal by ID. For more information, see Manage pending access proposals.list — List the access proposals on a file. For more information, see Manage pending access proposals. Note: Only approvers are able to list access proposals on a file. If the user isn't an approver, a 403 error is returned.resolve — Approves or denies an access proposal. For more information, see Manage pending access proposals.get — Gets an Approval by ID.list — Lists the Approvals on a file.get — Gets a specific app. For more information, see Return user info.list — Lists a user's installed apps. For more information, see Return user info.getStartPageToken — Gets the starting pageToken for listing future changes. For more information, see Retrieve changes.list — Lists the changes for a user or shared drive. For more information, see Retrieve changes.watch — Subscribes to changes for a user. For more information, see Notifications for resource changes.stop — Stops watching resources through this channel. For more information, see Notifications for resource changes.create — Creates a comment on a file. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.delete — Deletes a comment. For more information, see Manage comments and replies.get — Gets a comment by ID. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.list — Lists a file's comments. For more information, see Manage comments and replies. Required: The parameter must be set. To return the exact fields you need, see .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.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 . Note that the exported content is limited to 10 MB.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.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. Concurrent permissions operations on the same file aren't supported; only the last update is applied.create — Creates a reply to a comment. For more information, see Manage comments and replies.delete — Deletes a reply. For more information, see Manage comments and replies.get — Gets a reply by ID. For more information, see Manage comments and replies.list — Lists a comment's replies. For more information, see Manage comments and replies.update — Updates a reply with patch semantics. For more information, see Manage comments and replies.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.create — Deprecated: Use drives.create instead.get — Deprecated: Use drives.get instead.list — Deprecated: Use drives.list instead.update — Deprecated: Use drives.update instead.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.
Weekly Installs
10.5K
Repository
GitHub Stars
22.3K
First Seen
Mar 4, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex9.9K
opencode9.8K
gemini-cli9.8K
cursor9.7K
github-copilot9.7K
amp9.7K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
fieldsupdate — Updates a comment with patch semantics. For more information, see Manage comments and replies. Required: The fields parameter must be set. To return the exact fields you need, see Return specific fields.update — Updates the metadata for a shared drive. For more information, see Manage shared drives.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. To download Google Docs, Sheets, and Slides use files.export instead.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.