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 contents, write rows, or list available sheets. Supports 1Password, env var, or file-based SA key loading.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "google-sheets-agent" with this command: npx skills add theagentwire/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

  1. Google Cloud Console: Create a service account, enable Sheets + Drive APIs
  2. 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
  3. Share sheets with the service account email (Viewer for read, Editor for write)

Key lookup order: GOOGLE_SA_KEY_JSONGOOGLE_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 <sheetId>

# Read a range (defaults to Sheet1!A:ZZ)
node $SHEETS read <sheetId> "2026!A:H"

# Append rows (stdin = JSON array of arrays)
echo '[["2026-03-01","2026-03-03","Miami","US","Zouk Fest"]]' | node $SHEETS append <sheetId> "2026!A:H"

# Overwrite a range
echo '[["updated","values"]]' | node $SHEETS write <sheetId> "Sheet1!A1:B1"

All output is JSON to stdout. Logs go to stderr.

Auth Scope

  • Read commands (list, read, meta): Uses spreadsheets.readonly + drive.readonly
  • Write commands (append, write): Uses spreadsheets (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 <id> | jq '.sheets[].title'
# Then read specific tab
node $SHEETS read <id> "TabName!A:Z"

Pipe to other tools

# CSV-like output
node $SHEETS read <id> "Sheet1!A:D" | jq -r '.values[] | @csv'
# Count rows
node $SHEETS read <id> "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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Universal Primitives

通用执行器架构原理:大语言模型只需文件增删改查和执行脚本两个基元工具,配合其天然的文字理解能力,就能从"无所不知只能输出文字"跃迁到"无所不能能控制任何软件硬件"。当用户讨论AI能力边界、工具设计哲学、Agent架构原理、LLM与操作系统交互、如何让AI控制软件硬件等主题时触发。

Registry SourceRecently Updated
Automation

MeterSphere

本项目将 MeterSphere REST API 与本地脚本能力整合,为 OpenClaw Agent 提供了一套高效、可复用的 Skills,支持自动生成功能用例、接口定义及接口用例,查询组织、项目、模块、用例评审与缺陷关联等信息,简化了测试资产管理流程,提升了团队的自动化效率。

Registry SourceRecently Updated
Automation

Geoapify

Geoapify integration. Manage data, records, and automate workflows. Use when the user wants to interact with Geoapify data.

Registry SourceRecently Updated
Automation

Cometly

Cometly integration. Manage data, records, and automate workflows. Use when the user wants to interact with Cometly data.

Registry SourceRecently Updated