Direct Google Docs integration for OpenClaw using gogcli as a wrapper.
This skill enables OpenClaw to read, create, and manage Google Docs directly through WhatsApp or other connected channels. It uses gogcli for Google Workspace API integration.
- Read Documents - Download and display document content
- List Documents - Browse documents from Google Drive
- Create Documents - Create new Google Docs
- Get Metadata - View document title, size, last modified date
- Edit Documents - Find and replace text (creates new document)
- Mark Tasks Complete - Append completion notes to documents
- Node.js 18+
- gogcli installed and configured
- Google Workspace credentials
# Clone the repository
git clone https://github.com/clawoneloke/gdocs-skill.git
cd gdocs-skill
# Install dependencies
npm install
# Set up gogcli if not already installed
# Download from: https://github.com/therealglazou/gogcli
# Configure gogcli with your Google credentials
~/.openclaw/workspace/gogcli/bin/gog init# Required for gogcli keyring access
export GOG_KEYRING_PASSWORD='your-keyring-password'
# Optional: Path to gogcli binary
export GOG_PATH='~/.openclaw/workspace/gogcli/bin/gog'- Run
gog initto start OAuth authentication - Complete Google sign-in in your browser
- Save the keyring password for future use
| Command | Description | Example |
|---|---|---|
read-doc <docId> |
Read document content | read-doc 1gBnUjqmmuwlJGxSFwTg8raPqSkJ_qMpf8aciW2Y9Du0 |
list-docs |
List all documents | list-docs |
create-doc <title> |
Create new document | create-doc "My Document" |
doc-info <docId> |
Get document metadata | doc-info 1gBnUjqmmuwlJGxSFwTg8raPqSkJ_qMpf8aciW2Y9Du0 |
download <docId> [path] |
Download to local path | download 1gBnUjqmmuwlJGxSFwTg8raPqSkJ_qMpf8aciW2Y9Du0 ./output |
edit-doc <docId> <old> <new> |
Replace text (creates new doc) | edit-doc <id> "old text" "new text" |
mark-complete <docId> <task> |
Mark task complete | mark-complete <id> "Configure models" |
Read a document:
node gdocs.js read-doc 1gBnUjqmmuwlJGxSFwTg8raPqSkJ_qMpf8aciW2Y9Du0Create a new document:
node gdocs.js create-doc "Weekly Meeting Notes"Find and replace text:
node gdocs.js edit-doc 1gBnUjqmmuwlJGxSFwTg8raPqSkJ_qMpf8aciW2Y9Du0 "TODO" "DONE"gdocs-skill/
├── gdocs.js # Main skill implementation
├── SETUP_GUIDE.md # Detailed setup instructions
├── SKILL.md # OpenClaw skill documentation
├── package.json # NPM dependencies
├── .gitignore # Excludes credentials/node_modules
└── README.md # This file
gogcli- Google Workspace CLI tool- Node.js built-in modules (fs, path, child_process)
This skill uses gogcli which doesn't support inline Google Docs editing. The workaround workflow is:
- Download document via gogcli
- Edit content locally
- Upload as new document
- Share with collaborators
For true inline editing with full formatting support, direct Google Docs API integration with OAuth2 would be required.
- Plain text content is preserved
- Rich formatting may be lost in download/upload cycle
- Images and complex formatting not fully supported
- Credentials: Never commit credentials to git
- Environment Variables: All sensitive data via environment variables
- Gitignore: Properly excludes credentials/, token.json, and node_modules/
| Variable | Description |
|---|---|
GOG_KEYRING_PASSWORD |
Password for gogcli keyring access |
GOG_PATH |
Path to gogcli binary (optional) |
Set the GOG_KEYRING_PASSWORD environment variable:
export GOG_KEYRING_PASSWORD='your-password'- Verify the document ID is correct
- Ensure the document is shared with your Google account
- Check that gogcli is authenticated:
gog account
- Verify Google account has access to the document
- Check document sharing settings
- Fork the repository
- Create a feature branch
- Make changes
- Submit pull request
MIT License - see LICENSE file for details.