googleworkspace avatar

Recipe Sync Contacts To Sheet

A straightforward recipe for dumping your Google Workspace directory into a spreadsheet when you need contact data in a more workable format. Pulls names, emails, and phone numbers from your domain's people directory and writes them to Google Sheets with proper headers. The three-step process is clean: fetch contacts with the People API, create the header row, then append each contact as a new row. Honestly, this feels like something you'd build yourself anyway when HR asks for a contact export, but having the exact API calls and parameters laid out saves you from digging through Google's documentation.

skills.sh installs
31.3K
GitHub stars
32.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add googleworkspace/cli --skill recipe-sync-contacts-to-sheet --agent claude-code

Installs into .claude/skills of the current project.

Files

Export Google Contacts to Sheets

PREREQUISITE: Load the following skills to execute this recipe: gws-people, gws-sheets

Export Google Contacts directory to a Google Sheets spreadsheet.

Steps

  1. List contacts: gws people people listDirectoryPeople --params '{"readMask": "names,emailAddresses,phoneNumbers", "sources": ["DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE"], "pageSize": 100}' --format json
  2. Create a sheet: gws sheets +append --spreadsheet SHEET_ID --range 'Contacts' --values '["Name", "Email", "Phone"]'
  3. Append each contact row: gws sheets +append --spreadsheet SHEET_ID --range 'Contacts' --values '["Jane Doe", "jane@company.com", "+1-555-0100"]'

Sponsors

Details

Repository
github.com/googleworkspace/cli
Categories
CLI & Terminal, Office & Documents

More from googleworkspace/cli

All 113
1googleworkspace avatargws-admin-reportsgoogleworkspace/cliGoogle Workspace Admin SDK: Audit logs and usage reports.31.3Kskills.sh installs
2googleworkspace avatarrecipe-generate-report-from-sheetgoogleworkspace/cliRead data from a Google Sheet and create a formatted Google Docs report.31.2Kskills.sh installs
3googleworkspace avatarrecipe-reschedule-meetinggoogleworkspace/cliMove a Google Calendar event to a new time and automatically notify all attendees.31.1Kskills.sh installs
4googleworkspace avatarrecipe-block-focus-timegoogleworkspace/cliCreate recurring focus time blocks on Google Calendar to protect deep work hours.31Kskills.sh installs
5googleworkspace avatarrecipe-watch-drive-changesgoogleworkspace/cliSubscribe to change notifications on a Google Drive file or folder.31Kskills.sh installs
6googleworkspace avatarrecipe-create-shared-drivegoogleworkspace/cliCreate a Google Shared Drive and add members with appropriate roles.31Kskills.sh installs