gws-docs
googleworkspace/cli
Read and write Google Docs via command line.
What is gws-docs?
Access Google Docs programmatically through the gws CLI. Create documents, retrieve content, and apply batch updates to automate document workflows.
- Create blank Google Docs with custom titles
- Retrieve the latest version of any document
- Apply batch updates to documents with validation
- Append text to documents via the write helper command
- Inspect API schemas to discover available methods and parameters
How to install gws-docs
npx skills add null --skill gws-docs- gws CLI installed and configured
- Google Workspace authentication set up (see gws-shared SKILL.md)
- Appropriate Google Docs API permissions
How to use gws-docs
- 1.Run `gws docs --help` to browse available resources and methods
- 2.Use `gws schema docs.<resource>.<method>` to inspect required parameters and types
- 3.Build your command with `--params` or `--json` flags based on the schema output
- 4.Execute `gws docs <resource> <method> [flags]` with your parameters
- 5.For appending text, use the `+write` helper command documented in gws-docs-write
Use cases
- Automatically generate and populate Google Docs from data or templates
- Retrieve document content for processing or analysis
- Batch update multiple sections of a document in a single operation
- Append logs or results to a shared document programmatically
- Integrate document creation into multi-step workflows
- Automation engineers
- Workflow developers
- Google Workspace administrators
- Teams automating document generation
gws-docs FAQ
Google Workspace authentication must be configured. See the gws-shared SKILL.md for setup instructions and security rules.
Yes, use the `batchUpdate` method to apply multiple updates in a single request. All updates are validated before being applied.
Run `gws schema docs.<resource>.<method>` to inspect the required parameters, their types, and defaults.
Yes, use the `+write` helper command (gws-docs-write) which is specifically designed for appending text.
Full instructions (SKILL.md)
Source of truth, from googleworkspace/cli.
name: gws-docs description: "Read and write Google Docs." metadata: version: 0.22.5 openclaw: category: "productivity" requires: bins: - gws cliHelp: "gws docs --help"
docs (v1)
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
gws docs <resource> <method> [flags]
Helper Commands
| Command | Description |
|---|---|
+write | Append text to a document |
API Resources
documents
batchUpdate— Applies one or more updates to the document. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests.create— Creates a blank document using the title given in the request. Other fields in the request, including any provided content, are ignored. Returns the created document.get— Gets the latest version of the specified document.
Discovering Commands
Before calling any API method, inspect it:
# Browse resources and methods
gws docs --help
# Inspect a method's required params, types, and defaults
gws schema docs.<resource>.<method>
Use gws schema output to build your --params and --json flags.
Related skills
More from googleworkspace/cli and the wider catalog.
gws-gmail
Send, read, and manage Gmail emails via Google Workspace CLI.
gws-drive
Manage Google Drive files, folders, and shared drives via CLI.
gws-calendar
Manage Google Calendar events, calendars, and access control via CLI.
gws-sheets
Read and write Google Sheets spreadsheets via CLI.
gws-gmail-send
Send emails via Gmail with attachments, CC/BCC, HTML support, and draft options.
gws-docs-write
Append plain text to the end of a Google Docs document.