Skip to content

Commit 6bb153e

Browse files
authored
feat: add Google Workspace CLI (gws) to setup and auto-update (#5083)
Install gws (@googleworkspace/cli) during setup for Gmail, Calendar, Drive, Sheets, Docs, and all Workspace API access. Used by Email, Business, and Accounts agents. - setup-modules/tool-install.sh: new setup_google_workspace_cli() - setup.sh: wired into interactive setup flow - tool-version-check.sh: added to npm tools for auto-update freshness
1 parent 14d4dc9 commit 6bb153e

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.agents/scripts/tool-version-check.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ NPM_TOOLS=(
7979
"npm|Playwriter MCP|playwriter|--version|playwriter|npm install -g playwriter@latest"
8080
"npm|macOS Automator MCP|macos-automator-mcp|--version|@steipete/macos-automator-mcp|npm install -g @steipete/macos-automator-mcp@latest"
8181
"npm|Claude Code MCP|claude-code-mcp|--version|@steipete/claude-code-mcp|npm install -g @steipete/claude-code-mcp@latest"
82+
"npm|Google Workspace CLI|gws|--version|@googleworkspace/cli|npm install -g @googleworkspace/cli@latest"
8283
)
8384

8485
BREW_TOOLS=(

setup-modules/tool-install.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,60 @@ setup_opencode_cli() {
12731273
return 0
12741274
}
12751275

1276+
setup_google_workspace_cli() {
1277+
print_info "Setting up Google Workspace CLI (gws)..."
1278+
1279+
# Check if gws is already installed
1280+
if command -v gws >/dev/null 2>&1; then
1281+
local gws_version
1282+
gws_version=$(gws --version 2>/dev/null | head -1 || echo "unknown")
1283+
print_success "Google Workspace CLI already installed: $gws_version"
1284+
return 0
1285+
fi
1286+
1287+
# Need either bun or npm to install
1288+
local installer=""
1289+
local install_pkg="@googleworkspace/cli@latest"
1290+
1291+
if command -v bun >/dev/null 2>&1; then
1292+
installer="bun"
1293+
elif command -v npm >/dev/null 2>&1; then
1294+
installer="npm"
1295+
else
1296+
print_warning "Neither bun nor npm found - cannot install gws"
1297+
print_info "Install Node.js first, then re-run setup"
1298+
return 0
1299+
fi
1300+
1301+
print_info "Google Workspace CLI provides Gmail, Calendar, Drive, and all Workspace APIs"
1302+
echo " Used by Email, Business, and Accounts agents for Google Workspace integration."
1303+
echo ""
1304+
1305+
local install_gws="Y"
1306+
if [[ "$NON_INTERACTIVE" != "true" ]]; then
1307+
read -r -p "Install Google Workspace CLI via $installer? [Y/n]: " install_gws || install_gws="Y"
1308+
fi
1309+
if [[ "$install_gws" =~ ^[Yy]?$ ]]; then
1310+
if run_with_spinner "Installing Google Workspace CLI" npm_global_install "$install_pkg"; then
1311+
print_success "Google Workspace CLI installed"
1312+
1313+
echo ""
1314+
print_info "Authentication required before use."
1315+
print_info "Run 'gws auth setup' to authenticate with your Google account."
1316+
print_info "For headless use: set GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE"
1317+
echo ""
1318+
else
1319+
print_warning "Google Workspace CLI installation failed"
1320+
print_info "Try manually: sudo npm install -g $install_pkg"
1321+
fi
1322+
else
1323+
print_info "Skipped Google Workspace CLI installation"
1324+
print_info "Install later: $installer install -g $install_pkg"
1325+
fi
1326+
1327+
return 0
1328+
}
1329+
12761330
setup_orbstack_vm() {
12771331
# Only available on macOS
12781332
if [[ "$(uname)" != "Darwin" ]]; then

setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ main() {
822822
confirm_step "Setup QuickFile MCP (UK accounting)" && setup_quickfile_mcp
823823
confirm_step "Setup browser automation tools" && setup_browser_tools
824824
confirm_step "Setup AI orchestration frameworks info" && setup_ai_orchestration
825+
confirm_step "Setup Google Workspace CLI (Gmail, Calendar, Drive)" && setup_google_workspace_cli
825826
confirm_step "Setup OpenCode CLI (AI coding tool)" && setup_opencode_cli
826827
confirm_step "Setup OpenCode plugins" && setup_opencode_plugins
827828
# Run AFTER OpenCode CLI install so opencode.json may exist for agent config

0 commit comments

Comments
 (0)