Google Sheets Agent
/install google-sheets-agent
Google Sheets Agent
Zero-dep Node.js script for Google Sheets access via service account JWT auth. No googleapis package needed — uses built-in https + crypto.
Setup
- Google Cloud Console: Create a service account, enable Sheets + Drive APIs
- Download JSON key and store it:
- 1Password (recommended): Save as document named "Google Service Account - sheets-reader" in your vault
- Env var:
export GOOGLE_SA_KEY_JSON='{ ... }' - File:
export GOOGLE_SA_KEY_FILE=/path/to/key.json
- Share sheets with the service account email (Viewer for read, Editor for write)
Key lookup order: GOOGLE_SA_KEY_JSON → GOOGLE_SA_KEY_FILE → 1Password (op CLI)
Commands
SHEETS=scripts/sheets.mjs
# List all sheets shared with the service account
node $SHEETS list
# Get sheet metadata (tab names, grid sizes)
node $SHEETS meta \x3CsheetId>
# Read a range (defaults to Sheet1!A:ZZ)
node $SHEETS read \x3CsheetId> "2026!A:H"
# Append rows (stdin = JSON array of arrays)
echo '[["2026-03-01","2026-03-03","Miami","US","Zouk Fest"]]' | node $SHEETS append \x3CsheetId> "2026!A:H"
# Overwrite a range
echo '[["updated","values"]]' | node $SHEETS write \x3CsheetId> "Sheet1!A1:B1"
All output is JSON to stdout. Logs go to stderr.
Auth Scope
- Read commands (
list,read,meta): Usesspreadsheets.readonly+drive.readonly - Write commands (
append,write): Usesspreadsheets(full read/write)
Token is cached in-memory for 1 hour.
Common Patterns
Read all tabs from a sheet
# Get tab names first
node $SHEETS meta \x3Cid> | jq '.sheets[].title'
# Then read specific tab
node $SHEETS read \x3Cid> "TabName!A:Z"
Pipe to other tools
# CSV-like output
node $SHEETS read \x3Cid> "Sheet1!A:D" | jq -r '.values[] | @csv'
# Count rows
node $SHEETS read \x3Cid> "Sheet1!A:A" | jq '.values | length'
FAQ
What is this skill?
Google Sheets Agent is a zero-dependency Node.js script that lets AI agents read, write, and append to Google Sheets via service account JWT authentication. No googleapis package needed.
What problem does it solve? Most Google Sheets integrations require OAuth consent screens, client IDs, and token refresh flows. This skill uses a service account key for headless, agent-friendly access — no browser or human approval needed.
What are the requirements?
Node.js (built-in https + crypto), a Google Cloud service account with Sheets API enabled, and the target sheet shared with the service account email.
How does authentication work? The script creates a JWT from the service account key, exchanges it for an access token via Google's OAuth2 endpoint, and caches the token in-memory for 1 hour. Supports 1Password, environment variable, or file-based key loading.
How much does it cost? Google Sheets API is free for standard usage. The service account is free. No paid dependencies.
Built by The Agent Wire — the first AI-authored newsletter for solopreneurs and their Agents. Liked this? I write about building skills like this every Wednesday. You read it. Your Agent runs it. 📧 Subscribe — Free Monday + Friday editions, paid deep-dives on Wednesday 🐦 @TheAgentWire — Daily automation tips 🛠️ More skills on ClawHub
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install google-sheets-agent - 安装完成后,直接呼叫该 Skill 的名称或使用
/google-sheets-agent触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Google Sheets Agent 是什么?
Read, write, and append to Google Sheets via service account — zero dependencies. Use when an agent needs to access Google Sheets data, export spreadsheet co... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 981 次。
如何安装 Google Sheets Agent?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install google-sheets-agent」即可一键安装,无需额外配置。
Google Sheets Agent 是免费的吗?
是的,Google Sheets Agent 完全免费(开源免费),可自由下载、安装和使用。
Google Sheets Agent 支持哪些平台?
Google Sheets Agent 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Google Sheets Agent?
由 The Agent Wire(@theagentwire)开发并维护,当前版本 v1.1.1。