Skip to main content
Use Google Drive, Sheets, Docs, Slides, Calendar, Forms and Gmail through one command tree. Mirage implements a subset of the Google Workspace CLI (gws), with selected API methods and helpers for mail, spreadsheet ranges and document text.

Setup

Use Google Workspace setup to obtain OAuth credentials and the scopes needed by each service.
No service mount is required. For YAML and multiple accounts, see the CLI overview.

Supported commands

Run gws <command> --help for the supported flags and operands. This list is generated from Mirage’s registered command tree.

Call an API method

The form is gws SERVICE RESOURCE METHOD. --params supplies URL path and query parameters; --json supplies the body. Methods return the API response as compact JSON. Lists follow nextPageToken by default and print multiple pages as NDJSON. Use --page-limit N to stop early. Export methods can return raw bytes instead of JSON. The supported methods are the registered subset above, not every method in Google’s Discovery documents.

Use helpers

Helpers omit the upstream CLI’s + prefix: use gws docs write, not gws docs +write. --tab is Mirage’s addition for document tabs.

Choose a document tab

gws docs documents get --params '{"documentId":"DOC_ID"}' returns the legacy body of the first tab. Add "includeTabsContent":true to receive tabs[].documentTab, including nested childTabs, instead of that flat body. Mounted .gdoc.json files always use the tab-aware shape. docs write appends to the first tab unless --tab selects another one. A raw batchUpdate follows the API’s defaults: replaceAllText without a tab restriction can affect every tab.

VFS, folder placement and limits

The CLI can share GoogleConfig with Google’s VFS adapters. Each registration owns its config and requires no mount. Setting folder_id (folderId in TypeScript) changes creation placement, not which files the CLI may read:
  • Drive files create and copy default parents to that folder.
  • An explicit parents array wins, including an empty array.
  • Docs, Sheets and Slides creation is followed by a Drive move into the folder. These are separate requests, so a failed move can leave the new file created.
  • Injected placement requests include Shared Drive support.
Reads still reach the whole account allowed by the credential. Use command policy to restrict operations; a mounted folder is not a CLI access boundary. Mirage registers a fixed command subset; upstream builds commands from Google Discovery at runtime. Folder placement and helper spelling also differ, and the host config supplies credentials instead of an interactive login. Mirage paginates list methods by default; upstream requires --page-all. Parser refusals use Mirage’s declared command style, so upstream exit codes and diagnostics are not a blanket compatibility promise. The original gws is Apache-2.0 licensed. Mirage’s command implementation is also Apache-2.0; see compatibility and licenses.