gsheets
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Sheets Skill
Google Sheets Skill
Create, read, write, and manage Google Sheets spreadsheets.
创建、读取、写入和管理Google Sheets电子表格。
First-Time Setup
首次设置
Run to authenticate with Google. This opens a browser for OAuth consent and grants access to all Google services including Sheets.
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gmail.ts authTokens are stored per-project in .
.claude/google-skill.local.json运行 进行Google身份验证。这会打开浏览器进行OAuth授权,并授予对包括Sheets在内的所有Google服务的访问权限。
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gmail.ts auth令牌按项目存储在 中。
.claude/google-skill.local.jsonUsing Your Own Credentials (Optional)
使用自有凭证(可选)
By default, this skill uses embedded OAuth credentials. To use your own Google Cloud project instead, save your credentials to .
~/.config/google-skill/credentials.json默认情况下,此Skill使用内置的OAuth凭证。如果要改用您自己的Google Cloud项目,请将凭证保存到 。
~/.config/google-skill/credentials.jsonCommands
命令
bash
undefinedbash
undefinedList your spreadsheets
列出您的电子表格
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts list
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts list --max=50
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts list
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts list --max=50
Get spreadsheet metadata (title, sheets, etc.)
获取电子表格元数据(标题、工作表等)
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts get <spreadsheetId>
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts get <spreadsheetId>
Read cell values (A1 notation)
读取单元格值(A1表示法)
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts read <spreadsheetId> "Sheet1!A1:D10"
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts read <spreadsheetId> "Sheet1!A1:D10"
Write values to cells
向单元格写入值
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts write <spreadsheetId> "Sheet1!A1"
--values='[["Hello","World"],["Row 2","Data"]]'
--values='[["Hello","World"],["Row 2","Data"]]'
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts write <spreadsheetId> "Sheet1!A1"
--values='[["Hello","World"],["Row 2","Data"]]'
--values='[["Hello","World"],["Row 2","Data"]]'
Append rows to end of sheet
向表格末尾追加行
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts append <spreadsheetId> "Sheet1!A:D"
--values='[["New","Row","Data"]]'
--values='[["New","Row","Data"]]'
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts append <spreadsheetId> "Sheet1!A:D"
--values='[["New","Row","Data"]]'
--values='[["New","Row","Data"]]'
Clear a range
清除指定范围
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts clear <spreadsheetId> "Sheet1!A1:D10"
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts clear <spreadsheetId> "Sheet1!A1:D10"
Create new spreadsheet
创建新电子表格
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts create --title="My Spreadsheet"
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts create --title="Project Data" --sheets="Q1,Q2,Q3,Q4"
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts create --title="My Spreadsheet"
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts create --title="Project Data" --sheets="Q1,Q2,Q3,Q4"
Add new sheet/tab to existing spreadsheet
向现有电子表格添加新工作表/标签页
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts add-sheet <spreadsheetId> --title="New Tab"
undefinednpx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts add-sheet <spreadsheetId> --title="New Tab"
undefinedA1 Notation Reference
A1表示法参考
| Notation | Meaning |
|---|---|
| Single cell A1 in Sheet1 |
| Range from A1 to D10 |
| Columns A through D (all rows) |
| Rows 1 through 10 (all columns) |
| Range in first sheet |
| 表示法 | 含义 |
|---|---|
| Sheet1中的单个单元格A1 |
| 从A1到D10的范围 |
| A到D列(所有行) |
| 1到10行(所有列) |
| 第一个工作表中的范围 |
Values Format
值格式
Values are JSON arrays of arrays:
json
[
["Header 1", "Header 2", "Header 3"],
["Row 1", 123, true],
["Row 2", 456, false]
]Supported value types: strings, numbers, booleans, null (empty cell).
值为JSON数组的数组:
json
[
["Header 1", "Header 2", "Header 3"],
["Row 1", 123, true],
["Row 2", 456, false]
]支持的值类型:字符串、数字、布尔值、null(空单元格)。
Output
输出
All commands return JSON with and fields.
successdata所有命令都会返回包含和字段的JSON。
successdataHelp
帮助
bash
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts --helpbash
npx tsx ${CLAUDE_PLUGIN_ROOT}/scripts/gsheets.ts --help