agentleFS
FizeFize/workspace-kit/skills/google-sheets/SKILL.md

google-sheets

Skill0 starsChanged 2 months agoMITView on GitHub

Google Sheets API integration with managed OAuth via Maton. Create, read, search, update, append, and format Google Sheets online cloud spreadsheets. Use this skill ONLY for online Google Sheets cloud spreadsheets (Google Workspace docs.google.com/spreadsheets or Spreadsheet IDs). Do NOT use this skill for local spreadsheet files (.xlsx, .xls, or .csv files on the local file system); use the xlsx skill for local Excel files. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).

  • Pipes a download into a shell
  • Reads credentials
  • Installs packages
  • Sends data out

18 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use google-gmail, google-chat and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • leolionartSkill

    google-gmail

    Operate Gmail via the Google Workspace CLI (gws) — send emails, reply with threading, triage inbox, and stream new messages as NDJSON. Use when users ask to send/forward/reply emails, check inbox summary, or automate email workflows.

    Also in 4 projects that use this

  • antoniolgSkill

    google-chat

    Read Google Chat spaces/threads via the Chat API, create/refresh OAuth tokens, parse Gmail Chat URLs, and list spaces. Use when asked to look up or verify messages in Google Chat or when you need API access to Chat from the CLI.

    Also in 3 projects that use this

  • refly-aiSkill

    gmail

    Integrate with Gmail for email management and automation. Use when you need to: (1) send and compose emails with attachments, (2) read and search emails by criteria, (3) manage drafts and email labels, or (4) reply to email threads and conversations.

    Also in 7 projects that use this

  • refly-aiSkill

    instagram

    Integrate with Instagram for social media. Use when you need to: (1) post content to Instagram, (2) manage media and insights, or (3) automate Instagram publishing workflows.

    Also in 3 projects that use this

  • AnthropicSkill

    slack

    Also in 5 projects that use this

  • OpenAISkill

    linear

    Manage issues, projects & team workflows in Linear. Use when the user wants to read, create or updates tickets in Linear.

    Also in 5 projects that use this

  • +1 more from refly-ai

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After installation, verify with:

    line 104
  2. Distinctive:

    If you have multiple Google Sheets connections, specify which one to use:

    line 215
  3. Distinctive:

    If you have multiple connections, always specify the connection to ensure requests go to the intended account.

    line 239
  4. Very specific:

    Read cell values from a specified range (e.g., Sheet1!A1:C5 or A:D).

    line 270
  5. Distinctive:

    Write or replace cell values in a range.

    line 290
  6. Distinctive:

    Create a blank spreadsheet with initial title and optional first sheet title.

    line 348
  7. Distinctive:

    Add sheets, delete sheets, change colors, format borders, update column widths, or set grid cell properties.

    line 370
  8. Very specific:

    Ensure your URL path starts with google-sheets.

    line 511

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Google Sheets (Cloud Spreadsheet Skill)

Access the Google Sheets API (v4) with managed OAuth authentication via Maton. Create spreadsheets, read cell values, update data, append rows, and manage formulas/formatting.

⚠️ Cloud vs. Local File Scope Distinction:

  • google-sheets (This Skill): Exclusively for online Google Sheets cloud spreadsheets (docs.google.com/spreadsheets/d/{spreadsheetId}). Interacts directly with Google's cloud servers via Maton OAuth API proxy.
  • xlsx Skill: For reading, creating, or editing local .xlsx / .xls / .csv files stored on the local disk.

Quick Start

CLI:

# Read values from a sheet range
maton google-sheets values get <spreadsheetId> --range 'Sheet1!A1:D10'
# Create a new spreadsheet
maton google-sheets spreadsheet create --title 'Q3 Financial Report' --sheet-title 'Summary'
# Update values in a sheet range
maton google-sheets values update <spreadsheetId> --range 'Sheet1!A1:B2' --json-values '[["Item", "Price"], ["Widget", 19.99]]'
# Append a row of data
maton google-sheets values append <spreadsheetId> --range 'Sheet1!A1' --values '2026-07-23,Subscription Revenue,1250.00'

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/google-sheets/v4/spreadsheets/<spreadsheetId>/values/Sheet1!A1:Z100')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Base URL

https://api.maton.ai/google-sheets/{native-api-path}

Maton proxies requests to sheets.googleapis.com and automatically injects your OAuth token.


CLI Installation (optional — agent decides)

Maton CLI is optional. Agent can decide whether to install it based on the environment.

macOS / Linux

curl -fsSL https://maton.ai/install.sh | bash

Windows

irm https://maton.ai/install.ps1 | iex

npm (cross-platform)

npm install -g @maton/cli

Homebrew (macOS)

brew install maton-ai/cli/maton

After installation, verify with:

maton --version

Authentication

CLI:

maton login                          # Opens browser for API key
maton login --interactive            # Skip browser, paste API key directly
maton whoami                         # Show current auth state

Manual:

  1. Sign in or create an account at maton.ai
  2. Go to maton.ai/settings
  3. Copy your API key
  4. Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"

Connection Management

Manage your Google Sheets OAuth connections at https://api.maton.ai.

List Connections

CLI:

maton connection list google-sheets --status ACTIVE
maton api -X GET /connections -f app=google-sheets -f status=ACTIVE

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=google-sheets&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Create Connection

CLI:

maton connection create google-sheets
maton api /connections -f app=google-sheets

Response:

{
  "connection": {
    "connection_id": "{connection_id}",
    "status": "ACTIVE",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "google-sheets"
  }
}

Open the returned url in a browser to complete OAuth authorization.

Get Connection

CLI:

maton connection get {connection_id}                 # alias: maton connection view
maton api /connections/{connection_id}

Delete Connection

CLI:

maton connection delete {connection_id} --yes
maton api -X DELETE /connections/{connection_id}

Specifying Connection

If you have multiple Google Sheets connections, specify which one to use:

CLI:

maton google-sheets values get <spreadsheetId> --range 'Sheet1!A1:D10' --connection {connection_id}
maton api /google-sheets/v4/spreadsheets/<spreadsheetId>/values/Sheet1!A1:D10 --connection {connection_id}

Python:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/google-sheets/v4/spreadsheets/<spreadsheetId>/values/Sheet1!A1:D10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

If you have multiple connections, always specify the connection to ensure requests go to the intended account.


Security & Permissions

  • Access is scoped to Google Sheets within the connected Google account.
  • All write, update, append, and delete operations require explicit user approval. Confirm target spreadsheet ID, sheet name, and cell values with the user before executing.

API Reference

1. Get Spreadsheet Metadata

Retrieve spreadsheet properties, sheets list, grid dimensions, and formulas.

GET /google-sheets/v4/spreadsheets/{spreadsheetId}

Example CLI:

maton google-sheets spreadsheet get <spreadsheetId>
maton google-sheets spreadsheet get <spreadsheetId> --include-grid-data --json

2. Read Cell Values

Read cell values from a specified range (e.g., Sheet1!A1:C5 or A:D).

GET /google-sheets/v4/spreadsheets/{spreadsheetId}/values/{range}

Query Parameters:

  • valueRenderOption - FORMATTED_VALUE, UNFORMATTED_VALUE, or FORMULA
  • dateTimeRenderOption - SERIAL_NUMBER or FORMATTED_STRING

Example CLI:

maton google-sheets values get <spreadsheetId> --range 'Sheet1!A1:E50'
maton google-sheets values get <spreadsheetId> --range 'Sheet1!A1:B10' --value-render-option UNFORMATTED_VALUE --json

3. Update Cell Range

Write or replace cell values in a range.

Example CLI:

# Comma-separated row
maton google-sheets values update <spreadsheetId> --range 'Sheet1!A1' --values 'Alice,100,true'

# Multi-row via JSON values
maton google-sheets values update <spreadsheetId> --range 'Sheet1!A1:B2' --json-values '[["Item","Price"],["Widget",19.99]]'

Raw REST API:

PUT /google-sheets/v4/spreadsheets/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED
Content-Type: application/json

{
  "range": "Sheet1!A1:B2",
  "majorDimension": "ROWS",
  "values": [
    ["Item", "Price"],
    ["Widget", 19.99]
  ]
}
  • valueInputOption: USER_ENTERED (parses numbers, dates, formulas like =SUM(...)) or RAW (stores raw strings).

4. Append Rows to Sheet

Append new rows after the last row of data in a table range.

Example CLI:

# Comma-separated row
maton google-sheets values append <spreadsheetId> --range 'Sheet1!A1' --values '2026-07-23,Subscription Revenue,1250.00'

