gws-best-practices
Skill4 starsChanged 6 months agoMITView on GitHub
Best practices for using the gws CLI with supported Google Workspace services (Drive, Docs, Sheets, Slides). Use when performing any operation with the gws CLI.
In this repository30 other files it gives its agents.
- ad-copywriterSkill
- automated-video-editorSkill
- canva-mcpSkill
- challenge-campaign-operatorSkill
- creative-strategistSkill
- daily-growth-operatorSkill
- funnel-junkies-video-publisherSkill
- funnel-message-match-auditorSkill
- ghl-funnel-inspectorSkill
- landing-page-cro-analystSkill
- manus-apiSkill
- meta-ads-analyzerSkill
- meta-ads-campaign-auditorSkill
- meta-ads-performance-analystSkill
- meta-ads-social-schedulerSkill
- meta-live-campaign-launch-operatorSkill
- meta-paid-ads-challenge-operatorSkill
- meta-safe-campaign-builderSkill
- music-prompterSkill
- performance-reportingSkill
- persistent-computingSkill
- qualified-lead-scoringSkill
- skill-creatorSkill
- social-media-content-dashboardSkill
- split-test-evaluatorSkill
- vanx-meta-purchase-repairSkill
- vanx-social-plannerSkill
- video-generatorSkill
- weekly-content-operatorSkill
- workshop-workbook-builderSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Only the following services are currently available and pre-configured:
- Distinctive: line 19
All other services (Gmail, Calendar, Tasks, Chat, etc.) are not available.
- Very specific: line 23
When tasked with creating a Google Doc, you MUST follow this workflow instead of using gws docs commands directly:
- Very specific: line 25
Install python-docx: Run sudo pip3 install python-docx if it's not already installed.
- Very specific: line 26
Generate the Document Locally: Write a Python script using the python-docx library to create and format the document.
- Very specific: line 27
Upload and Convert: Use the gws drive files create command to upload the generated .docx file and automatically convert it to a Google Doc.
- Very specific: line 45
Instead, use gws commands to interact with these resources.
- Very specific: line 49
When inserting text into Google Slides via gws slides presentations batchUpdate, the API interprets newline characters in specific ways.
- Very specific: line 62
Rule: Use \n for new paragraphs/bullet points.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gws CLI Best Practices
Critical guidelines for using the gws command-line interface. Follow these rules to prevent common errors and protect user data.
Supported Services
Only the following services are currently available and pre-configured:
- Drive — file and folder operations
- Docs — For creating new documents, use
python-docxto generate.docxlocally, then upload viagws drive files create. For modifying existing Google Docs, usegws docs documents batchUpdateto edit in-place — this is the ONLY way to preserve comments, suggestions, and other Google-specific features. - Sheets — spreadsheet read/write
- Slides — presentation read/write
All other services (Gmail, Calendar, Tasks, Chat, etc.) are not available. Do NOT attempt to use them.
Creating and Uploading Google Docs
When tasked with creating a Google Doc, you MUST follow this workflow instead of using gws docs commands directly:
- Install python-docx: Run
sudo pip3 install python-docxif it's not already installed. - Generate the Document Locally: Write a Python script using the
python-docxlibrary to create and format the document. This allows for rich formatting like headings, bold/italic text, bullet points, and tables. - Upload and Convert: Use the
gws drive files createcommand to upload the generated.docxfile and automatically convert it to a Google Doc.
Example Upload Command:
gws drive files create \
--upload /home/ubuntu/your_document.docx \
--json '{"name": "Your Document Title", "mimeType": "application/vnd.google-apps.document"}' \
--upload-content-type "application/vnd.openxmlformats-officedocument.wordprocessingml.document"Note: Setting mimeType to application/vnd.google-apps.document in the JSON payload is critical as it triggers the automatic conversion from .docx to Google Docs format.
The command will return a JSON response containing the file id. You can construct the Google Doc link using this ID: https://docs.google.com/document/d/{id}/edit.
Interacting with Google Drive Links
Do NOT use the browser to open Google Drive, Docs, Sheets, or Slides links (e.g., https://docs.google.com/...). The browser environment may not be logged into the correct Google account and will likely fail to access the file.
Instead, use gws commands to interact with these resources. To view content, use the appropriate get or export command (e.g., gws drive export).
Text Formatting in Google Slides: \n vs. \v
When inserting text into Google Slides via gws slides presentations batchUpdate, the API interprets newline characters in specific ways. Using the correct character is critical for proper formatting.
| Input String | API Interpretation | Visual Result in Slides |
First\nSecond | Two separate paragraphs | First<br/>Second (like pressing Enter) |
First\vSecond | A single paragraph with a vertical tab (\x0b) character | First<br/>Second (like pressing Shift+Enter) |
First\n\nSecond | Three paragraphs, with the middle one being empty | First<br/><br/>Second (a blank line between paragraphs) |
Technical Explanation
\n(Newline): The API translates each\ninto a newparagraphMarker. Therefore,AAA\nBBBresults in two distinct paragraphs.AAA\n\nBBBresults in three paragraphs, with the middle one being empty, creating a visible blank line.\v(Vertical Tab, or\u000b): The API treats this as a special character within a singletextRun. It does not create a new paragraph. It renders as a soft line break, which is useful for multi-line text that should belong to the same bullet point or paragraph block.
Rule: Use \n for new paragraphs/bullet points. Use \v for line breaks within a single paragraph/bullet point.
Prohibition of Permanent Deletion
CRITICAL: Do NOT execute any gws command that permanently deletes user data — ever.
This includes permanently deleting files, slides, presentations, emails, calendar events, or any other resource. Always use trash/archive operations instead. Permanent deletion is irreversible and can cause catastrophic data loss. Even if the user asks for deletion, prefer moving to trash first and confirm explicitly before proceeding. Never use permanent deletion.
Discovering Available Skills
On first use or after updating the CLI, run the following once to generate local skill documentation:
gws generate-skillsThis produces skill directories under skills/ and an index at docs/skills.md. Read the generated index and individual skill files to learn about available commands, services, recipes, and workflows.
Note: For Google Docs creation, do NOT search for or rely on generated docs skills. Always use the python-docx workflow described above.
Updating the CLI
To update the gws CLI to the latest version:
pnpm update -g @googleworkspace/cliDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

