🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman
Google Sheets CLI with agent skills
sheets-cli is a Bun-based CLI for Google Sheets that reads tables, appends rows, updates cells by key or row, and returns JSON for programmatic use. It is built around composable commands and includes agent skill files so Claude Code and Codex can discover and use it during spreadsheet work.

Builders who want Claude Code, Codex, or another agent to read and update Google Sheets reliably.
You can let an agent inspect and edit sheets with dry runs and key-based updates instead of retyping data or chasing row numbers.
What it does
Read sheets as structured data
`read table` and `read range` return JSON rows, headers, and metadata for downstream use.
Write by key or row
`append`, `update row`, and `update key` let you change sheets with JSON values and avoid fragile manual edits.
Batch related changes
`batch` groups multiple append, update, and range-set operations into one command.
Agent skill installation
`install-skill` copies a skill for Claude Code, Codex, or global use so agents can find the tool automatically.
Dry-run workflow
Write commands support `--dry-run` so you can preview changes before applying them.
JSON stdout and exit codes
Commands emit machine-readable JSON and clear exit codes for automation and agent loops.
How to get it
- 1Prerequisites: Bun runtime
git clone https://github.com/gmickel/sheets-cli.git cd sheets-cli bun install bun run build # Binary at ./dist/sheets-cli
- 2Run
# Symlink ln -s "$(pwd)/dist/sheets-cli" /usr/local/bin/sheets-cli # Or add to shell config echo 'export PATH="$PATH:/path/to/sheets-cli/dist"' >> ~/.zshrc
- 3Run
sheets-cli auth login --credentials ./client_secret.json
- 4Run
# Set env var to avoid passing --spreadsheet every time export SHEETS_CLI_DEFAULT_SPREADSHEET_ID="your-spreadsheet-id"
- 5Run
sheets-cli sheets list --spreadsheet <id> sheets-cli read table --spreadsheet <id> --sheet "Sheet1" --limit 5 sheets-cli append --spreadsheet <id> --sheet "Sheet1" --values '{"Name":"New Item","Status":"Active"}' - 6Run
# Claude Code sheets-cli install-skill # Project: ./.claude/skills/sheets-cli/SKILL.md sheets-cli install-skill --global # Personal: ~/.claude/skills/sheets-cli/SKILL.md # OpenAI Codex sheets-cli install-skill --codex # ~/.codex/skills/sheets-cli/SKILL.md
README

