Thanks to visit codestin.com
Credit goes to gogcli.sh

gog gogcli

Google Workspace. One binary.

Google in your terminal

gog unifies Gmail, Calendar, Drive, Contacts, Tasks, Sheets, Docs, Slides, and People under one CLI — with JSON output and sane defaults.

Gmail Calendar Drive Contacts Tasks Sheets Docs Slides People

Tip: set a default in gog auth manage or export [email protected] once, stop repeating --account.


$ brew install steipete/tap/gogcli
$ gog auth credentials ~/Downloads/client_secret.json
$ gog auth add [email protected]

$ export [email protected]
$ gog gmail labels list
$ gog calendar calendars --max 5 --json | jq '.calendars[].summary'
$ gog drive ls --query "mimeType='application/pdf'" --max 3
Output
tables / --plain / --json
Accounts
multi-account + gog auth manage
Secrets
OS keyring (Keychain / Secret Service / CredMan)

Install

Homebrew tap, or build from source.

Homebrew

brew install steipete/tap/gogcli

From source

git clone https://github.com/steipete/gogcli.git
cd gogcli
make
./bin/gog --help

Quickstart

You’ll need a Google Cloud “Desktop app” OAuth client JSON once. Then you can keep adding accounts.

1

Store credentials

Save your downloaded client JSON into gog’s config.

gog auth credentials ~/Downloads/client_secret_....json
2

Authorize an account

Browser flow by default. Use --manual for headless.

gog auth add [email protected]
3

Run commands

Use --json for scripting.

export [email protected]
gog gmail search 'newer_than:7d' --max 10 --json | jq

Re-auth a service (e.g. Sheets)

If you add scopes later and Google doesn’t return a refresh token, re-run with --force-consent.

gog auth add [email protected] --services sheets --force-consent

Features

High leverage commands, consistent UX, and clean output.

Gmail

Search threads, send mail, manage labels, drafts, filters, settings, and watch (Pub/Sub push).

Calendar

List/create/update events, respond to invites, detect conflicts, and check free/busy.

Drive

List/search/upload/download, export Docs formats, permissions, folders, URLs.

Sheets / Docs / Slides

Read/write Sheets; export Docs/Slides/Sheets to PDF/DOCX/PPTX/XLSX/CSV via Drive.

Contacts / People

Personal contacts, “other contacts”, Workspace directory, and your profile.

Tasks

Tasklists + tasks: add/update/done/undo/delete/clear with paging and JSON output.

Examples

A few commands you’ll actually use.

Find unread mail

gog gmail search 'is:unread newer_than:7d' --max 20

Pipe JSON to jq for scripts.

gog gmail search 'newer_than:7d' --max 50 --json | jq '.threads[] | .subject'

Export a Sheet as PDF

gog sheets export <spreadsheetId> --format pdf --out ./sheet.pdf

Docs and Slides are similar.

gog docs export <docId> --format docx --out ./doc.docx
gog slides export <presentationId> --format pptx --out ./deck.pptx