Skip to content
Marketplace · Logging
Logging skillsVerifiedUpdated April 28, 2026

Secure Google Sheets Logger Skill

A purpose-built logger for OpenClaw runs — append timestamped events to one Google Sheet, with row-level structure and CSV import for batch back-fills.

View on ClawHub

google-sheets · logging · audit · automation · etl

What this skill does
Logger is the structured-row counterpart to docs-logger. Where the Docs variant writes paragraph lines for human reading, Logger writes one row per event into a pre-configured Google Sheet — the right surface when the audit consumer is a pivot table, BI dashboard, or downstream ETL job. Configure PE_SHEET_ID once and every command appends to that sheet. Single events go through a one-row append; batches go through a multi-row append; a nightly back-fill goes through CSV import. Read commands are scoped to the same sheet so the agent can verify schema or fetch the last row.

Example

Prompt

Log this agent run as a row: task=invoice-sync, status=ok, duration=42s.

Output
Sheet: PE_SHEET_ID=google:1Ab...
ok  appended row: 2026-06-04T03:14Z | invoice-sync | ok | 42s

append-only (INSERT_ROWS); read scoped to the same sheet for verification.
Required tools
Google Sheets
Compatible agents
OpenClawGrok BuildAny CLI-compatible agent

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.

1

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
# or
go install github.com/porteden/cli/cmd/porteden@latest
2

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 / CI
porteden auth login --token <PE_API_KEY>
porteden auth status
3

Install the logger skill

OpenClaw fetches the signed skill bundle and registers its commands with the agent.

openclaw skills install logger

The SKILL.md

The canonical, copy-paste-able skill definition your agent loads.

SKILL.md · logger · v1.0.0 · MIT-0

porteden sheets-logger

Append log entries to a Google Sheet with porteden sheets. This skill configures a target log spreadsheet via environment variable so agents can record events, activity logs, and audit trails 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).

Setup

1. Authenticate (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_KEY is set in the environment, the CLI uses it automatically (no login needed).
  • Drive access requires a token with driveAccessEnabled: true and a connected Google account with Drive scopes.

2. Set the target log sheet (one-time)

If PE_SHEET_ID is already set, skip to step 3 — the target sheet is configured.

If PE_SHEET_ID is not set, find the spreadsheet by name:

porteden drive files -q "Activity Log" --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:

export PE_SHEET_ID="google:1BxiMVs0XRA5nFMdKvBdBZjgmU..."

To persist across sessions, add to your shell profile (~/.bashrc, ~/.zshrc) or .env file. Once set, this step does not need to be repeated.

3. Test the connection (one-time)

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. Once verified, skip this step in future runs.

4. Read the header row (one-time)

Before logging, confirm the column layout of the target sheet:

porteden sheets read $PE_SHEET_ID --range "Sheet1!1:1" -jc

Match your log entries to this column order. Once you know the schema, skip this step in future runs.

Logging data

Append a log entry

Append adds rows after the last row with data. Existing log entries are never overwritten.

  • Single log entry: bash porteden sheets append $PE_SHEET_ID --range "Sheet1!A:E" --values '[["2025-01-15T09:30:00Z","deploy","production","v2.4.1 released","success"]]'
  • Multiple log entries (batch): bash porteden sheets append $PE_SHEET_ID --range "Sheet1!A:E" --values '[["2025-01-15T09:30:00Z","deploy","production","v2.4.1 released","success"],["2025-01-15T09:31:12Z","healthcheck","production","all endpoints healthy","success"]]'
  • Log entry from CSV string: bash porteden sheets append $PE_SHEET_ID --range "Sheet1!A:E" --csv "2025-01-15T09:30:00Z,deploy,production,v2.4.1 released,success"
  • Bulk log import from CSV file: bash porteden sheets append $PE_SHEET_ID --range "Sheet1!A:E" --csv-file ./events.csv

Verify logged entries

Read back recent rows to confirm the log was recorded:

porteden sheets read $PE_SHEET_ID --range "Sheet1" -jc

Log schema examples

Structure your log sheet with a header row. Common schemas:

Event log: Timestamp | Event | Source | Details | Status

Audit trail: Timestamp | Actor | Action | Resource | Before | After

Error log: Timestamp | Severity | Service | Message | Stack

Task log: Timestamp | Task | Agent | Input | Output | Duration

Best practices

1. Always use append — logging is append-only by nature. Never use write to overwrite log entries. 2. Include a timestamp in every entry — use ISO 8601 format (2025-01-15T09:30:00Z) for sortability and consistency. 3. Use --raw for literal values — prevents unintended formula evaluation (e.g., log messages starting with =). 4. Batch entries when possible — send multiple rows in one --values array rather than one-row-at-a-time to reduce API calls. 5. Specify column range in append (e.g., A:E not just A) — ensures data lands in the correct columns. 6. Read the header row first — confirm column order with porteden sheets read $PE_SHEET_ID --range "Sheet1!1:1" -jc before appending. 7. Use -jc on read/info — compact JSON output minimizes tokens for AI agents.

Range format

  • Open-ended columns (for append): Sheet1!A:E
  • Specific cells: Sheet1!A1:E10
  • Whole sheet: Sheet1
  • Header row only: Sheet1!1:1

Notes

  • Credentials persist in the system keyring after login. No repeated auth needed.
  • Set PE_PROFILE=work to avoid repeating --profile.
  • -jc is 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-file are mutually exclusive — provide exactly one.
  • --csv inline: use \n as row separator (e.g., "ts,event,src\nts2,event2,src2").
  • --raw flag disables formula evaluation (values written literally, not parsed as formulas).
  • accessInfo in responses describes active token restrictions.
  • Environment variables: PE_API_KEY, PE_PROFILE, PE_SHEET_ID, PE_FORMAT, PE_COLOR, PE_VERBOSE.

How it works

01

Bound to one sheet via PE_SHEET_ID

PE_SHEET_ID accepts the google: prefixed file ID. Every append targets that sheet — the skill cannot write elsewhere unless the env var is rotated. Misconfiguration fails closed.

export PE_SHEET_ID="google:1AbCdEf..."
porteden sheets info $PE_SHEET_ID -jc
porteden sheets read $PE_SHEET_ID --range "Sheet1!1:1" -jc
02

Append-only writes

append finds the last non-empty row and writes after it (Google Sheets API insertDataOption=INSERT_ROWS). Existing rows are never overwritten — the sheet functions as a chronological event log.

03

Batch and CSV modes

--values takes a JSON array of arrays for batch appends; --csv-file ./events.csv parses CSV server-side. Use batch for in-process buffering; use CSV for nightly back-fills from an external source.

Deploy org-wide

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
See enterprise controls
PortEden · v1.0.0 · MIT-0
Source on ClawHub

Frequently asked questions

How is this different from the Docs Logger?
Logger writes one structured row per event into a Google Sheet, the right surface when the consumer is a pivot table or BI dashboard. Docs Logger writes paragraph lines for human reading.
Is it bound to a single sheet?
Yes, via PE_SHEET_ID. Every append targets that sheet; the skill cannot write elsewhere unless the env var is rotated, and misconfiguration fails closed.
Can I log in batches?
Yes. --values takes a JSON array of arrays for batch appends, and --csv-file imports a CSV for nightly back-fills.
Which agents can install it?
OpenClaw, Grok Build, or any CLI-compatible agent through the porteden binary.

Install Secure OpenClaw Google Sheets Logger Skill Without Inheriting the Audit Tail

Browser auth, keyring-bound credentials, server-side audit log. The same data firewall behind every PortEden integration.

Talk to sales

Regulated org or 200+ seats? Talk to sales →