/gws:md-to-google-doc [file.md] [folder-id-or-url | --folder <id-or-url> | doc-id-or-url] [--title "Title"]from gws
Uploads or syncs local markdown files to Google Drive as formatted Google Docs. Routes through gws CLI, gcloud ADC, or the Drive connector depending on which account can authenticate.
Ships in gws. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Upload local markdown files to Google Drive as formatted Google Docs. The best available path depends on which account can authenticate and how much fidelity the target doc needs.
gws only authenticates your personal Google account. If the target doc's
account isn't reachable by gws, route through the next rung — try in
order, and only read/run the next rung's setup on fallthrough.
Use the existing workflow below: full create, update-in-place, tab
management, section linking. This is the primary path whenever gws can
authenticate to the target account.
Fall through to rung 2 if gws auth status fails or the target account
can't reach the destination folder/doc (403/404 for that account, not an
expired-token case).
Direct Drive/Docs API access via ADC. Supports create (files.create with
a markdown upload — same server-side importer gws uses) and
update-in-place: a state file
(~/.config/gws-md-to-gdoc/rendered.json) remembers which source file
produced which doc ID, so reruns update instead of duplicating. Sets
PAGELESS via a batchUpdate after create, same as gws.
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/adc-check.sh" # fast preflight; exit 0 = configured
bash "$SKILL_DIR/scripts/adc-create.sh" <file.md> [folder-id-or-url] [--title "Title"] [--new]
--new forces a fresh doc even if the state file has a prior entry for this
source file. If adc-check.sh fails, it prints an actionable one-line
reason — only then read
references/adc-setup.md for the full gcloud
setup steps. If ADC isn't configured and setting it up isn't worth it right
now, fall through to rung 3.
Not supported on this rung yet: tab-scoped publishing, section linking (both gws-only for now).
Use when neither gws nor ADC can reach the target account, and the
mcp__claude_ai_Google_Drive__* tools are available in this session.
Verified live (2026-07-14): create_file with contentMimeType: "text/markdown" produces a real formatted Google Doc (headings, bold,
links, lists, tables) — no de-escaping needed on this direction, this is
the connector's write path, not its read path.
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/clean.sh" <file.md> /tmp/cleaned-$$.md
--title wasn't given (H1 heading, else filename).mcp__claude_ai_Google_Drive__create_file:
title: derived/given titletextContent: the cleaned markdown contentcontentMimeType: "text/markdown"parentId: target folder ID if --folder was given (strip a full
.../folders/FOLDER_ID URL the same way as folder-ID extraction
elsewhere in this skill)disableConversionToGoogleType unset — default conversion is
what formats the Doc.https://docs.google.com/document/d/<id>/edit (the id
field create_file returns).Refuse update requests on this rung. The connector's update_file tool
only renames/moves — it cannot replace content, and trash_file fails with
a permission error (confirmed live — no delete means no throwaway-temp-doc
tricks either). If asked to update an existing doc and only this rung is
available, say so and point at rung 2 (ADC update-in-place) instead of
silently creating a duplicate doc.
Known limits (confirmed live): no bold/italic/inline emphasis inside
table cells (stays literal **text**); no way to set PAGELESS mode (new
docs land in Drive's default paged mode); same unsupported set as gws
(images, footnotes, smart chips) presumed but not individually verified on
this rung.
If none of the three rungs can reach the destination, fail with a clear message naming which rungs were tried and why each failed.
# Codex: this path resolves under Claude Code; substitute the directory containing this plugin.
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$PLUGIN_ROOT/scripts/auth-preflight.sh"
Run the entrypoint script, passing all arguments through. It auto-detects create vs update based on whether the destination looks like a doc URL/ID or a folder ID:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/gdoc.sh" $ARGUMENTS
If no arguments were provided, ask the user for the file path and destination.
Optional flags: --title "Custom Title" overrides the auto-derived title.
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/upload.sh" ./file.md FOLDER_ID
The folder may be a bare ID or a full Drive folder URL, and may be passed
positionally or via --folder. All of these are equivalent:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/upload.sh" ./file.md FOLDER_ID
bash "$SKILL_DIR/scripts/upload.sh" ./file.md "https://drive.google.com/drive/u/0/folders/FOLDER_ID"
bash "$SKILL_DIR/scripts/upload.sh" ./file.md --folder "https://drive.google.com/drive/u/0/folders/FOLDER_ID"
With a custom title:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/upload.sh" ./file.md FOLDER_ID --title "My Document"
The script handles: frontmatter stripping, Obsidian callout cleanup, title derivation, upload, verification, and temp file cleanup. It prints the Google Doc URL on success.
Important: The gws CLI requires --upload paths within the current
working directory. The script creates a temp file in cwd automatically, but
the source file must be accessible from cwd (use relative paths or copy first).
The folder ID is the last path segment of a Drive folder URL:
https://drive.google.com/drive/u/0/folders/FOLDER_ID_HERE
When no --title is given, the script:
# H1 heading in the file (after frontmatter).md stripped and hyphens replaced by spaces# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/update.sh" ./file.md DOC_ID
Also accepts a full Google Doc URL instead of a bare doc ID:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/update.sh" ./file.md "https://docs.google.com/document/d/DOC_ID/edit"
Google Docs supports native tabs (left-sidebar). update.sh replaces the
ENTIRE document and deletes every tab except the first — it refuses to
run against a multi-tab doc unless you pass --force.
To publish markdown into one tab while preserving the others:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/tab-update.sh" ./file.md DOC_ID --tab "Tab Title"
bash "$SKILL_DIR/scripts/tab-update.sh" ./file.md DOC_ID --tab t.abc123
How it works: the markdown is converted server-side via a throwaway temp doc
(auto-trashed), whose structure is replayed into the target tab with
tab-scoped batchUpdate requests. Supported: headings, bold/italic/links,
nested bullet & numbered lists, tables, and horizontal rules (---, rendered
as a paragraph bottom border). Not supported (skipped with a warning): images,
footnotes, smart chips.
After publishing, turn §N / §NB references into clickable links to the
matching section heading in another tab (e.g. a "Next Steps" tab linking into
the main findings tab):
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/link-sections.sh" DOC_ID
bash "$SKILL_DIR/scripts/link-sections.sh" DOC_ID --target-tab "Findings" --from-tab "Next Steps"
By default the target is the tab with the most numbered-section headings and all other tabs are scanned. Idempotent — safe to re-run after edits. Run it after the tabs are published so the target headings exist.
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/tabs.sh" list DOC_ID
bash "$SKILL_DIR/scripts/tabs.sh" add DOC_ID "Next Steps" --emoji "⭐" --index 1
bash "$SKILL_DIR/scripts/tabs.sh" rename DOC_ID "Next Steps" "Action Items"
bash "$SKILL_DIR/scripts/tabs.sh" delete DOC_ID t.abc123 --yes
When uploading multiple files to the same folder, run upload commands in parallel for efficiency:
# Codex: this path resolves under Claude Code; substitute the directory containing this SKILL.md.
SKILL_DIR="${CLAUDE_SKILL_DIR}"
bash "$SKILL_DIR/scripts/upload.sh" ./file1.md FOLDER_ID &
bash "$SKILL_DIR/scripts/upload.sh" ./file2.md FOLDER_ID &
wait
If the bundled scripts are unavailable, see MANUAL.md for the step-by-step manual workflow.
Auth expired: Run gws auth login to re-authenticate.
Wrong account: Run gws auth status to check which account is active.
Account mismatch: If the doc/folder belongs to a different Google account,
the script will tell you which account you're authenticated as and suggest
sharing or switching accounts. Run gws auth status to check.
Upload path error: The gws CLI rejects absolute paths outside cwd. Copy
the file into cwd first, or cd to the file's directory before uploading.
"This doc has N native tabs" error: the doc uses native tabs; use
tab-update.sh (see "Updating a Single Tab") or pass --force to
intentionally flatten the doc to one tab.
"File not found" / 404 on a folder or doc that exists (shared drives): the
resource lives on a shared drive — Drive v3 file calls need
supportsAllDrives=true in their query params to see it. All bundled scripts
(both the gws and ADC rungs) pass it on every Drive v3 create/get/update; if you
call the Drive API by hand, add it to --params. Note the exceptions that work
on shared-drive docs without the flag: files.export, and the Docs API
(documents.get / documents.batchUpdate) — the flag is for Drive file
operations only.
"remembered doc … is not readable" warning (ADC rung): the doc in the
state file returned 404, so a new doc was created. Drive returns 404 both for
a deleted doc and for one you've lost access to, so check whether it was a
sharing change before keeping the copy — the original may still exist.
"no write access to doc … insufficientFilePermissions" (ADC rung): you can
read the doc but not edit it. Request edit access from the owner, or pass
--new to render to a fresh doc you own.
agents/openai.yaml (opens in a new tab)references/MANUAL.md (opens in a new tab)references/adc-setup.md (opens in a new tab)scripts/adc-check.sh (opens in a new tab)scripts/adc-create.sh (opens in a new tab)scripts/adc_create.py (opens in a new tab)scripts/adc_state.py (opens in a new tab)scripts/clean.sh (opens in a new tab)scripts/gdoc.sh (opens in a new tab)scripts/link-sections.sh (opens in a new tab)scripts/link_sections.py (opens in a new tab)scripts/replay_tab.py (opens in a new tab)scripts/tab-update.sh (opens in a new tab)scripts/tabs.sh (opens in a new tab)scripts/update.sh (opens in a new tab)scripts/upload.sh (opens in a new tab)tests/fixtures/tab-fixture.md (opens in a new tab)tests/smoke-tabs.sh (opens in a new tab)tests/test_adc_create.py (opens in a new tab)tests/test_adc_state.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub jtsternberg/claude-plugins --plugin gws7 skills in this plugin
/gws-accountCheck, add, list, or switch the active Google account. The only way to manage gws accounts — the CLI has no `account` subcommand./gws-calendarGoogle Calendar via the gws CLI — 'what's on my calendar', today's meetings, schedule, find an event, pull its Meet/Zoom link, create events, list calendars./gmail-draft-from-markdownTurn a local markdown file into a Gmail draft via gws — converts to HTML, attaches local files, threads onto an existing message as a reply, never sends, returns the Gmail drafts URL for review./gmail-readSearch and read Gmail via gws — 'find the email about X', 'search my inbox for', read a message's full body as plain text./google-doc-to-mdDownload a Google Doc (tabs supported) as local markdown, via gws CLI, gcloud ADC, or the Drive connector./gws-youtubeManage the user's own YouTube playlists via gws — list, add/remove videos, dedupe, merge, find duplicates, cleanup workflows. Use instead of raw YouTube Data API calls.