{"id":36957475,"url":"https://github.com/gmickel/sheets-cli","last_synced_at":"2026-03-01T17:38:15.015Z","repository":{"id":328960359,"uuid":"1117527136","full_name":"gmickel/sheets-cli","owner":"gmickel","description":"Composable Google Sheets CLI for humans and agents. Read, write, update cells by key—with Agent Skills for Claude Code and OpenAI Codex.","archived":false,"fork":false,"pushed_at":"2026-02-11T11:07:49.000Z","size":163,"stargazers_count":39,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-11T19:29:31.032Z","etag":null,"topics":["agent-skills","automation","bun","claude-code","cli","google-sheets","openai-codex","spreadsheet","typescript"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmickel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["gmickel"]}},"created_at":"2025-12-16T12:44:58.000Z","updated_at":"2026-02-11T15:31:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gmickel/sheets-cli","commit_stats":null,"previous_names":["gmickel/sheets-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gmickel/sheets-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmickel%2Fsheets-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmickel%2Fsheets-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmickel%2Fsheets-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmickel%2Fsheets-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmickel","download_url":"https://codeload.github.com/gmickel/sheets-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmickel%2Fsheets-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29976303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-skills","automation","bun","claude-code","cli","google-sheets","openai-codex","spreadsheet","typescript"],"created_at":"2026-01-13T15:00:29.121Z","updated_at":"2026-03-01T17:38:14.990Z","avatar_url":"https://github.com/gmickel.png","language":"Python","funding_links":["https://github.com/sponsors/gmickel"],"categories":["Lista de Habilidades","Phase 3: Build and Integrate"],"sub_categories":["Habilidades de la Comunidad","Reference Implementations"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://em-content.zobj.net/source/apple/391/scroll_1f4dc.png\"\u003e\n    \u003cimg alt=\"sheets-cli\" src=\"https://em-content.zobj.net/source/apple/391/scroll_1f4dc.png\" width=\"96\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n  sheets-cli\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eComposable Google Sheets primitives for humans and agents\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e •\n  \u003ca href=\"#commands\"\u003eCommands\u003c/a\u003e •\n  \u003ca href=\"#for-agents\"\u003eFor Agents\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/bun-%23000000.svg?style=flat\u0026logo=bun\u0026logoColor=white\" alt=\"Bun\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/typescript-%23007ACC.svg?style=flat\u0026logo=typescript\u0026logoColor=white\" alt=\"TypeScript\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Google%20Sheets-34A853?style=flat\u0026logo=google-sheets\u0026logoColor=white\" alt=\"Google Sheets\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Claude_Code-D97757?style=flat\u0026logo=anthropic\u0026logoColor=white\" alt=\"Claude Code\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/OpenAI_Codex-412991?style=flat\u0026logo=openai\u0026logoColor=white\" alt=\"OpenAI Codex\"\u003e\n\u003c/p\u003e\n\n---\n\n\u003e **📢 New Project:** Check out [**GNO**](https://gno.sh) — 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.\n\n---\n\nFast, deterministic CLI for Google Sheets. Read tables, append rows, update cells by key or index, batch operations—all with JSON output for programmatic consumption.\n\n```bash\n# Read a sheet as structured data\nsheets-cli read table --sheet \"Projects\" --limit 10\n\n# Update by key column (no fragile row indices)\nsheets-cli update key --sheet \"Projects\" --key-col \"Name\" --key \"Acme\" --set '{\"Status\":\"Done\"}'\n```\n\n\u003cbr\u003e\n\n\u003e **🆕 Agent Skills** — Install as a skill for [Claude Code](https://claude.ai/code), [OpenAI Codex](https://openai.com/index/openai-codex/), or VS Code (Insiders preview; enable `chat.useAgentSkills`). The agent automatically discovers sheets-cli when you mention spreadsheets. See [For Agents](#for-agents).\n\n\u003cbr\u003e\n\n## Installation\n\n**Prerequisites:** [Bun](https://bun.sh) runtime\n\n```bash\ngit clone https://github.com/gmickel/sheets-cli.git\ncd sheets-cli\nbun install\nbun run build\n\n# Binary at ./dist/sheets-cli\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAdd to PATH\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\n# Symlink\nln -s \"$(pwd)/dist/sheets-cli\" /usr/local/bin/sheets-cli\n\n# Or add to shell config\necho 'export PATH=\"$PATH:/path/to/sheets-cli/dist\"' \u003e\u003e ~/.zshrc\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## Quick Start\n\n### 1. Enable APIs\n\n1. Go to [Google Cloud Console → APIs](https://console.cloud.google.com/apis/library)\n2. Enable **Google Sheets API**\n3. Enable **Google Drive API** (required for `sheets find` command)\n\n### 2. Create OAuth Credentials\n\n1. Go to [Google Cloud Console → Credentials](https://console.cloud.google.com/apis/credentials)\n2. Create **OAuth 2.0 Client ID** → Desktop app\n3. Download the JSON file\n\n\u003e Desktop apps auto-allow localhost redirects. CLI captures OAuth code via `http://localhost:3847`.\n\n### 3. Authenticate\n\n```bash\nsheets-cli auth login --credentials ./client_secret.json\n```\n\nBrowser opens → authorize → done.\n\n### 4. Set Default Spreadsheet (optional)\n\n```bash\n# Set env var to avoid passing --spreadsheet every time\nexport SHEETS_CLI_DEFAULT_SPREADSHEET_ID=\"your-spreadsheet-id\"\n```\n\nGet the ID from your sheet URL: `docs.google.com/spreadsheets/d/\u003cID\u003e/edit`\n\n### 5. Use\n\n```bash\nsheets-cli sheets list --spreadsheet \u003cid\u003e\nsheets-cli read table --spreadsheet \u003cid\u003e --sheet \"Sheet1\" --limit 5\nsheets-cli append --spreadsheet \u003cid\u003e --sheet \"Sheet1\" --values '{\"Name\":\"New Item\",\"Status\":\"Active\"}'\n```\n\n\u003cbr\u003e\n\n## Commands\n\n### Auth\n\n```bash\nsheets-cli auth login --credentials \u003cfile\u003e [--token-store \u003cpath\u003e]\nsheets-cli auth status\nsheets-cli auth logout\n```\n\n### Metadata\n\n```bash\nsheets-cli sheets list [--spreadsheet \u003cid\u003e]\nsheets-cli sheets find --name \"\u003cquery\u003e\" [--limit 10]  # Search by name\nsheets-cli sheet info --sheet \"\u003cname\u003e\" [--spreadsheet \u003cid\u003e]\nsheets-cli sheet info --gid \u003cgid\u003e [--spreadsheet \u003cid\u003e]\nsheets-cli header --sheet \"\u003cname\u003e\" [--header-row 1]\n```\n\n### Read\n\n```bash\nsheets-cli read table --sheet \"\u003cname\u003e\" [--limit 500] [--range \"A1:Z500\"] [--raw]\nsheets-cli read range --range \"\u003csheet\u003e!A1:Z50\"\n```\n\n### Write\n\n```bash\nsheets-cli append --sheet \"\u003cname\u003e\" --values '\u003cjson\u003e' [--value-input USER_ENTERED|RAW] [--dry-run]\nsheets-cli update row --sheet \"\u003cname\u003e\" --row 12 --set '\u003cjson\u003e' [--dry-run]\nsheets-cli update key --sheet \"\u003cname\u003e\" --key-col \"Col\" --key \"Val\" --set '\u003cjson\u003e' [--dry-run] [--allow-multi]\nsheets-cli set range --range \"\u003csheet\u003e!M2:M2\" --values '\u003cjson_2d_array\u003e' [--dry-run]\nsheets-cli batch --ops '\u003cjson\u003e' [--dry-run]\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAll flags\u003c/strong\u003e\u003c/summary\u003e\n\n| Flag | Description | Default |\n|:-----|:------------|:--------|\n| `--spreadsheet \u003cid\u003e` | Spreadsheet ID or full URL | env var or required |\n| `--dry-run` | Preview without applying | `false` |\n| `--value-input \u003cmode\u003e` | `USER_ENTERED` or `RAW` | `USER_ENTERED` |\n| `--header-row \u003cn\u003e` | Header row number | Auto-detect |\n| `--limit \u003cn\u003e` | Max rows to return | unlimited |\n| `--raw` | Return unformatted values | `false` |\n| `--allow-multi` | Update multiple matching rows | `false` |\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## JSON Formats\n\n### Append/Update values\n\n```json\n{\"Name\": \"Acme Corp\", \"Status\": \"Active\", \"Start Date\": \"2025-01-15\"}\n```\n\nHeaderless sheets (column letters):\n\n```json\n{\"A\": \"Acme Corp\", \"C\": \"Active\"}\n```\n\n### Set range (2D array)\n\n```json\n[[\"Value1\", \"Value2\"], [\"Value3\", \"Value4\"]]\n```\n\n### Batch operations\n\n```json\n[\n  {\"op\": \"append\", \"sheet\": \"Tasks\", \"values\": {\"Name\": \"New Task\"}},\n  {\"op\": \"updateRow\", \"sheet\": \"Tasks\", \"row\": 5, \"set\": {\"Status\": \"Done\"}},\n  {\"op\": \"updateKey\", \"sheet\": \"Tasks\", \"keyCol\": \"ID\", \"key\": \"TASK-123\", \"set\": {\"Status\": \"Active\"}},\n  {\"op\": \"setRange\", \"range\": \"Tasks!A1:B1\", \"values\": [[\"Col1\", \"Col2\"]]}\n]\n```\n\n\u003cbr\u003e\n\n## Output Format\n\nAll commands return JSON to stdout:\n\n```json\n{\n  \"ok\": true,\n  \"cmd\": \"read table\",\n  \"spreadsheetId\": \"1abc...\",\n  \"sheet\": \"Projects\",\n  \"result\": {\n    \"headers\": [\"Name\", \"Status\", \"Date\"],\n    \"rows\": [{\"Name\": \"Alpha\", \"Status\": \"Active\", \"Date\": \"2025-01-15\"}],\n    \"headerRow\": 1\n  }\n}\n```\n\n**Errors:**\n\n```json\n{\n  \"ok\": false,\n  \"cmd\": \"update key\",\n  \"error\": {\"code\": \"VALIDATION_ERROR\", \"message\": \"...\", \"details\": {}}\n}\n```\n\n### Exit Codes\n\n| Code | Meaning |\n|:-----|:--------|\n| `0` | Success |\n| `10` | Validation error |\n| `20` | Auth error |\n| `30` | Permission error |\n| `40` | API/transient error |\n\n\u003cbr\u003e\n\n## For Agents\n\n### Install Skill\n\n```bash\n# Claude Code\nsheets-cli install-skill           # Project: ./.claude/skills/sheets-cli/SKILL.md\nsheets-cli install-skill --global  # Personal: ~/.claude/skills/sheets-cli/SKILL.md\n\n# OpenAI Codex\nsheets-cli install-skill --codex   # ~/.codex/skills/sheets-cli/SKILL.md\n```\n\nInstalls an [Agent Skill](https://docs.anthropic.com/en/docs/agents-and-tools/agent-skills/overview) 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.\n\n\u003e **Codex**: Requires `skills = true` in `~/.codex/config.toml` under `[features]`.\n\u003e **VS Code**: Agent Skills support is in preview and only available in VS Code Insiders. Enable `chat.useAgentSkills` to use Agent Skills.\n\n**Restart the agent** after installing to load the skill.\n\n### Workflow Pattern\n\nFollow **read → decide → dry-run → apply**:\n\n```bash\n# 1. Understand current state\nsheets-cli read table --sheet \"Tasks\" --limit 100\n\n# 2. Dry-run\nsheets-cli update key --sheet \"Tasks\" --key-col \"ID\" --key \"TASK-42\" --set '{\"Status\":\"Complete\"}' --dry-run\n\n# 3. Apply\nsheets-cli update key --sheet \"Tasks\" --key-col \"ID\" --key \"TASK-42\" --set '{\"Status\":\"Complete\"}'\n```\n\n### Best Practices\n\n1. **Use `sheets find`** to get spreadsheet ID from name\n2. **Prefer key-based updates** over row indices—rows shift on insert/delete\n3. **Always dry-run** before writes\n4. **Check `ok` field** before proceeding\n5. **Batch related operations** for atomicity\n6. **Column names match case-insensitively** with normalized whitespace\n7. **Header row auto-detects**—skips empty rows to find first row with data\n8. **Headerless sheets:** `read table` returns columns as `A`, `B`, ...; use column letters for `--set` / `--key-col`\n9. **Empty sheets:** `append` can bootstrap by writing a header row from JSON keys\n10. **`read table --range`** accepts `A1:Z` (auto-prefixed with the sheet)\n11. **`--spreadsheet` accepts URLs**—paste full Google Sheets URL directly\n\n\u003cbr\u003e\n\n## Development\n\n```bash\nbun run dev          # Hot-reload\nbun run build        # Compile binary\nbun run typecheck    # Type check\nbun run lint         # Lint\nbun run test         # Tests\n```\n\n\u003cbr\u003e\n\n## License\n\nMIT\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt with \u003ca href=\"https://bun.sh\"\u003eBun\u003c/a\u003e • Styled for machines and humans alike\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmickel%2Fsheets-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmickel%2Fsheets-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmickel%2Fsheets-cli/lists"}