← 返回
内容创作 Key 中文

Skill to manage and update google sheet

Read, write, append, and manage Google Sheets via the Google Sheets API (Node.js SDK). Use when you need to interact with spreadsheets — reading data, writing/updating cells, appending rows, clearing ranges, formatting cells, managing sheets. Requires a Google Cloud service account with Sheets API enabled.
使用 Google Sheets API(Node.js SDK)读取、写入、追加和管理 Google 表格。适用于读取数据、写入/更新单元格、追加行、清空范围、格式化单元格及管理工作表。需拥有已启用 Sheets API 的 Google Cloud 服务账号。
longmaba
内容创作 clawhub v1.0.0 1 版本 99911.5 Key: 需要
★ 1
Stars
📥 3,368
下载
💾 454
安装
1
版本
#latest

概述

Google Sheets Skill

Interact with Google Sheets using a service account.

Setup (One-time)

  1. Google Cloud Console:
    • Create/select a project
    • Enable "Google Sheets API"
    • Create a Service Account (IAM → Service Accounts → Create)
    • Download JSON key
  1. Configure credentials (one of these):
    • Set env: GOOGLE_SERVICE_ACCOUNT_KEY=/path/to/key.json
    • Place service-account.json or credentials.json in the skill directory
    • Place in ~/.config/google-sheets/credentials.json
  1. Share sheets with the service account email (found in JSON key as client_email)
  1. Install dependencies:

```bash

cd skills/google-sheets && npm install

```

Usage

node scripts/sheets.js <command> [args]

Commands

Data Operations

CommandArgsDescription
----------------------------
read Read cells
write Write data
append Append rows
clear Clear range

Formatting

CommandArgsDescription
----------------------------
format Format cells
getFormat Get cell formats
borders [styleJson]Add borders
copyFormat Copy format between ranges
merge Merge cells
unmerge Unmerge cells

Layout

CommandArgsDescription
----------------------------
resize` rows> `Resize columns/rows
autoResize Auto-fit columns
freeze [rows] [cols]Freeze rows/columns

Sheet Management

CommandArgsDescription
----------------------------
create</code></td><td>Create spreadsheet</td></tr><tr><td><code>info</code></td><td><code><id></code></td><td>Get metadata</td></tr><tr><td><code>addSheet</code></td><td><code><id> <title></code></td><td>Add sheet tab</td></tr><tr><td><code>deleteSheet</code></td><td><code><id> <sheetName></code></td><td>Delete sheet tab</td></tr><tr><td><code>renameSheet</code></td><td><code><id> <oldName> <newName></code></td><td>Rename sheet tab</td></tr></tbody></table><h2>Examples</h2><pre><code># Read data node scripts/sheets.js read "SPREADSHEET_ID" "Sheet1!A1:C10" # Write data node scripts/sheets.js write "SPREADSHEET_ID" "Sheet1!A1:B2" '[["Name","Score"],["Alice",95]]' # Format cells (yellow bg, bold) node scripts/sheets.js format "SPREADSHEET_ID" "Sheet1!A1:B2" '{"backgroundColor":{"red":255,"green":255,"blue":0},"textFormat":{"bold":true}}' # Copy format from one range to another node scripts/sheets.js copyFormat "SPREADSHEET_ID" "Sheet1!A1:C3" "Sheet1!D1:F3" # Add borders node scripts/sheets.js borders "SPREADSHEET_ID" "Sheet1!A1:C3" # Resize columns to 150px node scripts/sheets.js resize "SPREADSHEET_ID" "Sheet1" cols A C 150 # Auto-fit column widths node scripts/sheets.js autoResize "SPREADSHEET_ID" "Sheet1" A Z # Freeze first row and column node scripts/sheets.js freeze "SPREADSHEET_ID" "Sheet1" 1 1 # Add new sheet tab node scripts/sheets.js addSheet "SPREADSHEET_ID" "NewSheet" </code></pre><h2>Format Options</h2><pre><code>{ "backgroundColor": {"red": 255, "green": 255, "blue": 0}, "textFormat": { "bold": true, "italic": false, "fontSize": 12, "foregroundColor": {"red": 0, "green": 0, "blue": 0} }, "horizontalAlignment": "CENTER", "verticalAlignment": "MIDDLE", "wrapStrategy": "WRAP" } </code></pre><h2>Border Style</h2><pre><code>{ "style": "SOLID", "color": {"red": 0, "green": 0, "blue": 0} } </code></pre><p>Border styles: DOTTED, DASHED, SOLID, SOLID_MEDIUM, SOLID_THICK, DOUBLE</p><h2>Finding Spreadsheet ID</h2><p>From URL: <code>https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit</code></p><h2>Troubleshooting</h2><ul><li><strong>403 Forbidden</strong>: Sheet not shared with service account email</li><li><strong>404 Not Found</strong>: Wrong spreadsheet ID or sheet name</li></ul></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 1 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v1.0.0</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-03-28 11:22 安全 安全 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=6ef45014880c26f80f7ef1996154c51d" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/25/390757_bdd410fb70fde6c224ecdde86623d2f7.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1781381532%3B1812917532&q-key-time=1781381532%3B1812917532&q-header-list=host&q-url-param-list=&q-signature=c2170d8ebc424c942a6a401f8c293f98535c8000" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">content-creation</span> <h3><a href="/s/youtube-api-skill">YouTube</a></h3> <div class="rec-owner">byungkyu</div> <div class="rec-desc">使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 142</span> <span style="color:#5b6abf;">📥 41,115</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">content-creation</span> <h3><a href="/s/humanizer">Humanizer</a></h3> <div class="rec-owner">biostartechnology</div> <div class="rec-desc">消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 862</span> <span style="color:#5b6abf;">📥 200,230</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">content-creation</span> <h3><a href="/s/admapix">AdMapix</a></h3> <div class="rec-owner">fly0pants</div> <div class="rec-desc">广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 295</span> <span style="color:#5b6abf;">📥 136,553</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>