Skip to content

feat: add clasp chat command to configure Chat apps via Workspace Add-ons API - #1180

Open
vinay-google wants to merge 2 commits into
masterfrom
feat/chat-app-config
Open

vinay-google wants to merge 2 commits into
masterfrom
feat/chat-app-config

Conversation

@vinay-google

Copy link
Copy Markdown
Collaborator

Summary

Adds support for configuring Google Chat apps (built as Google Workspace add-ons) using the Google Workspace Add-ons API (gsuiteaddons.googleapis.com/v1/projects/{project}/chatAppConfig).

Design & Manifest Compatibility

  • Apps Script's script.projects.updateContent (clasp push) strictly validates appsscript.json against google.apps.script.type.ScriptManifest, where addOns.chat (ChatAddOnManifest) only supports addToSpaceFallbackMessage and chatAddon.
  • To avoid breaking clasp push, Chat app configuration (ChatAppConfig) is stored in a dedicated chatapp.json file alongside appsscript.json (which is ignored by default .claspignore).
  • When pushing chatapp.json via clasp chat push / clasp chat update, clasp automatically falls back to addOns.common.name and addOns.common.logoUrl from appsscript.json if displayName or avatarUri are omitted.

Commands Added

  • clasp chat get [--view <BASIC|FULL>] [--json] — Retrieves and prints the project's ChatAppConfig.
  • clasp chat pull [--file <file>] [--view <BASIC|FULL>] — Fetches ChatAppConfig and writes it to chatapp.json (or --file).
  • clasp chat push [--file <file>] [--updateMask <mask>] (alias update) — Updates ChatAppConfig from chatapp.json (or --file).
  • clasp chat --open — Opens the Google Chat API Configuration page in the Google Cloud Console.

Testing

  • npm run compile (tsc)
  • npm run check (gts check)
  • npx mocha --cache false build/test/chatapp.js (8 passing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant