Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

gsuite-sdk

БесплатноБез исполняемых скриптовНе проверен

Work with Gmail, Google Calendar, Drive, Sheets, Tasks and Contacts, and read Search Console, Google Analytics 4 and Tag Manager, through the gsuite-sdk…

pabloalanizот pabloalaniz2 903 установки в других каталогах

Об этом скилле

gsuite-sdk

One OAuth login for Gmail, Calendar, Drive, Sheets, Tasks and Contacts (plus read-only Search Console, Analytics and Tag Manager), usable three ways: the gsuite CLI (prefer it: most commands print JSON with -o json), the Python SDK, or a REST API (gsuite serve).

Docs: https://pabloalaniz.github.io/google-suite/ · Source: https://github.com/PabloAlaniz/google-suite

Setup

pip install "gsuite-sdk[cli]"      # the gsuite command; [all] adds the REST API, async and Secret Manager

Configuration comes from environment variables (or a .env file):

Variable Default Meaning
GSUITE_CREDENTIALS_FILE credentials.json OAuth client file from Google Cloud (how to get it)
GSUITE_TOKEN_DB_PATH tokens.db Where the login token is stored (SQLite)
GSUITE_DEFAULT_TIMEZONE UTC Time zone for "today" and for naive datetimes
GSUITE_ACCOUNT default Which stored login to use (same as --account)

Both paths are relative to the current directory: run every command from the same place, or set absolute paths. Set GSUITE_DEFAULT_TIMEZONE (e.g. America/Argentina/Buenos_Aires), or "today" and new events use UTC.

Login (once, opens a browser)

gsuite auth login                                  # Gmail, Calendar, Drive, Sheets
gsuite auth login --force --scopes default,tasks,contacts   # add Tasks and Contacts
gsuite auth login --force --scopes default,marketing        # add Search Console, Analytics, Tag Manager
gsuite auth login --no-browser                     # over SSH / on a server: paste back the redirect URL
gsuite auth login --add --scopes tasks             # keep the scopes it has, add these
gsuite auth status

Several Google accounts: --account NAME before any command picks a stored login (gsuite --account work auth login, gsuite --account work gmail list), gsuite auth list shows them. In Python, GoogleAuth(user_id="work").

--scopes takes a comma-separated list of default, gmail, calendar, drive, sheets, tasks, contacts, searchconsole, analytics, tagmanager, marketing, all. Tasks, Contacts and the read-only marketing scopes are not in the default login (all doesn't include the marketing ones either). The token refreshes itself; log in again (--force) only after a TokenRefreshError or when a call fails with PermissionDeniedError because a scope is missing.

Without a browser (servers, CI) use a service account:

from gsuite_core import GoogleAuth, Scopes

auth = GoogleAuth.from_service_account(
    "service-account.json",
    scopes=Scopes.default(),
    subject="[email protected]",  # Workspace domain-wide delegation; omit otherwise
)

CLI (preferred)

Add -o json where supported and parse stdout. Errors exit with code 1 and a one-line message.

gsuite gmail list --unread --limit 10 -o json
gsuite gmail list --query "from:[email protected] newer_than:7d" -o json
gsuite gmail read MESSAGE_ID -o json
gsuite gmail send --to [email protected] --subject "Report" --body "Attached." --attach report.pdf
gsuite gmail reply MESSAGE_ID --body "Thanks!"

gsuite calendar list --days 1 -o json        # events in the next 24 hours
gsuite calendar create "Sync" --start "2026-03-02 10:00" --end "2026-03-02 10:30" --attendee [email protected] --meet --notify

gsuite drive list --name "invoice" -o json
gsuite drive upload ./report.pdf --to FOLDER_ID
gsuite drive download FILE_ID --out ./file.pdf
gsuite drive share FILE_ID [email protected] --role writer

gsuite sheets read SPREADSHEET --range "A1:D20" -o json   # SPREADSHEET: title, ID or URL
gsuite sheets append SPREADSHEET --value "Ana" --value 42
gsuite sheets export SPREADSHEET --format xlsx --out ./budget.xlsx

gsuite tasks list -o json
gsuite tasks add "Pay rent" --due 2026-03-01
gsuite tasks done TASK_ID

gsuite contacts search ana -o json

gsuite searchconsole query sc-domain:example.com --start 2026-03-01 --end 2026-03-28 --dim query -o json
gsuite analytics report 123456 --metric sessions --dim date --start 7daysAgo -o json
gsuite tagmanager containers accounts/123 -o json

No JSON output on calendar today, calendar week or gmail search: use calendar list --days N -o json and gmail list --query ... -o json instead.

Python SDK

from gsuite_core import GoogleAuth
from gsuite_gmail import Gmail, query
from gsuite_calendar import Calendar
from gsuite_drive import Drive
from gsuite_sheets import Sheets

auth = GoogleAuth()   # reads the token saved by `gsuite auth login`

gmail = Gmail(auth)
for msg in gmail.search(query.from_("[email protected]") & query.newer_than(days=7)):
    print(msg.subject, msg.sender, msg.date)

calendar = Calendar(auth)
for event in calendar.get_today():
    print(event.start, event.summary, event.meet_link)

drive = Drive(auth)
uploaded = drive.upload("report.pdf", parent_id="FOLDER_ID")
drive.sha
Полный SKILL.md на ClawHub

Установить gsuite-sdk в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл gsuite-sdk?

Work with Gmail, Google Calendar, Drive, Sheets, Tasks and Contacts, and read Search Console, Google Analytics 4 and Tag Manager, through the gsuite-sdk Python library and its `gsuite` CLI (JSON output for agents). Use it to read and send email, manage events, upload and share files, read and write spreadsheets, manage tasks and contacts, and pull search, traffic and tag data.

Как установить скилл gsuite-sdk?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл gsuite-sdk запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить gsuite-sdk с