← 返回 Skills 市场
robinsadeghpour

Google Workspace CLI

作者 Robin Sadeghpour-Faraj · GitHub ↗ · v1.0.1
cross-platform ⚠ suspicious
474
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install gworkspace-cli
功能描述
Interact with Google Workspace (Drive, Docs, Sheets) via the `gw` CLI. Use when an agent needs to browse, read, create, search, or manage files in Google Dri...
使用说明 (SKILL.md)

gworkspace-cli

Manage Google Drive, Docs, and Sheets from the terminal with gw.

Do This First

  • Ensure gw is installed: npm i -g @11x.agency/gworkspace
  • Ensure authenticated: run gw auth --status. If not authenticated, run gw auth.
  • If targeting a Shared Drive, get the drive ID first: gw drive shared

Authentication

gw auth                 # Opens browser for Google sign-in
gw auth --status        # Check current auth (email, scopes, expiry)
gw logout               # Remove stored credentials

Token stored at ~/.11x/gworkspace/token.json. OAuth credentials via env vars or .env file:

  • GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET
  • GW_CLIENT_ID / GW_CLIENT_SECRET (aliases)

Commands

Drive

# List files
gw drive ls                              # Root of My Drive
gw drive ls /Projects                    # By path
gw drive ls --folder \x3Cid>               # By folder ID
gw drive ls --type doc                  # Filter: doc, sheet, folder, all
gw drive ls --limit 50                  # Pagination

# Create folder
gw drive mkdir "Folder Name"
gw drive mkdir "Subfolder" --folder \x3Cparent-id>

# Search
gw drive search "quarterly report"
gw drive search "budget" --type sheet

# Upload
gw drive upload ./file.pdf
gw drive upload ./data.csv --folder \x3Cid> --name "Q4 Data"

# List Shared Drives
gw drive shared

Shared Drives

Use the global --drive \x3Cid> flag before any subcommand:

gw --drive \x3Cshared-drive-id> drive ls
gw --drive \x3Cshared-drive-id> drive ls /Projects
gw --drive \x3Cshared-drive-id> drive mkdir "New Folder"
gw --drive \x3Cshared-drive-id> drive search "report"
gw --drive \x3Cshared-drive-id> drive upload ./file.pdf

To create docs/sheets in a Shared Drive, use --folder with a Shared Drive folder ID:

gw doc create "Title" --folder \x3Cshared-drive-folder-id>
gw sheet create "Title" --folder \x3Cshared-drive-folder-id>

Docs

gw doc read \x3Cid|url>                    # Plain text output
gw doc read \x3Cid|url> --markdown         # Markdown output
gw doc create "Title"                   # Create empty doc, returns ID + URL
gw doc create "Title" --folder \x3Cid>     # Create in specific folder
gw doc append \x3Cid|url> "text"           # Append text to end of doc
gw doc append \x3Cid|url> --file ./notes.txt  # Append from file

Sheets

gw sheet read \x3Cid|url>                  # Read entire first sheet (JSON rows)
gw sheet read \x3Cid|url> "Sheet1!A1:C10"  # Read specific range
gw sheet write \x3Cid|url> "A1:B2" '[["Name","Score"],["Alice","95"]]'
gw sheet write \x3Cid|url> "A1" --file ./data.csv
gw sheet append \x3Cid|url> '[["Bob","88"]]'
gw sheet append \x3Cid|url> --file ./more.csv
gw sheet create "Title"                 # Create spreadsheet
gw sheet create "Title" --folder \x3Cid>
gw sheet list \x3Cid|url>                  # List tabs/sheets

Output Modes

All commands support three output modes:

Flag Output Use case
(default) JSON Piping, scripting
--pretty Human-readable table Terminal viewing
--quiet IDs only, one per line Chaining commands

I/O Contract

  • stdout: Data output (JSON, table, or IDs)
  • stderr: Errors, status messages, progress
  • Exit 0: Success
  • Exit 1: Any error (auth, not found, permission, network)

URLs and IDs

All commands accept either format — paste a full Google URL or just the ID:

gw doc read https://docs.google.com/document/d/1abc.../edit
gw doc read 1abc...

Error Messages

Condition Message
No token Error: Not authenticated. Run 'gw auth' to get started.
Token expired Error: Session expired. Run 'gw auth' to re-authenticate.
File not found Error: File not found.
Permission denied Error: No access to this file. Make sure it's shared with your account.
Network error Error: Could not reach Google APIs. Check your connection.

Common Agent Workflows

Browse a Shared Drive and read a doc

gw drive shared --quiet                          # Get drive IDs
gw --drive \x3Cid> drive ls --pretty                # Browse root
gw --drive \x3Cid> drive ls --folder \x3Cfolder-id>    # Drill into folder
gw doc read \x3Cdoc-id>                             # Read the doc

Create a doc with content in a specific folder

gw drive mkdir "Project X"                       # Create folder, get ID
gw doc create "Requirements" --folder \x3Cid>       # Create doc, get ID
gw doc append \x3Cdoc-id> "# Requirements\
\
..."   # Write content

