Use CLI Gcloud

Reads Google Sheets and Docs through gsheet and gdoc. Authentication comes from a gcloud access token.

thkt Updated

File contents

use-cli-gcloud

Commands

Type URL Pattern Default Structured
Sheets docs.google.com/spreadsheets/d/ gsheet "URL" (CSV) gsheet "URL" json (JSONL, tabular data)
Docs docs.google.com/document/d/ gdoc "URL" (text) gdoc "URL" md (Markdown, specs/documents)

Prerequisites

gsheet and gdoc are shell functions taking their token from gcloud auth print-access-token. Neither carries a --help, so this page is the authority on how to call them.

Pitfalls

With the authentication expired, Google returns an error page instead of the content, which arrives as broken CSV or HTML. When the result does not carry the shape of a table, stop and ask for gcloud auth login.

thkt/claude-config/tree/main/skills/use-cli-gcloud commit 4be0b1be32

Frequently asked questions

npx skillmds@latest add thkt/use-cli-gcloud