PlugWiki

Save a Gmail Message to Google Docs with Claude Code (gws recipe)

Has your assistant save a Gmail message body into a Google Doc for archive or reference, using the gws command line.

Installs
30.7K
on skills.sh
Stars
32K
on GitHub
Updated
Oct 2026
last repo commit

This is a four-step recipe from the googleworkspace/cli repo. It finds a Gmail message with a search, reads its content, creates a Google Doc and writes the sender, subject and body into it.

It loads gws-gmail and gws-docs first and runs the gws program for every step. The search terms, title and sender in the recipe are placeholders.

Step 2 returns the message through messages get, and the recipe has no command that pulls out the body text. The assistant has to read the response and put the text where the example says [EMAIL BODY] in step 4. Step 4 uses gws docs +write, which gws-docs-write describes as appending plain text, and it writes --document-id where gws-docs-write documents --document.

Good for

  • People who keep important emails as documents
  • People whose AI assistant can already run terminal commands and who use the gws command line

Install recipe-save-email-to-doc

Claude Code

  1. 1

    Copy this prompt.

    Install the recipe-save-email-to-doc skill in Claude Code. Run this command:
    
    npx skills add https://github.com/googleworkspace/cli --skill recipe-save-email-to-doc --skill gws-gmail --skill gws-docs --skill gws-shared
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

This installs 4 skills: the recipe, the gws skills it loads (gws-gmail, gws-docs) and gws-shared, which those skills tell the agent to read for sign-in and safety rules. The skills only wrap the gws program, so install gws first and sign in once with gws auth login. The README says an unverified Google app limits consent to about 25 scopes, so choose only the services you need when you sign in.

From the vendor's docs. Source.

What's in the skill

When it loads

Save a Gmail message body into a Google Doc for archival or reference.

Sections in SKILL.md

  1. Steps

Key facts

License
Apache-2.0
Installs on skills.sh
30,703 (Nov 2, 2026)

What it includes

  • Lists messages that match a Gmail search

    Runs a messages list with a query such as subject:important from:boss@company.com and prints a table.

    Try: “Find the email from my boss with Important in the subject.”

    Network · Find the message

  • Reads one message by its ID

    Runs a messages get for the ID, which returns the message for the assistant to read.

    Try: “Open that email.”

    Network · Get message content

  • Creates an empty Google Doc with a title

    Runs a Docs documents create, for example titled Saved Email - Important Update.

    Try: “Create a doc called Saved Email - Important Update.”

    Write · Create a doc

  • Appends From, Subject and the body to the doc

    Appends the sender, subject and body text to the new doc as plain text. The example has a [EMAIL BODY] placeholder that the assistant fills from the message it read.

    Try: “Write the email into the doc.”

    Write · Write the email body

From the official docs

Permissions

Medium risk

The assistant can read a Gmail message and write its text into a new Google Doc. Pick the message yourself and keep the doc private.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • Email text is copied into a Google Doc

    Steps 2 to 4 read a message and write its body into a new doc. Check who can open the doc before you pass it on. github.com

  • Message content passes through your assistant's provider

    The assistant reads the full message to write it into the doc. Pick messages you are fine sharing with it. github.com

  • Needs the gws program and a Google sign-in first

    The skill only wraps the gws command line. Install gws and run its sign-in before the first use, as the README describes. github.com

Technical details
Turning on read-onlyThe skill has no read-only switch. gws-shared tells the agent to confirm write and delete commands with you and to prefer --dry-run for destructive operations. You can also sign in with only the services you need.
Talks toGoogle Workspace APIs, through the gws program
Sign-in and keysgws keeps your Google sign-in encrypted on your machine, with the key in your operating system keyring, per the README.

Questions

What does the recipe-save-email-to-doc skill do?

It tells your assistant how to save a Gmail message into a new Google Doc. All steps run through the gws command line.

How do I install it?

Use the install box above. It installs this recipe, the gws skills it loads and gws-shared. The gws program itself is a separate install, and you sign in to Google once before the first run.

Do I need an API key?

No key is named in the skill. You need the gws program and a Google account with access to Google Workspace. The README says gws needs a Google Cloud project for OAuth sign-in credentials. gws auth setup creates one but requires the gcloud CLI, so without gcloud you set up OAuth by hand in the Cloud Console.

Does it work in the Claude app or ChatGPT?

The repo documents no route for them. The skill's steps are gws shell commands, so you need an assistant that can run commands on your computer, such as a coding agent.

Does it save attachments?

The recipe writes the message body only. It does not mention attachments.

Will the commands run as written?

Check the flag names. The recipe writes gws docs +write --document-id DOC_ID, while gws-docs-write documents the flag as --document. If the command errors, use the documented one. The search terms, title and sender are examples to replace.

Is it safe?

It reads one message and creates one doc in your Drive. Pick the message yourself. The skill bundles no scripts of its own.

Is this an official Google skill?

No. The README says gws is not an officially supported Google product, although the repo sits under the googleworkspace GitHub organization.

How is it different from the other Gmail and doc recipes?

It copies the text of one message into a new Doc. recipe-save-email-attachments saves attachments into Drive instead. recipe-draft-email-from-doc goes the other way, reading a Doc and sending its text as an email. recipe-forward-labeled-emails sends labelled messages on to another address.

Information

updated Nov 2, 2026

Folder
skills/recipe-save-email-to-doc

googleworkspace/cliskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 11
  1. googleworkspace/cli README · github.com
  2. recipe-save-email-to-doc SKILL.md · github.com
  3. gws-drive SKILL.md · github.com
  4. skills CLI commands · github.com
  5. gws-docs-write SKILL.md · github.com
  6. recipe-save-email-attachments SKILL.md · github.com
  7. recipe-draft-email-from-doc SKILL.md · github.com
  8. recipe-forward-labeled-emails SKILL.md · github.com
  9. googleworkspace/cli LICENSE · github.com
  10. recipe-save-email-to-doc on skills.sh · skills.sh
  11. gws-shared SKILL.md · github.com

Updated Nov 2, 2026.