Any agentic tool with shell access can use Bashy for Gmail. google is a custom Bash# command wrapping the managed gws CLI, not a built-in Gmail integration.
- Fetch the release source with
bashy src fetch bashy. If itsexamples/googledirectory is present, run itsregister.shthrough Bashy, then readbashy google --help. Check existing authentication before creating anything. - Establish the intended Google account, Cloud project, and test recipient. Run
bashy gws auth setup --project PROJECTinteractively to select Gmail alone. Configure a Desktop OAuth client; for an External app in Testing, save the account as a test user and verify it appears before login. - Import the downloaded client JSON with
bashy google auth-import CLIENT_JSON account=ACCOUNT scopes=gmail --no-login. SetGOOGLE_WORKSPACE_CLI_CONFIG_DIRto the per-account directory reported by import. Runbashy gws auth login --scopes SCOPE_URLSwith explicitgmail.sendandgmail.readonlyscope URLs for sending and verification. - The wrapper expects an authorized-user JSON file. Export with
gws auth export --unmaskeddirectly into an owner-only temporary file, then usegoogle auth-importon that file. Never print tokens or paste secrets into arguments, chat, or public notes; remove temporary credential files afterward.
If the wrapper reports GWS_NOT_FOUND although bashy gws works, its native subprocess cannot resolve Bashy’s managed command. Locate the installed executable and configure GWS_BIN through bashy commands set google --set "env.0=GWS_BIN=GWS_PATH" (choose an unused environment slot). Recheck that binding after upgrades; do not hardcode another machine’s cache path.
Send only the authorized test:
bashy google gmail-send account=ACCOUNT to=RECIPIENT subject='Bashy test' body='Gmail setup test.'
bashy google raw gmail users messages get account=ACCOUNT userId=me id=MESSAGE_ID format=metadata
Retain the returned message ID. Verify actual From, To, Subject and labels: SENT confirms sending; INBOX confirms arrival for a self-test. Gmail can use a default sender alias rather than the authenticated address. Inspect that result and report it accurately; avoid duplicate sends when verification is uncertain.