/install docs-logger
porteden docs-logger
Append log lines to daily Google Docs — one document per day, auto-created inside a PE_Logs folder. Works like a cloud-native .txt log file that agents can write to from anywhere. 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 \x3Ckey>— 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.
2. Set the log folder (one-time)
If PE_LOG_FOLDER is already set, skip to the logging workflow — the folder is configured.
If PE_LOG_FOLDER is not set, search for an existing PE_Logs folder:
porteden drive files --name "PE_Logs" --mime-type application/vnd.google-apps.folder -jc
If found, copy the id field and set it:
export PE_LOG_FOLDER="google:0B7_FOLDER_ID..."
If not found, create the folder:
porteden drive mkdir --name "PE_Logs" -jc
Copy the id from the response and set it:
export PE_LOG_FOLDER="google:0B7_FOLDER_ID..."
To persist across sessions, add to your shell profile (~/.bashrc, ~/.zshrc) or .env file. Once set, this step does not need to be repeated.
Logging workflow (per run)
Each run appends log lines to today's document. Follow these two steps every time you need to log.
Step 1. Find or create today's doc
Search for a doc named with today's date (YYYY-MM-DD) inside the log folder:
porteden drive files --name "2025-01-15" --folder $PE_LOG_FOLDER --mime-type application/vnd.google-apps.document -jc
If found, use the id from the result as the doc ID for step 2.
If not found, create today's doc:
porteden docs create --name "2025-01-15" --folder $PE_LOG_FOLDER -jc
Use the id from the response as the doc ID for step 2.
Step 2. Append the log line
porteden docs edit \x3CDOC_ID> --append "[09:30:00Z] deploy | production | v2.4.1 released | success"
Each --append adds text at the end of the document, preserving all previous entries.
Multiple lines in one call:
porteden docs edit \x3CDOC_ID> --append "[09:30:00Z] deploy | production | v2.4.1 released | success
[09:31:12Z] healthcheck | production | all endpoints healthy | success"
Log format examples
Use a consistent line format. Recommended patterns:
Timestamped event: [HH:MM:SSZ] event | source | details | status
Audit entry: [HH:MM:SSZ] actor | action | resource | result
Error line: [HH:MM:SSZ] ERROR | service | message
Task result: [HH:MM:SSZ] task | agent | input → output | duration
The date is already in the document name — log lines only need the time component.
Reading logs
Read today's log:
porteden docs read \x3CDOC_ID>
List all log documents in the folder:
porteden drive files --folder $PE_LOG_FOLDER -jc
Read a specific day's log:
porteden drive files --name "2025-01-10" --folder $PE_LOG_FOLDER --mime-type application/vnd.google-apps.document -jc
Then read by its ID:
porteden docs read \x3CDOC_ID>
Best practices
- Always use
--append— never overwrite log docs. Append-only preserves the full audit trail. - Use ISO 8601 date for doc names (
YYYY-MM-DD) — ensures chronological sort and unique daily docs. - Include only the time in log lines — the date is in the document name, no need to repeat it.
- Batch multiple log lines in one
--append— separate lines with\to reduce API calls. - Use a consistent delimiter — pipe
|keeps fields scannable. Avoid commas in free-text fields. - Search before creating — always check if today's doc exists before creating a new one to avoid duplicates.
- Use
-jcon drive/read calls — compact JSON output minimizes tokens for AI agents.
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. porteden docs readreturns plain text by default.--appendadds text at the end of the document. Each call appends — it does not replace.accessInfoin responses describes active token restrictions.PE_LOG_FOLDERis the only env var specific to this skill. Store it alongsidePE_API_KEY.- Environment variables:
PE_API_KEY,PE_PROFILE,PE_LOG_FOLDER,PE_FORMAT,PE_COLOR,PE_VERBOSE.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install docs-logger - 安装完成后,直接呼叫该 Skill 的名称或使用
/docs-logger触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access. 是什么?
Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 172 次。
如何安装 Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access.?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install docs-logger」即可一键安装,无需额外配置。
Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access. 是免费的吗?
是的,Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access. 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access. 支持哪些平台?
Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access. 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Google Docs Log Automation — Append log lines to auto-created daily documents in Google Drive by PortEden Secure Access.?
由 PortEden(@porteden)开发并维护,当前版本 v1.0.0。