steipete / gogcli
Summary
gogcli is a fast, script-friendly command-line interface (CLI) tool designed for interacting with numerous Google Workspace services directly from the terminal. It supports Gmail, Calendar, Chat, Classroom, Drive, Docs, Slides, Sheets, Forms, Apps Script, Contacts, Tasks, People, Groups, and Keep. Key features include JSON-first output for automation, support for multiple Google accounts with aliases, and built-in least-privilege authentication. The tool offers secure credential storage using OS keyrings or encrypted on-disk keyrings, auto-refreshing tokens, and domain-wide delegation for Workspace service accounts. Installation is available via Homebrew, Arch User Repository, or by building from source, with comprehensive documentation for OAuth2 credential setup and configuration.
Key takeaway
For DevOps Engineers or Automation Engineers integrating Google Workspace services into scripts, gogcli offers a powerful and secure solution. You should prioritize setting up OAuth2 credentials and enabling only necessary API scopes to maintain a least-privilege security posture. Leverage its JSON output mode for seamless integration with other command-line tools like `jq` to build robust automation workflows for tasks across Gmail, Calendar, Drive, and Sheets.
Key insights
gogcli provides comprehensive command-line access to Google Workspace services with robust authentication and scripting features.
Principles
- JSON-first output enhances scriptability.
- Least-privilege authentication improves security.
- Secure credential storage is paramount.
Method
Users obtain OAuth2 credentials from Google Cloud Console, store them using `gog auth credentials`, and then authorize accounts via `gog auth add`. Service accounts with domain-wide delegation are supported for Workspace environments.
In practice
- Automate email searches and attachment downloads.
- Manage calendar events and team availability.
- Update Google Sheets from CSV data.
Topics
- Google Workspace CLI
- OAuth2 Authentication
- Command Line Automation
- Google API Integration
- Secure Credential Storage
Code references
Best for: Software Engineer, DevOps Engineer, Automation Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Github Trending: All languages.