sheets-cli
Composable Google Sheets primitives for humans and agents
Installation • Quick Start • Commands • For Agents
📢 New Project: Check out GNO — local hybrid search for your documents (Markdown, PDF, Word, Excel). Combines BM25 + vector search with MCP integration for AI agents. Great companion to sheets-cli: search your local docs, query your cloud sheets.
Fast, deterministic CLI for Google Sheets. Read tables, append rows, update cells by key or index, batch operations—all with JSON output for programmatic consumption.
# Read a sheet as structured data
sheets-cli read table --sheet "Projects" --limit 10
# Update by key column (no fragile row indices)
sheets-cli update key --sheet "Projects" --key-col "Name" --key "Acme" --set '{"Status":"Done"}'
🆕 Agent Skills — Install as a skill for Claude Code, OpenAI Codex, or VS Code (Insiders preview; enable
chat.useAgentSkills). The agent automatically discovers sheets-cli when you mention spreadsheets. See For Agents.
Installation
Prerequisites: Bun runtime
git clone https://github.com/gmickel/sheets-cli.git
cd sheets-cli
bun install
bun run build
# Binary at ./dist/sheets-cli
Add to PATH
# Symlink
ln -s "$(pwd)/dist/sheets-cli" /usr/local/bin/sheets-cli
# Or add to shell config
echo 'export PATH="$PATH:/path/to/sheets-cli/dist"' >> ~/.zshrc
Quick Start
1. Enable APIs
- Go to Google Cloud Console → APIs
- Enable Google Sheets API
- Enable Google Drive API (required for
sheets findcommand)
2. Create OAuth Credentials
- Go to Google Cloud Console → Credentials
- Create OAuth 2.0 Client ID → Desktop app
- Download the JSON file
Desktop apps auto-allow localhost redirects. CLI captures OAuth code via
http://localhost:3847.
3. Authenticate
sheets-cli auth login --credentials ./client_secret.json
Browser opens → authorize → done.
4. Set Default Spreadsheet (optional)
# Set env var to avoid passing --spreadsheet every time
export SHEETS_CLI_DEFAULT_SPREADSHEET_ID="your-spreadsheet-id"
Get the ID from your sheet URL: docs.google.com/spreadsheets/d/<ID>/edit
5. Use
sheets-cli sheets list --spreadsheet <id>
sheets-cli read table --spreadsheet <id> --sheet "Sheet1" --limit 5
sheets-cli append --spreadsheet <id> --sheet "Sheet1" --values '{"Name":"New Item","Status":"Active"}'
Commands
Auth
sheets-cli auth login --credentials <file> [--token-store <path>]
sheets-cli auth status
sheets-cli auth logout
Metadata
sheets-cli sheets list [--spreadsheet <id>]
sheets-cli sheets find --name "<query>" [--limit 10] # Search by name
sheets-cli sheet info --sheet "<name>" [--spreadsheet <id>]
sheets-cli sheet info --gid <gid> [--spreadsheet <id>]
sheets-cli header --sheet "<name>" [--header-row 1]
Read
sheets-cli read table --sheet "<name>" [--limit 500] [--range "A1:Z500"] [--raw]
sheets-cli read range --range "<sheet>!A1:Z50"
Write
sheets-cli append --sheet "<name>" --values '<json>' [--value-input USER_ENTERED|RAW] [--dry-run]
sheets-cli update row --sheet "<name>" --row 12 --set '<json>' [--dry-run]
sheets-cli update key --sheet "<name>" --key-col "Col" --key "Val" --set '<json>' [--dry-run] [--allow-multi]
sheets-cli set range --range "<sheet>!M2:M2" --values '<json_2d_array>' [--dry-run]
sheets-cli batch --ops '<json>' [--dry-run]
All flags
| Flag | Description | Default |
|---|---|---|
--spreadsheet <id> | Spreadsheet ID or full URL | env var or required |
--dry-run | Preview without applying | false |
--value-input <mode> | USER_ENTERED or RAW | USER_ENTERED |
--header-row <n> | Header row number | Auto-detect |
--limit <n> | Max rows to return | unlimited |
--raw | Return unformatted values | false |
--allow-multi | Update multiple matching rows | false |
JSON Formats
Append/Update values
{"Name": "Acme Corp", "Status": "Active", "Start Date": "2025-01-15"}
Headerless sheets (column letters):
{"A": "Acme Corp", "C": "Active"}
Set range (2D array)
[["Value1", "Value2"], ["Value3", "Value4"]]
Batch operations
[
{"op": "append", "sheet": "Tasks", "values": {"Name": "New Task"}},
{"op": "updateRow", "sheet": "Tasks", "row": 5, "set": {"Status": "Done"}},
{"op": "updateKey", "sheet": "Tasks", "keyCol": "ID", "key": "TASK-123", "set": {"Status": "Active"}},
{"op": "setRange", "range": "Tasks!A1:B1", "values": [["Col1", "Col2"]]}
]
Output Format
All commands return JSON to stdout:
{
"ok": true,
"cmd": "read table",
"spreadsheetId": "1abc...",
"sheet": "Projects",
"result": {
"headers": ["Name", "Status", "Date"],
"rows": [{"Name": "Alpha", "Status": "Active", "Date": "2025-01-15"}],
"headerRow": 1
}
}
Errors:
{
"ok": false,
"cmd": "update key",
"error": {"code": "VALIDATION_ERROR", "message": "...", "details": {}}
}
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
10 | Validation error |
20 | Auth error |
30 | Permission error |
40 | API/transient error |
For Agents
Install Skill
# Claude Code
sheets-cli install-skill # Project: ./.claude/skills/sheets-cli/SKILL.md
sheets-cli install-skill --global # Personal: ~/.claude/skills/sheets-cli/SKILL.md
# OpenAI Codex
sheets-cli install-skill --codex # ~/.codex/skills/sheets-cli/SKILL.md
Installs an Agent Skill that teaches the agent how to use sheets-cli. After installing, the agent automatically discovers sheets-cli when you mention spreadsheets, Google Sheets, or sheet names.
Codex: Requires
skills = truein~/.codex/config.tomlunder[features]. VS Code: Agent Skills support is in preview and only available in VS Code Insiders. Enablechat.useAgentSkillsto use Agent Skills.
Restart the agent after installing to load the skill.
Workflow Pattern
Follow read → decide → dry-run → apply:
# 1. Understand current state
sheets-cli read table --sheet "Tasks" --limit 100
# 2. Dry-run
sheets-cli update key --sheet "Tasks" --key-col "ID" --key "TASK-42" --set '{"Status":"Complete"}' --dry-run
# 3. Apply
sheets-cli update key --sheet "Tasks" --key-col "ID" --key "TASK-42" --set '{"Status":"Complete"}'
Best Practices
- Use
sheets findto get spreadsheet ID from name - Prefer key-based updates over row indices—rows shift on insert/delete
- Always dry-run before writes
- Check
okfield before proceeding - Batch related operations for atomicity
- Column names match case-insensitively with normalized whitespace
- Header row auto-detects—skips empty rows to find first row with data
- Headerless sheets:
read tablereturns columns asA,B, ...; use column letters for--set/--key-col - Empty sheets:
appendcan bootstrap by writing a header row from JSON keys read table --rangeacceptsA1:Z(auto-prefixed with the sheet)--spreadsheetaccepts URLs—paste full Google Sheets URL directly
Development
bun run dev # Hot-reload
bun run build # Compile binary
bun run typecheck # Type check
bun run lint # Lint
bun run test # Tests
License
MIT
Built with Bun • Styled for machines and humans alike
Files in the repo
- .claude
- .cursor
- .flow
- .github
- .vscode
- src
- .gitignore
- AGENTS.md
- biome.jsonc
- bun.lock
- CLAUDE.md
- lefthook.yml
- package.json
- prd.md
- README.md
- SKILL.md
- tsconfig.json
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tools
The best-benchmarked open-source AI memory system. And it's free.
Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.