Install
openclaw skills install google-docs-cliGoogle Docs Secure Management. Use when the user wants to create, read, or edit Google Docs content; or manage sharing, permissions, renames, and deletes.
openclaw skills install google-docs-cliUse porteden docs for Google Docs content 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).
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.porteden docs)porteden docs create --name "Meeting Notes"porteden docs create --name "Brief" --folder google:0B7_FOLDERporteden docs create --name "Draft" --content "Initial paragraph."porteden docs create --name "Sprint Plan" --content-file ./plan.md --content-mime-type text/markdownporteden docs read google:DOCIDporteden docs read google:DOCID --format structured -jporteden docs edit google:DOCID --append "New paragraph."porteden docs edit google:DOCID --insert "Header text" --at 1porteden docs edit google:DOCID --find "old text" --replace "new text"porteden docs edit google:DOCID --find "foo" --replace "bar" --find "baz" --replace "qux"porteden docs edit google:DOCID --ops-file ./ops.jsonporteden docs download google:DOCID -jcporteden docs share google:DOCID --type user --role writer --email user@example.comporteden docs share google:DOCID --type anyone --role readerporteden docs permissions google:DOCID -jcporteden docs rename google:DOCID --name "New Title"porteden docs delete google:DOCID -y--ops-file accepts a JSON array of operations:
[
{"type": "appendText", "text": "New paragraph at end."},
{"type": "insertText", "text": "Header", "index": 1},
{"type": "replaceText", "find": "old phrase", "replace": "new phrase", "matchCase": true}
]
PE_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.porteden docs read returns plain text by default; use --format structured for full API JSON with headings and formatting.porteden docs create accepts optional --content/--content-file to seed the body in one round-trip. Default --content-mime-type is text/plain; pass text/markdown to import markdown headings/lists as Doc structure. Without content flags, a blank doc is created.--content and --content-file are mutually exclusive on docs create.--find and --replace are repeatable and must be used in matched pairs. --ops-file is mutually exclusive with inline edit flags.porteden docs download returns URLs only — no binary content is streamed.accessInfo in responses describes active token restrictions.delete moves to trash (reversible). Files can be restored from Google Drive trash.PE_API_KEY, PE_PROFILE, PE_FORMAT, PE_COLOR, PE_VERBOSE.