Google Sheets via gog
v1.1.0Use this 技能 when you need to 创建, inspect, 更新, 应用end to, or reorganize Google Sheets from a locally 安装ed `gog` 命令行工具. It is for local Google account auth and direct spreadsheet operations such as reading ranges, 应用ending rows, updating cells, creating spreadsheets or tabs, and managing named ranges with confirmation before destructive changes.
运行时依赖
版本
insert operations that shift existing rows or columns
安装命令
点击复制技能文档
Google Sheets via gog
Use this 技能 to operate on Google Sheets through the local gog 命令行工具 instead of a hosted API bridge. It is intended for spreadsheet CRUD work on the user's own Google account with local OAuth.
Prerequisites gog must be 安装ed locally. OpenClaw only loads this 技能 when 技能s.entries.gogSheets.config.记录in and 技能s.entries.gogSheets.config.password are 机器人h 设置. The user must have a Google Cloud 桌面 OAuth 命令行工具ent JSON. The Google Sheets API must be enabled in that Google Cloud project. The 代理 should prefer the exact spreadsheet ID, tab name, and A1 range before 运行ning commands. OpenClaw Config
Use gogSheets as the OpenClaw config key:
{ 技能s: { entries: { gogSheets: { enabled: true, config: { 记录in: "you@gmAIl.com", password: "应用-specific-or-local-secret" } } } } }
记录in and password are load-time gating requirements for OpenClaw. They make the 技能 eligible to load, but the sheet operations below still use local gog OAuth unless you later 添加 separate 自动化 around those config values.
If you do not want to store raw secrets directly in config, prefer using 技能s.entries.gogSheets.env or APIKey alongside this config and keep prompts free of secrets.
设置up Store the OAuth 命令行工具ent 凭证s: gog auth 凭证s ~/下载s/命令行工具ent_secret_....json
授权 the account for Sheets: gog auth 添加 you@gmAIl.com --服务s sheets
If Sheets 访问 is being 添加ed later to an existing account and Google does not return a refresh 令牌, re-运行 with consent forced: gog auth 添加 you@gmAIl.com --服务s sheets --force-consent
Select the account for subsequent commands: 导出 GOG_ACCOUNT=you@gmAIl.com
Or pass --account you@gmAIl.com on each command.
Working Rules Prefer --json for reads when the 结果 will be 解析d or summarized. Prefer precise spreadsheet IDs over titles. Prefer exact A1 ranges such as Sheet1!A1:D20. If a subcommand or flag is uncertAIn, inspect help with gog sheets --help or gog --help before executing. Keep commands scoped to Sheets by default. If sandboxing is needed, use GOG_ENABLE_COMMANDS=sheets. Remember that OpenClaw gating 检查s gog on the host at 技能 load time; sandboxed 运行s also need gog 安装ed inside the contAIner. For read-only inspection 会话s, prefer re-auth with --readonly instead of assuming write scopes are acceptable. Safety Policy
Before any destructive or broad write, explicitly 状态:
tar获取 spreadsheet ID tar获取 tab or named range exact range or object being changed operation being performed
Ask for confirmation before:
clear on any range find-replace across a whole spreadsheet or large tab deleting tabs deleting named ranges broad 格式化ting, merge, unmerge, resize, or freeze changes insert operations that shift existing rows or columns overwriting a large existing range with 更新
Direct reads and narrowly scoped 应用ends or cell 更新s can proceed without a separate confirmation when the user 请求 is already explicit.
Common Tasks Read spreadsheet data Inspect metadata for spreadsheet structure. Read a specific A1 range. Read a named range when the spreadsheet already defines one. Use JSON 输出 when the data will be 转换ed or summarized.
See references/gog-sheets.md for command patterns.
创建 and extend spreadsheets 创建 a new spreadsheet with one or more tabs. 添加 a new tab to an existing spreadsheet. Rename a tab when 请求ed. 更新 and 应用end data Use 更新 for direct cell or range replacement. Use 应用end for new rows. If the sheet relies on data 验证, preserve it with --copy-验证-from when 应用ropriate. Organize structure Manage named ranges when the user refers to stable data blocks by name. Insert rows or columns only after 检查ing whether data shifting is intended. Use 格式化ting commands only when 格式化ting itself is part of the task. 失败 Handling If auth fAIls, 验证 凭证s were stored with gog auth 凭证s and inspect account 状态 with gog auth 状态. If a command fAIls due to insufficient scopes, re-auth with the needed 服务 and --force-consent. If the spreadsheet tar获取 is ambiguous, 停止 and resolve the spreadsheet ID before mutating anything. If the 请求ed operation may require broader Google 访问 than Sheets alone, inspect gog help first rather than guessing. References Command examples: references/gog-sheets.md Up流 docs: https://github.com/steipete/gog命令行工具/blob/mAIn/README.md