TIMEWELL
Solutions
Free ConsultationContact Us
TIMEWELL

Unleashing organizational potential with AI

ISO/IEC 27001 (ISMS) certification mark (SGS / ISMS-AC)

ISO/IEC 27001:2022 certified Certificate No. JP26/00000255 Scope: Planning, development and operation of SaaS products utilizing AI technology

Services

  • ZEROCK
  • TRAFEED
  • TIMEWELL BASE
  • WARP
  • WARP 1Day
  • WARP NEXT Corporate
  • WARP BASIC
  • WARP ENTRE
  • Alumni Salon
  • WARP for Schools
  • Alumni Ventures
  • FDE
  • AI Consulting
  • EMC GLOBAL

Company

  • About Us
  • Team
  • Why TIMEWELL
  • News
  • Contact
  • Free Consultation

Content

  • Insights
  • Knowledge Base
  • Case Studies
  • Whitepapers
  • Events
  • Solutions
  • AI Readiness Check
  • ROI Calculator

Legal

  • Privacy Policy
  • Manual Creator Extension
  • WARP Terms of Service
  • WARP NEXT School Rules
  • Legal Notice
  • Security
  • Anti-Social Policy
  • ZEROCK Terms of Service
  • TIMEWELL BASE Terms of Service

Newsletter

Get the latest AI and DX insights delivered weekly

Your email will only be used for newsletter delivery.

© 2026 株式会社TIMEWELL All rights reserved.

Contact Us
HomeColumnsテックトレンドThe Revolutionary CLI That Changes How You Use Google Workspace: A Deep Dive into 'gog' and AI-Powered Workflows
テックトレンド

The Revolutionary CLI That Changes How You Use Google Workspace: A Deep Dive into 'gog' and AI-Powered Workflows

Published2026-01-26Updated2026-10-04Ryuta Hamamoto
Google WorkspaceCLIgogAutomationAI AgentsProductivityDeveloper Tools

"gog" is a command-line interface for Google Workspace that enables scripting, automation, and AI agent integration across Gmail, Calendar, Drive, and Docs.

The Revolutionary CLI That Changes How You Use Google Workspace: A Deep Dive into 'gog' and AI-Powered Workflows
Share

What gog Is

gog (Google Operations Gateway) is an open-source command-line interface that provides programmatic access to Google Workspace services from the terminal. It supports Gmail, Google Calendar, Google Drive, Google Docs, Google Sheets, and Google Meet.

For users who are comfortable in a terminal environment, gog changes the way Google Workspace can be used. Instead of navigating between browser tabs and clicking through interfaces, you can compose, query, and automate across all Google services from a single command-line session.

More importantly for the current AI moment: gog exposes Google Workspace operations as commands that AI agents can call, making it possible to integrate Google Workspace into agentic workflows without writing custom API integration code for each service.

Why This Matters for AI Workflows

The typical AI assistant integration with Google Workspace works through browser automation or API wrappers that need to be configured per application. gog provides a unified interface that any tool capable of running shell commands — including Claude Code, OpenClaw, and similar AI agent frameworks — can use without additional configuration.

This is a significant practical simplification. An AI agent that needs to read emails, check calendar availability, and create a document can do all three through gog commands without requiring separate integration points for each service.

Take AI-driven development all the way to production

WARP is a hands-on program for teams who want more than headlines. Former enterprise DX and data strategy leads work alongside you until it runs.

Book a Free ConsultationExplore WARP

Installation and Setup

Requirements

  • Python 3.9 or later
  • A Google account with Google Workspace (or standard Google account)
  • Google Cloud Console access for OAuth credentials

Installing gog

pip install gog-workspace

Initial Configuration

The first time you run gog, it will walk you through OAuth authentication:

gog auth login

This opens a browser window for Google authentication. After granting permissions, credentials are stored locally for subsequent sessions.

To verify the connection:

gog status

Core Commands

Gmail

# List unread emails
gog gmail list --unread

# Search emails
gog gmail search "from:boss@company.com subject:quarterly report"

# Read a specific email
gog gmail read <email-id>

# Send an email
gog gmail send --to "colleague@company.com" --subject "Update" --body "Here's the update..."

# Reply to an email
gog gmail reply <email-id> --body "Thanks for the information."

Calendar

# Show today's events
gog calendar list --today

# Show events for a date range
gog calendar list --from 2026-02-01 --to 2026-02-07

# Create a new event
gog calendar create --title "Project Review" --start "2026-02-10T14:00" --end "2026-02-10T15:00" --attendees "team@company.com"

# Find free time
gog calendar freetime --date 2026-02-10 --duration 60

Google Drive

# List files
gog drive list --folder "Projects"

# Search files
gog drive search "quarterly report"

# Download a file
gog drive download <file-id> --output ./local-copy.pdf

# Upload a file
gog drive upload ./document.pdf --folder "Shared"

Google Docs

# Create a new document
gog docs create --title "Meeting Notes" --content "## Attendees\n\n## Discussion"

# Read document content
gog docs read <doc-id>

# Append to a document
gog docs append <doc-id> --content "\n## Action Items\n- Item 1"

AI Agent Integration

The most powerful use case for gog is integration with AI agents. Here is an example of how this works with Claude Code:

Add the following to your CLAUDE.md:

## Available Tools

You have access to Google Workspace through the `gog` command:
- `gog gmail` — read and send emails
- `gog calendar` — view and create calendar events
- `gog drive` — access Google Drive files
- `gog docs` — create and edit Google Docs

Use these when the user asks about their emails, calendar, or files.

Once configured, Claude Code can execute gog commands directly:

