PlugWiki

Create a Google Doc from a Template with Claude Code (gws recipe)

Has your assistant copy a Google Docs template, write content into the copy and share it with collaborators, using the gws command line.

Installs
31K
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 copies a template doc, takes the new doc's ID from the response, writes text into it and shares it with a collaborator.

It loads gws-drive and gws-docs first and runs the gws program for every step. The template ID, title, text and email address in the recipe are placeholders for your own.

Step 3 uses gws docs +write, which gws-docs-write describes as appending plain text at the end of the document. It does not find and replace text inside your template, and the Markdown marks in the recipe's example are not turned into headings. The recipe also writes --document-id where gws-docs-write documents --document.

Good for

  • Teams that start every project from the same Google Docs template
  • People whose AI assistant can already run terminal commands and who use the gws command line

Install recipe-create-doc-from-template

Claude Code

  1. 1

    Copy this prompt.

    Install the recipe-create-doc-from-template skill in Claude Code. Run this command:
    
    npx skills add https://github.com/googleworkspace/cli --skill recipe-create-doc-from-template --skill gws-drive --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-drive, 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

Copy a Google Docs template, fill in content, and share with collaborators.

Sections in SKILL.md

  1. Steps
  2. Objective

Key facts

License
Apache-2.0
Installs on skills.sh
31,044 (Nov 2, 2026)

What it includes

  • Copies a template doc under a new name

    Runs a Drive files copy on the template's file ID and names the copy, for example Project Brief - Q2 Launch.

    Try: “Copy my Q2 brief template and name it Project Brief - Q2 Launch.”

    Write · Copy the template

  • Reads the new document's ID from the response

    The copy step returns the new file's ID. The agent keeps it for the next two steps.

    Read · Get the new doc ID

  • Appends text to the end of the new doc

    Appends the text you give to the end of the new doc as plain text, with gws docs +write. The recipe's example is a short Markdown-style outline, which goes in as written.

    Try: “Write the project objective and milestones into the new doc.”

    Write · Add content

  • Gives a person writer access to the new doc

    Creates a Drive permission with role writer for the email address you give.

    Try: “Share the new doc with team@company.com as an editor.”

    Write · Share with the team

From the official docs

Permissions

Medium risk

The assistant can create a document in your Drive and share it with another person. Read the share step and the email address before you approve it.

What it can do

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

Watch out for

  • It shares the new doc with someone you name

    Step 4 gives a person writer access to the new document. Check the email address before you approve it. github.com

  • It creates a new file in your Drive

    Step 1 copies the template and step 3 writes text into the copy. 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-create-doc-from-template skill do?

It tells your assistant how to copy a Google Docs template, fill the copy in and share it. 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 fill in placeholders in my template?

No. gws docs +write appends plain text to the end of the document. It does not find and replace text inside the template, and ## marks stay as typed. For rich formatting, gws-docs-write points to the raw batchUpdate API.

Will the commands run as written?

Check the flag names. The recipe writes gws docs +write --document-id NEW_DOC_ID, while gws-docs-write documents the flag as --document. If the command errors, use the documented one. The title, text and email address are examples to replace.

Is it safe?

It creates a file in your Drive and shares it with the address you give. Check that address before approving the last step. The skill bundles no scripts of its own.

Do I need to change the example text?

Yes. The title, project text and email address in the recipe are examples, so give the assistant your own template ID, content and recipients.

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 doc recipes?

It starts from a copy of a doc you already have. recipe-generate-report-from-sheet creates a blank doc and fills it from Sheet data. recipe-share-doc-and-notify shares a doc that exists and emails the link. recipe-draft-email-from-doc reads a doc and puts its text into an email. This recipe shares the copy with gws drive permissions create and has no email step.

Information

updated Nov 2, 2026

Folder
skills/recipe-create-doc-from-template

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-create-doc-from-template 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-generate-report-from-sheet SKILL.md · github.com
  7. recipe-share-doc-and-notify SKILL.md · github.com
  8. recipe-draft-email-from-doc SKILL.md · github.com
  9. googleworkspace/cli LICENSE · github.com
  10. recipe-create-doc-from-template on skills.sh · skills.sh
  11. gws-shared SKILL.md · github.com

Updated Nov 2, 2026.