gitmyhub

gogcli

Go ★ 7.8k updated 1d ago

Google Workspace in your terminal.

A command-line tool that lets you interact with Gmail, Calendar, Drive, Docs, Sheets, and a dozen other Google Workspace services from a terminal or shell script, returning JSON or plain text output.

GoDockerOAuthsetup: moderatecomplexity 3/5

gogcli (invoked as gog) is a command-line tool that lets you interact with Google Workspace services from a terminal, a shell script, or an automated workflow. Instead of using a web browser to check Gmail, create calendar events, or browse Drive files, you type commands and get structured output back.

The tool covers a wide range of Google services: Gmail, Calendar, Drive, Docs, Sheets, Slides, Forms, Meet, Apps Script, Analytics, Search Console, Contacts, Tasks, Classroom, Chat, YouTube, and Workspace admin flows. Each command can return output as JSON (for scripts and programs to parse) or plain text (for human reading), and error messages or progress updates go to a separate output channel so they do not interfere with scripted use.

Setting it up requires creating a Google Cloud project, enabling the APIs for the services you want to use, and creating an OAuth client that gog can use to authenticate on your behalf. The tool supports multiple Google accounts at the same time, and for organizational Workspace environments it also supports service accounts and application default credentials. You can install it via Homebrew on Mac, Docker, a Windows zip download, or by building from source.

The README includes safety features worth noting: you can configure the tool to block send operations during automation (so a script cannot accidentally send emails), and Drive audit commands are read-only by default. There are also allowlists and denylists for which commands a given binary is permitted to run, which is useful for locked-down automation environments.

The project is written in Go and ships with generated reference documentation for every command. It is designed to work well as a building block in coding agents and CI pipelines.

Where it fits