diff --git a/.changeset/gemini-extension-update.md b/.changeset/gemini-extension-update.md new file mode 100644 index 00000000..70c14852 --- /dev/null +++ b/.changeset/gemini-extension-update.md @@ -0,0 +1,5 @@ +--- +"@googleworkspace/cli": patch +--- + +Fix Gemini extension installation issue by removing redundant authentication settings and update the documentation. diff --git a/CONTEXT.md b/CONTEXT.md index 546ef9d6..8a0b03b4 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -2,6 +2,12 @@ The `gws` CLI provides dynamic access to Google Workspace APIs (Drive, Gmail, Calendar, Sheets, Admin, etc.) by parsing Discovery Documents at runtime. +## Rules of Engagement for Agents + +* **Schema Discovery:** *If you don't know the exact JSON payload structure, run `gws schema .` first to inspect the schema before executing.* +* **Context Window Protection:** *Workspace APIs (like Drive and Gmail) return massive JSON blobs. ALWAYS use field masks when listing or getting resources by appending `--params '{"fields": "id,name"}'` to avoid overwhelming your context window.* +* **Dry-Run Safety:** *Always use the `--dry-run` flag for mutating operations (create, update, delete) to validate your JSON payload before actual execution.* + ## Core Syntax ```bash diff --git a/README.md b/README.md index 037369f8..51f6a942 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,20 @@ The `gws-shared` skill includes an `install` block so OpenClaw auto-installs the +## Gemini CLI Extension + +1. Authenticate the CLI first: + ```bash + gws setup + ``` + +2. Install the extension into the Gemini CLI: + ```bash + gemini extensions install https://github.com/googleworkspace/cli + ``` + +Installing this extension gives your Gemini CLI agent direct access to all `gws` commands and Google Workspace agent skills. Because `gws` handles its own authentication securely, you simply need to authenticate your terminal once prior to using the agent, and the extension will automatically inherit your credentials. + ## Advanced Usage ### Multipart Uploads diff --git a/gemini-extension.json b/gemini-extension.json index 2c314f20..2bc68002 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -2,37 +2,5 @@ "name": "google-workspace-cli", "version": "latest", "description": "CLI tool for managing Google Workspace resources dynamically using Discovery APIs.", - "contextFileName": "CONTEXT.md", - "settings": [ - { - "name": "Credentials File", - "description": "Path to the Google Workspace authorized user credentials or service account JSON file.", - "envVar": "GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE", - "sensitive": false - }, - { - "name": "OAuth Client ID", - "description": "Client ID for OAuth authentication.", - "envVar": "GOOGLE_WORKSPACE_CLI_CLIENT_ID", - "sensitive": false - }, - { - "name": "OAuth Client Secret", - "description": "Client Secret for OAuth authentication.", - "envVar": "GOOGLE_WORKSPACE_CLI_CLIENT_SECRET", - "sensitive": true - }, - { - "name": "Sanitize Template", - "description": "Resource name of the Model Armor template to use for sanitization (e.g., projects/P/locations/L/templates/T).", - "envVar": "GOOGLE_WORKSPACE_CLI_SANITIZE_TEMPLATE", - "sensitive": false - }, - { - "name": "Impersonated User", - "description": "Email address of the user to impersonate (requires Domain-Wide Delegation).", - "envVar": "GOOGLE_WORKSPACE_CLI_IMPERSONATED_USER", - "sensitive": false - } - ] + "contextFileName": "CONTEXT.md" }