一键导入
google-sheets
Google Sheets API via curl. Use this skill to read, write, and manage spreadsheet data programmatically.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Google Sheets API via curl. Use this skill to read, write, and manage spreadsheet data programmatically.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Architect Agent for the Apeiron workflow. Transforms structured requirements into document model designs — GraphQL state schemas, module/operation plans, subgraph type definitions, and editor component specs. Use when (1) requirements are ready and a schema needs designing, (2) a new document model needs modules and operations planned, (3) an existing model needs schema changes proposed, (4) subgraph types need to be designed for new fields, or (5) you need to plan how a feature maps to Powerhouse primitives. Triggers on: schema design, document model architecture, operation planning, module design, type design, subgraph planning, model proposal, specs.
Analyst Agent for the Apeiron workflow. Transforms raw business ideas, stakeholder input, and SME knowledge into structured requirements for Powerhouse document models. Use when (1) a new feature or document model is proposed but requirements are vague, (2) stakeholder needs must be captured and prioritized, (3) a PRD needs to be created or refined, (4) frontend data needs must be communicated to backend, or (5) starting any new workstream that will eventually become a document model. Triggers on: new feature request, requirements gathering, stakeholder analysis, PRD creation, business requirements, problem statement, feature proposal, demand signal.
Developer Agent for the Apeiron workflow. Implements document model changes — reducers, editors, subgraph resolvers — from an Architect's spec. Use when (1) a spec is ready and needs implementing, (2) reducers need to be written or updated, (3) editor components need to be built, (4) subgraph resolvers need mapping, (5) MCP actions need dispatching for schema changes, or (6) you're in the implementation phase of any document model workstream. Triggers on: implement spec, write reducer, build editor, implement operation, dispatch actions, code the schema, wire up subgraph, implement feature.
Reviewer Agent for the Apeiron workflow. Schema hygiene, document state verification, delivery checklist, and query field mapping for ALL Powerhouse document models in this repo. Use when (1) an implementation needs reviewing before merge, (2) checking a live document's state against its schema for unused/empty fields, (3) auditing a document model for dead weight, (4) verifying subgraph query types match the schema, (5) preparing a schema delivery for backend consumers, (6) running a weekly backend sync, or (7) running TypeScript/ESLint checks. Triggers on: schema audit, dead weight, field mapping, query fields, backend sync, delivery checklist, apeiron check, subgraph query, document state check, unused fields, review implementation, approve schema.
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.
Build document models, editors, processors, subgraphs, and drive-apps for the Powerhouse/Vetra ecosystem. Use when Claude needs to (1) create or modify document models with GraphQL schemas and operations, (2) build React-based document editors with dispatch hooks, (3) work with Reactor-MCP tools for document and drive management, (4) implement pure synchronous reducers, (5) use the Powerhouse CLI (ph vetra, ph generate, ph connect), (6) design GraphQL state and input schemas with Powerhouse scalar types, (7) create subgraphs or processors, (8) deploy or publish Powerhouse packages, or any Powerhouse/Vetra development task. Triggers on mentions of: Powerhouse, Vetra, document model, reactor, MCP reactor, ph vetra, ph generate, switchboard, Connect Studio, drive, PHID, OID, document-engineering, reducer, dispatch, addActions.
| name | google-sheets |
| description | Google Sheets API via curl. Use this skill to read, write, and manage spreadsheet data programmatically. |
| vm0_secrets | ["GOOGLE_SHEETS_CLIENT_SECRET","GOOGLE_SHEETS_REFRESH_TOKEN"] |
| vm0_vars | ["GOOGLE_SHEETS_CLIENT_ID"] |
Use the Google Sheets API via direct curl calls to read, write, and manage spreadsheet data.
Official docs:
https://developers.google.com/sheets/api
Use this skill when you need to:
Create Google Cloud Project
Configure OAuth Consent Screen
Create OAuth Client ID
https://developers.google.com/oauthplaygroundGet Refresh Token
https://www.googleapis.com/auth/spreadsheetsSet Environment Variables
export GOOGLE_SHEETS_CLIENT_ID="your-client-id"
export GOOGLE_SHEETS_CLIENT_SECRET="your-client-secret"
export GOOGLE_SHEETS_REFRESH_TOKEN="your-refresh-token"
bash -c 'curl -s -X POST "https://oauth2.googleapis.com/token" -d "client_id=$GOOGLE_SHEETS_CLIENT_ID" -d "client_secret=$GOOGLE_SHEETS_CLIENT_SECRET" -d "refresh_token=$GOOGLE_SHEETS_REFRESH_TOKEN" -d "grant_type=refresh_token"' | jq -r '.access_token' > /tmp/sheets_token.txt
# Verify token was obtained
head -c 20 /tmp/sheets_token.txt && echo "..."
Then use $(cat /tmp/sheets_token.txt) inside bash -c wrappers for API calls.
gcloud auth activate-service-account --key-file=service-account.json
export GOOGLE_ACCESS_TOKEN=$(gcloud auth print-access-token)
For publicly accessible sheets, you can use an API key:
export GOOGLE_API_KEY="your-api-key"
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
All examples below use ${GOOGLE_ACCESS_TOKEN}. Before running, either:
GOOGLE_ACCESS_TOKEN="ya29.xxx...", or${GOOGLE_ACCESS_TOKEN} with $(cat /tmp/sheets_token.txt) in each commandImportant: In range notation like
Sheet1!A1:D10, the!must be URL encoded as%21in the URL path (e.g.,Sheet1%21A1:D10). All examples below use this encoding.
Base URL: https://sheets.googleapis.com/v4/spreadsheets
Finding your Spreadsheet ID:
The spreadsheet ID is in the URL: https://docs.google.com/spreadsheets/d/{SPREADSHEET_ID}/edit
Get information about a spreadsheet (sheets, properties). Replace <your-spreadsheet-id> with your actual spreadsheet ID:
bash -c 'curl -s "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}"' | jq '{title: .properties.title, sheets: [.sheets[].properties | {sheetId, title}]}''
Read a range of cells. Replace <your-spreadsheet-id> with your actual spreadsheet ID:
bash -c 'curl -s "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values/Sheet1%21A1:D10" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}"' | jq '.values'
Read all data from a sheet. Replace <your-spreadsheet-id> with your actual spreadsheet ID:
bash -c 'curl -s "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values/Sheet1" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}"' | jq '.values'
For publicly accessible sheets. Replace <your-spreadsheet-id> with your actual spreadsheet ID:
bash -c 'curl -s "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values/Sheet1%21A1:D10?key=${GOOGLE_API_KEY}"' | jq '.values'
Update a range of cells. Replace <your-spreadsheet-id> with your actual spreadsheet ID.
Write to /tmp/gsheets_request.json:
{
"values": [
["Name", "Email", "Status"]
]
}
Then run:
bash -c 'curl -s -X PUT "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values/Sheet1%21A1:C1?valueInputOption=USER_ENTERED" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}" -H "Content-Type: application/json" -d @/tmp/gsheets_request.json' | jq '.updatedCells'
valueInputOption:
RAW: Values are stored as-isUSER_ENTERED: Values are parsed as if typed by user (formulas evaluated)Add new rows to the end of a sheet. Replace <your-spreadsheet-id> with your actual spreadsheet ID.
Write to /tmp/gsheets_request.json:
{
"values": [
["John Doe", "john@example.com", "Active"]
]
}
Then run:
bash -c 'curl -s -X POST "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values/Sheet1%21A:C:append?valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}" -H "Content-Type: application/json" -d @/tmp/gsheets_request.json' | jq '.updates | {updatedRange, updatedRows}'
Read multiple ranges in one request. Replace <your-spreadsheet-id> with your actual spreadsheet ID:
bash -c 'curl -s "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values:batchGet?ranges=Sheet1%21A1:B5&ranges=Sheet1%21D1:E5" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}"' | jq '.valueRanges'
Update multiple ranges in one request. Replace <your-spreadsheet-id> with your actual spreadsheet ID.
Write to /tmp/gsheets_request.json:
{
"valueInputOption": "USER_ENTERED",
"data": [
{
"range": "Sheet1!A1",
"values": [["Header 1"]]
},
{
"range": "Sheet1!B1",
"values": [["Header 2"]]
}
]
}
Then run:
bash -c 'curl -s -X POST "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values:batchUpdate" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}" -H "Content-Type: application/json" -d @/tmp/gsheets_request.json' | jq '.totalUpdatedCells'
Clear a range of cells. Replace <your-spreadsheet-id> with your actual spreadsheet ID.
Write to /tmp/gsheets_request.json:
{}
Then run:
bash -c 'curl -s -X POST "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values/Sheet1%21A2:C100:clear" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}" -H "Content-Type: application/json" -d @/tmp/gsheets_request.json' | jq '.clearedRange'
Create a new spreadsheet:
Write to /tmp/gsheets_request.json:
{
"properties": {
"title": "My New Spreadsheet"
},
"sheets": [
{
"properties": {
"title": "Data"
}
}
]
}
Then run:
bash -c 'curl -s -X POST "https://sheets.googleapis.com/v4/spreadsheets" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}" -H "Content-Type: application/json" -d @/tmp/gsheets_request.json' | jq '.spreadsheetId, .spreadsheetUrl'
Add a new sheet to an existing spreadsheet. Replace <your-spreadsheet-id> with your actual spreadsheet ID.
Write to /tmp/gsheets_request.json:
{
"requests": [
{
"addSheet": {
"properties": {
"title": "New Sheet"
}
}
}
]
}
Then run:
bash -c 'curl -s -X POST "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>:batchUpdate" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}" -H "Content-Type: application/json" -d @/tmp/gsheets_request.json' | jq '.replies[0].addSheet.properties'
Delete a sheet from a spreadsheet (use sheetId from metadata). Replace <your-spreadsheet-id> with your actual spreadsheet ID.
Write to /tmp/gsheets_request.json:
{
"requests": [
{
"deleteSheet": {
"sheetId": 123456789
}
}
]
}
Then run:
bash -c 'curl -s -X POST "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>:batchUpdate" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}" -H "Content-Type: application/json" -d @/tmp/gsheets_request.json'
Find cells containing specific text (read all then filter). Replace <your-spreadsheet-id> with your actual spreadsheet ID:
bash -c 'curl -s "https://sheets.googleapis.com/v4/spreadsheets/<your-spreadsheet-id>/values/Sheet1" -H "Authorization: Bearer ${GOOGLE_ACCESS_TOKEN}"' | jq '[.values[] | select(.[0] | ascii_downcase | contains("search_term"))]'
| Notation | Description |
|---|---|
Sheet1!A1 | Single cell A1 in Sheet1 |
Sheet1!A1:B2 | Range from A1 to B2 |
Sheet1!A:A | Entire column A |
Sheet1!1:1 | Entire row 1 |
Sheet1!A1:C | From A1 to end of column C |
'Sheet Name'!A1 | Sheet names with spaces need quotes |
gcloud auth print-access-tokenUSER_ENTERED for formulas, RAW for literal strings%20)