# Multi-row via JSON values
maton google-sheets values append <spreadsheetId> --range 'Sheet1!A1' --json-values '[["2026-07-24","Consulting",800.00]]' --insert-data-option INSERT_ROWS

5. Clear Cell Values

Clear values from a range without deleting the cells or formatting.

Example CLI:

maton google-sheets values clear <spreadsheetId> --range 'Sheet1!A1:D10'

6. Create New Spreadsheet

Create a blank spreadsheet with initial title and optional first sheet title.

Example CLI:

maton google-sheets spreadsheet create --title 'Q3 Financial Report' --sheet-title 'Summary'

7. Copy Sheet Between Spreadsheets

Copy a sheet from a source spreadsheet to a destination spreadsheet.

Example CLI:

maton google-sheets sheet copy <sourceSpreadsheetId> --sheet-id 0 --to <destSpreadsheetId>

8. Batch Update Sheet Formatting & Layout

Add sheets, delete sheets, change colors, format borders, update column widths, or set grid cell properties.

POST /google-sheets/v4/spreadsheets/{spreadsheetId}:batchUpdate
Content-Type: application/json

{
  "requests": [
    {
      "addSheet": {
        "properties": {
          "title": "Analytics Data"
        }
      }
    }
  ]
}

Example CLI:

maton api -X POST /google-sheets/v4/spreadsheets/<spreadsheetId>:batchUpdate \
  -d '{"requests":[{"addSheet":{"properties":{"title":"Analytics Data"}}}]}'

Code Examples

CLI

# Create spreadsheet
maton google-sheets spreadsheet create --title 'Company Budget' --sheet-title '2026'

# Read values
maton google-sheets values get <spreadsheetId> --range '2026!A1:C10'

# Append a record
maton google-sheets values append <spreadsheetId> --range '2026!A1' --values 'Cloud Hosting,350.00,Approved'

JavaScript

// Read values from spreadsheet
const response = await fetch(
  'https://api.maton.ai/google-sheets/v4/spreadsheets/<spreadsheetId>/values/Sheet1!A1:D10?valueRenderOption=FORMATTED_VALUE',
  {
    headers: {
      'Authorization': `Bearer ${process.env.MATON_API_KEY}`
    }
  }
);
const result = await response.json();
console.log(result.values);

// Append rows
const appendResponse = await fetch(
  'https://api.maton.ai/google-sheets/v4/spreadsheets/<spreadsheetId>/values/Sheet1!A1:append?valueInputOption=USER_ENTERED',
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.MATON_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      values: [
        ['Alice', 'Engineering', '120000']
      ]
    })
  }
);
console.log('Appended updates:', await appendResponse.json());

Python: Read Values & Convert to Dict

import os, json, urllib.request

spreadsheet_id = "<spreadsheetId>"
cell_range = "Sheet1!A1:C10"

url = f"https://api.maton.ai/google-sheets/v4/spreadsheets/{spreadsheet_id}/values/{cell_range}"
req = urllib.request.Request(url)
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')

res = json.load(urllib.request.urlopen(req))
rows = res.get('values', [])

if rows:
    headers = rows[0]
    data = [dict(zip(headers, row)) for row in rows[1:]]
    print(json.dumps(data, indent=2))

Notes

  • Spreadsheet IDs are opaque strings (extracted from https://docs.google.com/spreadsheets/d/<spreadsheetId>/edit).
  • A1 notation ranges containing spaces or special characters in sheet names should be quoted (e.g. 'Q3 Report'!A1:D10).
  • IMPORTANT: When using curl commands, use curl -g when URLs contain brackets (such as [, ]) to disable glob parsing.
  • IMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get "Invalid API key" errors when piping.

Error Handling

StatusMeaning
400Missing Google Sheets connection or invalid range syntax (e.g. Sheet1!A1:Z)
401Invalid or missing Maton API key
404Spreadsheet ID not found or access denied
429Rate limit exceeded
5xxGoogle Sheets API backend error

Troubleshooting: API Key Issues

CLI:

maton whoami
maton connection list google-sheets

Manual:

echo $MATON_API_KEY
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Troubleshooting: Invalid App Name

  1. Ensure your URL path starts with google-sheets. For example:
  • Correct: https://api.maton.ai/google-sheets/v4/spreadsheets/<spreadsheetId>/values/Sheet1!A1:D10
  • Incorrect: https://api.maton.ai/sheets/v4/spreadsheets/<spreadsheetId>/values/Sheet1!A1:D10

Resources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.