User: "What meetings do I have tomorrow?"
Claude Code: [runs `gog calendar list --date 2026-02-11`]
Also read"It's API, MCP, and CLI from Here On" — What It Takes for Software to Survive the AI Agent Era

Automation Examples

Daily Digest

A shell script that generates a morning summary:

#!/bin/bash
echo "## Daily Digest - $(date +%Y-%m-%d)"
echo ""
echo "### Unread Emails"
gog gmail list --unread --format=summary | head -10
echo ""
echo "### Today's Calendar"
gog calendar list --today

Scheduled Email Summary

Using cron to send a weekly email summary:

# Run every Friday at 5 PM
0 17 * * 5 /usr/local/bin/gog gmail list --from "$(date -d '7 days ago' +%Y-%m-%d)" --format=json | python3 summarize.py | gog gmail send --to "me@company.com" --subject "Weekly Email Summary"

Security Notes

gog stores OAuth tokens locally in ~/.gog/credentials.json. Protect this file:

chmod 600 ~/.gog/credentials.json

Review what permissions you granted during setup and revoke access you do not need through your Google Account settings at myaccount.google.com/permissions.

For enterprise use, consider whether storing credentials on individual developer machines is appropriate for your security policy, or whether a service account with scoped permissions is more appropriate.


Related Articles

  • Antigravity × Google Workspace Integration: Setup and Usage Guide
  • Mac-Only: Complete Guide to Obsidian × Google Drive × Claude Code Integration
  • Claude Code Skills Worth Installing: 52 Picks

This article was produced with the help of AI. A human verified the primary sources and edited the text before publication.

Read next

Articles that answer the question you are likely to have next.

  1. 1Stripe's 'Minions' and the Reality of Autonomous AI AgentsOver the past year, the world of software development has completely changed its landscape. The era where AI completes your code is already ending.
  2. 2"It's API, MCP, and CLI from Here On" — What It Takes for Software to Survive the AI Agent EraA practical guide to "It's API, MCP, and CLI from Here On" — What It Takes for Software to Survive the AI Agent Era. Topics include AI, AI Agents, SaaS.
  3. 3Securing Internal Systems: Settings for Workspace, Apple, Claude Code and Browser AI AgentsSettings that protect internal systems, grouped into four areas: Google Workspace, Apple Business, Claude Code and browser-based AI agents. Based on each vendor's official documentation and OWASP, it covers administrator accounts, 2-step verification, third-party apps, device encryption, AI agent permissions and prompt injection, in priority order.

How well do you understand AI?

Take our free 5-minute assessment covering 7 areas from AI comprehension to security awareness.

Book a Free Consultation
Book a Free Consultation45-minute online sessionDownload ResourcesProduct brochures & whitepapers

Share this article if you found it useful

Share

Newsletter

Get the latest AI and DX insights delivered weekly

Your email will only be used for newsletter delivery.

Related Knowledge Base

Enterprise AI Guide

Solutions

Solve Knowledge Management ChallengesCentralize internal information and quickly access the knowledge you need

Turn AI-driven development into something you can run

WARP is a hands-on program that takes teams from reading about AI to shipping with it. Former enterprise DX and data strategy leads run the sessions.

Contact UsView WARP Details

Related Articles

Stripe's 'Minions' and the Reality of Autonomous AI Agents

Stripe's 'Minions' and the Reality of Autonomous AI Agents

Over the past year, the world of software development has completely changed its landscape. The era where AI completes your code is already ending.

2026-02-24
"It's API, MCP, and CLI from Here On" — What It Takes for Software to Survive the AI Agent Era

"It's API, MCP, and CLI from Here On" — What It Takes for Software to Survive the AI Agent Era

A practical guide to "It's API, MCP, and CLI from Here On" — What It Takes for Software to Survive the AI Agent Era. Topics include AI, AI Agents, SaaS.

2026-02-24
Securing Internal Systems: Settings for Workspace, Apple, Claude Code and Browser AI Agents

Securing Internal Systems: Settings for Workspace, Apple, Claude Code and Browser AI Agents

Settings that protect internal systems, grouped into four areas: Google Workspace, Apple Business, Claude Code and browser-based AI agents. Based on each vendor's official documentation and OWASP, it covers administrator accounts, 2-step verification, third-party apps, device encryption, AI agent permissions and prompt injection, in priority order.

2026-10-20
An Introduction to Agent Engineering: What 400,000 Sessions Showed About Designing How You Delegate

An Introduction to Agent Engineering: What 400,000 Sessions Showed About Designing How You Delegate

Anthropic analysed about 400,000 sessions and found people still make about 70% of the planning decisions, while AI makes about 80% of the execution decisions. People with deeper expertise produce five times the output per session. The length of task you can leave alone keeps doubling, and the gap comes from the environment around the model, not the model itself.

2026-08-13
Claude Code Superpowers Complete Guide to the Multi-Harness Development Methodology

Claude Code Superpowers Complete Guide to the Multi-Harness Development Methodology

A look at where obra/superpowers stands as of 6 November 2026, based on the official repository and release notes. Covers the move from v6 to v7, supported harnesses and install commands, the 15 skills, how to pair it with the current Claude models, and the pitfalls of enterprise rollout.

2026-02-22
The Complete Guide to Claude Code Hooks | Implementation Techniques for Accelerating Development with Tool Event Automation (2026 Edition)

The Complete Guide to Claude Code Hooks | Implementation Techniques for Accelerating Development with Tool Event Automation (2026 Edition)

The Complete Guide to Claude Code Hooks | Implementation Techniques for Accelerating Development with Tool Event Automation (2026 Edition).

2026-04-24