Secure Google Sheets Skill
Create, read, write, and share Google Sheets through one OpenClaw skill — with PortEden enforcing scopes and audit on every cell mutation.
google-sheets · spreadsheets · data · permissions
Example
Add a Q2 totals row to the Revenue tab that sums each month column.
Sheet: Revenue (google:1Cd...) ok wrote Revenue!A14:D14 =SUM(B2:B13) ... (USER_ENTERED) Cell mutation logged: range, old value, new value, actor.
Add to your agent
Steps 1–2 are identical for every agent — install the porteden binary and authenticate once. Step 3 registers the skill with your runtime.
Install the PortEden CLI
OpenClaw skills delegate every API call to the porteden binary. Install once with Homebrew or Go.
brew install porteden/tap/porteden # orgo install github.com/porteden/cli/cmd/porteden@latest Authenticate
Browser-based login is recommended — credentials are written to your OS keyring. Token-based login is available for headless environments.
porteden auth login # headless / CIporteden auth login --token <PE_API_KEY> porteden auth status Install the porteden-sheets skill
OpenClaw fetches the signed skill bundle and registers its commands with the agent.
openclaw skills install porteden-sheets The SKILL.md
The canonical, copy-paste-able skill definition your agent loads.
porteden sheets
Use porteden sheets for Google Sheets data operations and file management. 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).
Setup (once)
- Browser login (recommended):
porteden auth login— opens browser, credentials stored in system keyring - Direct token:
porteden auth login --token <key>— stored in system keyring - Verify:
porteden auth status - If
PE_API_KEYis set in the environment, the CLI uses it automatically (no login needed). - Drive access requires a token with
driveAccessEnabled: trueand a connected Google account with Drive scopes.
Sheets commands (porteden sheets)
Data operations
- Create new spreadsheet:
porteden sheets create --name "Q1 Budget" - Create in folder:
porteden sheets create --name "Data" --folder google:0B7_FOLDER - Spreadsheet metadata (tabs, dimensions):
porteden sheets info google:SHEETID -jc - Read cell range:
porteden sheets read google:SHEETID --range "Sheet1!A1:C10" -jc - Read whole sheet:
porteden sheets read google:SHEETID --range "Sheet1" -jc - Write cells (JSON):
porteden sheets write google:SHEETID --range "Sheet1!A1:B2" --values '[["Name","Score"],["Alice",95]]' - Write cells (CSV string):
porteden sheets write google:SHEETID --range "Sheet1!A1:B2" --csv "Name,Score\nAlice,95" - Write cells (CSV file):
porteden sheets write google:SHEETID --range "Sheet1!A1" --csv-file ./data.csv - Append rows (JSON):
porteden sheets append google:SHEETID --range "Sheet1!A:B" --values '[["Bob",87]]' - Append rows (CSV):
porteden sheets append google:SHEETID --range "Sheet1!A:B" --csv "Bob,87"
File management
- Get export links (xlsx, pdf, csv):
porteden sheets download google:SHEETID -jc - Share:
porteden sheets share google:SHEETID --type user --role writer --email user@example.com - Share publicly:
porteden sheets share google:SHEETID --type anyone --role reader - List permissions:
porteden sheets permissions google:SHEETID -jc - Rename:
porteden sheets rename google:SHEETID --name "Q2 Budget" - Delete (trash):
porteden sheets delete google:SHEETID -y
Range format
- Full range:
Sheet1!A1:C10 - Whole sheet:
Sheet1 - Open-ended (for append):
Sheet1!A:B
Notes
- Credentials persist in the system keyring after login. No repeated auth needed.
- Set
PE_PROFILE=workto avoid repeating--profile. -jcis shorthand for--json --compact: strips noise, limits fields, reduces tokens for AI agents.- File IDs are always provider-prefixed (e.g.,
google:1BxiMVs0XRA5...). Pass them as-is. --values,--csv, and--csv-fileare mutually exclusive — provide exactly one.--csvinline: use\nas row separator (e.g.,"Name,Score\nAlice,95\nBob,87").--rawflag disables formula evaluation (values written literally, not parsed as formulas).porteden sheets downloadreturns URLs only — no binary content is streamed.accessInfoin responses describes active token restrictions.deletemoves to trash (reversible). Files can be restored from Google Drive trash.- Confirm before sharing or deleting.
- Environment variables:
PE_API_KEY,PE_PROFILE,PE_FORMAT,PE_COLOR,PE_VERBOSE.
How it works
Range syntax matches Google Sheets
All read/write commands take A1-style ranges (Sheet1!A1:C10). Multi-tab sheets work without quoting; tab names with spaces should be wrapped ('Q4 Plan'!A1:Z).
Values vs formulas
write defaults to USER_ENTERED so formulas are interpreted (=SUM(A:A) becomes a formula). Pass --raw to write literal text into a cell that would otherwise be parsed.
porteden sheets write google:SHEETID \ --range "Sheet1!A1" \ --values '[["=SUM(B:B)"]]' Export formats
download accepts --format xlsx | pdf | csv. PDF exports respect print settings (page size, headers/footers); CSV exports the active sheet by default unless --sheet is specified.
The same firewall behind every PortEden skill
- Provision to teams with role-based access policies
- Identity-aware execution — every call ties back to a user
- Signed, version-pinned skills
- Full audit trail on every tool call
- Field-level redaction at egress
Frequently asked questions
Does it write values or formulas?
When should I use Sheets Writer instead?
Is every cell change auditable?
Which agents can install it?
Related Skills
Install Secure OpenClaw Google Sheets Skill Without Inheriting the Audit Tail
Browser auth, keyring-bound credentials, server-side audit log. The same data firewall behind every PortEden integration.
Regulated org or 200+ seats? Talk to sales →