Export sheet data for processing

gw sheet read \x3Cid> --quiet > data.tsv            # Tab-separated to file
gw sheet read \x3Cid> "Sheet1!A1:D100" | jq '.'     # JSON for processing

Upload and organize files

gw drive mkdir "Reports" --folder \x3Cparent-id>
gw drive upload ./q4-report.pdf --folder \x3Cnew-folder-id> --name "Q4 Report 2026"
安全使用建议
This skill appears to be a real CLI wrapper for Google Workspace, but there are two red flags you should consider before installing: (1) the registry metadata does not reflect the requirements the SKILL.md lists (it omits the 'gw' install, env vars, and token paths), and (2) the CLI defaults to using the package's embedded OAuth credentials unless you provide your own. Installing the npm package runs third-party code with your user privileges and will store OAuth tokens under ~/.11x/gworkspace/. Before proceeding: review the GitHub repository and the npm package contents (look at package.json and source), avoid using the embedded client by setting your own GOOGLE_CLIENT_ID/SECRET, or test in a disposable environment, and verify the registry metadata is corrected so automated permission checks are accurate.
功能分析
Type: OpenClaw Skill Name: gworkspace-cli Version: 1.0.1 The skill is classified as suspicious primarily due to the `SKILL.md` documentation stating that 'embedded credentials used by default' for Google OAuth if environment variables are not provided. This suggests a potential vulnerability in the underlying `gw` CLI regarding credential management, as 'embedded' credentials could imply hardcoded or insecurely managed secrets. Additionally, there is a minor supply chain discrepancy where the `npm install` command specifies `@11x.agency/gworkspace` while the `source` URL points to `https://github.com/robinfaraj/gworkspace-cli`, raising questions about the exact origin and security posture of the installed binary.
能力评估
Purpose & Capability
The listed purpose (Drive/Docs/Sheets access via a 'gw' CLI) matches the SKILL.md commands and workflows. However the registry metadata provided to the platform claims no required binaries, env vars, or config paths, while the SKILL.md explicitly requires the 'gw' CLI (npm package), optional OAuth client ID/secret env vars, and specific token/config file paths — an inconsistency between declared metadata and the runtime instructions.
Instruction Scope
The instructions are scoped to installing the CLI, authenticating via OAuth, and performing Drive/Docs/Sheets operations. They instruct the agent/user to run browser-based auth and reference a token file (~/.11x/gworkspace/token.json). They do not ask to read unrelated system files. One noteworthy item: SKILL.md states 'embedded credentials used by default' (i.e., the package's own OAuth client), which changes trust assumptions and should be explicitly called out before use.
Install Mechanism
Installation is via a global npm package ('npm i -g @11x.agency/gworkspace') referenced in SKILL.md. The registry has no formal install spec despite this instruction. A scoped npm package is a common distribution method but installing global npm packages executes third-party code with user privileges — review the package source (the GitHub repo is listed) before installing.
Credentials
The SKILL.md declares optional env vars for GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET (and aliases), which are appropriate for OAuth. However the defaults rely on 'embedded credentials' owned by the package author — that means authentication will be performed through a third-party client unless the user supplies their own secrets. Token and config files are stored under ~/.11x/gworkspace/ and will contain sensitive tokens. Additionally, the platform-level metadata omits these env/config requirements, which is a transparency issue.
Persistence & Privilege
The skill does not request always:true or other elevated platform privileges. It writes its own token/config under the user's home directory (expected for an OAuth CLI). There is no indication it modifies other skills or global agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gworkspace-cli
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gworkspace-cli 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added required_binaries, required_env, and config_paths metadata for clarity on dependencies and configuration. - Provided optional descriptions for environment variables. - Declared install and source fields for direct installation and repository access. - No commands or functionality changed. CLI usage remains the same.
v1.0.0
gworkspace-cli 1.0.0 - Initial release of the `gw` CLI for Google Workspace management. - Browse, search, read, and write Google Drive, Docs, and Sheets from the terminal. - Supports both My Drive and Shared Drives. - Multiple output modes (JSON, pretty table, quiet/IDs). - Includes authentication, detailed error handling, and example agent workflows.
元数据
Slug gworkspace-cli
版本 1.0.1
许可证
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Google Workspace CLI 是什么?

Interact with Google Workspace (Drive, Docs, Sheets) via the `gw` CLI. Use when an agent needs to browse, read, create, search, or manage files in Google Dri... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 474 次。

如何安装 Google Workspace CLI?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gworkspace-cli」即可一键安装,无需额外配置。

Google Workspace CLI 是免费的吗?

是的,Google Workspace CLI 完全免费(开源免费),可自由下载、安装和使用。

Google Workspace CLI 支持哪些平台?

Google Workspace CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Google Workspace CLI?

由 Robin Sadeghpour-Faraj(@robinsadeghpour)开发并维护,当前版本 v1.0.1。

💬 留言讨论