Get the FREE Ultimate OpenClaw Setup Guide →
t

Google Docs from Markdown

Scanned

@techlaai

npx machina-cli add skill @techlaai/gdocs-markdown --openclaw
Files (1)
SKILL.md
2.4 KB

Google Docs from Markdown

Create Google Docs from Markdown files using the workflow: Markdown → DOCX → Drive Upload → Google Docs.

Why This Skill Exists

gog docs CLI does NOT support writing/updating content to Google Docs. It only supports:

  • create - Create empty doc
  • export - Export to file
  • cat - Read content
  • copy - Copy existing doc

This skill provides the missing workflow to create Google Docs WITH content from Markdown.

Author

Created by techla

Prerequisites

  • gog CLI authenticated with Google account
  • pandoc binary (auto-downloaded on first use if not available)

Installation Note

After installing from ClawHub, fix the script permissions:

chmod +x ~/.openclaw/workspace/skills/gdocs-markdown/scripts/gdocs-create.sh

Usage

Quick Create

# Create Google Doc from markdown file
gdocs-create.sh /path/to/file.md "Tiêu đề Document"

Manual Workflow

If you need more control, follow these steps:

  1. Ensure pandoc is available:

    # Auto-downloaded to /tmp/pandoc-3.1.11/bin/pandoc on first use
    # Or use system pandoc if available
    
  2. Convert Markdown to DOCX:

    /tmp/pandoc-3.1.11/bin/pandoc input.md -o output.docx
    
  3. Upload to Drive (auto-converts to Google Docs):

    gog drive upload output.docx
    
  4. Result: Google Drive returns a link to the converted Google Doc

Script Reference

See scripts/gdocs-create.sh for the helper script that automates this workflow.

Example

# Create a report from markdown
echo "# Báo Cáo\n\nNội dung..." > /tmp/report.md
gdocs-create.sh /tmp/report.md "Báo Cáo Tháng 2"

# Output: https://docs.google.com/document/d/xxxxx/edit

Notes

  • Google Drive automatically converts DOCX to Google Docs format on upload
  • The resulting document is fully editable in Google Docs
  • Original DOCX file remains in Drive but can be deleted if only Google Docs version is needed

Source

git clone https://clawhub.ai/techlaai/gdocs-markdownView on GitHub

Overview

Create a Google Doc from Markdown by converting to DOCX and uploading to Drive. This fills the gog CLI gap where writing content to Google Docs isn’t supported, delivering an end-to-end workflow from Markdown to a fully editable Google Doc.

How This Skill Works

Your Markdown file is converted to DOCX using pandoc, then uploaded to Google Drive with gog drive upload. Drive automatically converts the DOCX to a Google Doc, which is fully editable and shareable in Google Docs.

When to Use It

  • You have Markdown notes or reports and need a ready-to-edit Google Doc.
  • You’re using the gog CLI and need to populate Google Docs with content.
  • You want to automate Markdown-to-Docs creation in scripts or CI pipelines.
  • You need to convert a technical specification or README into a Docs-friendly format for collaboration.
  • You want to preserve formatting from Markdown through the DOCX conversion in Drive.

Quick Start

  1. Step 1: Prepare your Markdown file and title.
  2. Step 2: Run gdocs-create.sh /path/to/file.md \"Your Title\".
  3. Step 3: Open the resulting Google Doc link in Drive and start editing.

Best Practices

  • Ensure pandoc is installed and accessible on your system.
  • Authenticate the gog CLI with your Google account before running.
  • Use the Quick Create flow for simple documents; switch to the Manual Workflow for larger docs.
  • After upload, verify Drive converts the DOCX to a Google Doc and preserves formatting.
  • Keep the original DOCX only if you still need the source; otherwise delete to avoid duplication.

Example Use Cases

  • Create a monthly report from a Markdown file and publish as a Google Doc.
  • Convert team meeting notes into a shareable Google Doc.
  • Turn a README.md into a doc for product docs or onboarding.
  • Convert a technical spec to Docs for collaboration with non-technical stakeholders.
  • Publish a blog draft to Google Docs for editorial review.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers