Install
openclaw skills install sheets-writerAutomated Google Sheets Data Writer — Append rows, update cells, and automate spreadsheet data pipelines with a pre-configured target sheet.
openclaw skills install sheets-writerAutomate Google Sheets updates with porteden sheets. This skill configures a target spreadsheet via environment variable so agents can append rows and write data without repeating the file ID. Use -jc flags for AI-optimized output.
If porteden is not installed: brew install porteden/tap/porteden (or go install github.com/porteden/cli/cmd/porteden@latest).
porteden auth login — opens browser, credentials stored in system keyringporteden auth login --token <key> — stored in system keyringporteden auth statusPE_API_KEY is set in the environment, the CLI uses it automatically (no login needed).driveAccessEnabled: true and a connected Google account with Drive scopes.Search for the spreadsheet by name:
porteden drive files -q "Q1 Budget" --mime-type application/vnd.google-apps.spreadsheet -jc
Copy the id field from the result (already provider-prefixed, e.g., google:1BxiMVs0XRA5...) and set it as the target:
export PE_SHEET_ID="google:1BxiMVs0XRA5nFMdKvBdBZjgmU..."
To persist across sessions, add to your shell profile (~/.bashrc, ~/.zshrc) or .env file.
porteden sheets info $PE_SHEET_ID -jc
Expected: returns spreadsheet title, sheet tabs, and dimensions. If this fails, verify the file ID and that your token has Drive access.
Append adds rows after the last row with data in the target range. This is the recommended operation for automation — it never overwrites existing data.
Append from JSON:
porteden sheets append $PE_SHEET_ID --range "Sheet1!A:D" --values '[["2025-01-15","Order #1042","Shipped",29.99]]'
Append multiple rows:
porteden sheets append $PE_SHEET_ID --range "Sheet1!A:D" --values '[["2025-01-15","Order #1042","Shipped",29.99],["2025-01-16","Order #1043","Processing",45.50]]'
Append from CSV string:
porteden sheets append $PE_SHEET_ID --range "Sheet1!A:D" --csv "2025-01-15,Order #1042,Shipped,29.99"
Append from CSV file:
porteden sheets append $PE_SHEET_ID --range "Sheet1!A:D" --csv-file ./new_rows.csv
Write replaces the exact range specified. Use for updating known cells or overwriting a section.
Write a single cell:
porteden sheets write $PE_SHEET_ID --range "Sheet1!E2" --values '[["Complete"]]'
Write a block:
porteden sheets write $PE_SHEET_ID --range "Sheet1!A1:C2" --values '[["Name","Status","Score"],["Alice","Done",95]]'
Write from CSV file:
porteden sheets write $PE_SHEET_ID --range "Sheet1!A1" --csv-file ./data.csv
After writing, confirm the data landed correctly:
porteden sheets read $PE_SHEET_ID --range "Sheet1!A1:D10" -jc
A:D not just A) — ensures data lands in the correct columns.--raw for literal values — prevents unintended formula evaluation (e.g., strings starting with =).-jc on read/info — compact JSON output minimizes tokens for AI agents.--values array rather than one-row-at-a-time.porteden sheets read $PE_SHEET_ID --range "Sheet1!1:1" -jc to read the header row first.Sheet1!A:DSheet1!A1:C10Sheet1!E2Sheet1Sheet1!1:1PE_PROFILE=work to avoid repeating --profile.-jc is shorthand for --json --compact: strips noise, limits fields, reduces tokens for AI agents.google:1BxiMVs0XRA5...). Pass them as-is.--values, --csv, and --csv-file are mutually exclusive — provide exactly one.--csv inline: use \n as row separator (e.g., "Name,Score\nAlice,95\nBob,87").--raw flag disables formula evaluation (values written literally, not parsed as formulas).accessInfo in responses describes active token restrictions.PE_API_KEY, PE_PROFILE, PE_SHEET_ID, PE_FORMAT, PE_COLOR, PE_VERBOSE.