Google Docs
The robomotion googledocs CLI connects to Google Docs API for document management. It creates new documents, reads document content, and updates existing documents in Google Drive.
When to use
- Create new Google Docs documents
- Read content from existing Google Docs
- Update and modify document content
Prerequisites
robomotionCLI installed- Package installed:
robomotion install googledocs - Google Docs OAuth2 or Service Account credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install googledocs - Connect with session:
robomotion googledocs connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion googledocs create_document --client-id "<client-id>" --title <title> --session-id "<session-id>" --output json - Disconnect when done:
robomotion googledocs disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion googledocs create_document --title [--sharewith] --output jsonCreates a new Google Doc with the specified title and optional sharing settingsrobomotion googledocs open_document --url --output jsonOpens an existing Google Doc by its URL for reading and editingrobomotion googledocs delete_range --document-id --start-index --end-index --output jsonDeletes content in a Google Doc between specified start and end indicesrobomotion googledocs insert_text --document-id --text --font-size --times-new-roman [--align] --output jsonInserts text at the end of a Google Doc with formatting optionsrobomotion googledocs read_document --document-id --output jsonReads the full text content of a Google Docrobomotion googledocs insert_link --document-id --link --link-text --font-size --times-new-roman [--align] [--0-067] [--0-333] [--0-800] --output jsonInserts a clickable hyperlink at the end of a Google Doc with customizable text and stylingrobomotion googledocs replace_text --document-id --text-to-replace --replacement [--replacement-type] --output jsonReplaces all occurrences of a text string in a Google Doc with new text or a linkrobomotion googledocs add_image --document-id --image-url [--height] [--width] --output jsonInserts an image from a URL into a Google Doc with optional size settingsrobomotion googledocs add_header --document-id --text --font-size --times-new-roman [--align] --output jsonAdds or replaces the header text in a Google Doc with formatting optionsrobomotion googledocs add_footer --document-id --text --font-size --times-new-roman [--align] --output jsonAdds or replaces the footer text in a Google Doc with formatting optionsrobomotion googledocs add_heading --document-id --text --font-size --times-new-roman [--heading] [--align] --output jsonAdds a styled heading (title٫ subtitle٫ or H1-H6) to a Google Docrobomotion googledocs pdf_export --document-id --file-path --output jsonExports a Google Doc as a PDF file to the local filesystem
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)