recipe-sync-contacts-to-sheet

Export Google Contacts directory entries to a Google Sheets spreadsheet.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-sync-contacts-to-sheet-oresttokovenko
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: recipe-sync-contacts-to-sheet
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/recipe-sync-contacts-to-sheet
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-sync-contacts-to-sheet-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually copying Google Workspace directory contacts into a spreadsheet is tedious and error-prone. This recipe automates the export of directory contacts (names, emails, phone numbers) into a Google Sheets spreadsheet using the gws CLI. ## Core Features & Use Cases - Directory Contact Listing: Retrieves domain directory contacts via the Google People API with a configurable read mask for names, email addresses, and phone numbers. - Spreadsheet Population: Creates header rows and appends each contact as a row in a target Google Sheets spreadsheet. - Use Case: An IT administrator needs an up-to-date company contact list in a shared spreadsheet for the operations team; this recipe pulls the domain directory and writes each contact row automatically. ## Quick Start Ask the assistant to export all Google Workspace directory contacts into a Google Sheets spreadsheet with columns for name, email, and phone number.

Frequently Asked Questions about recipe-sync-contacts-to-sheet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I export Google Contacts to a Google Sheets spreadsheet?▼

Use the gws CLI to list directory people via the People API with a read mask for names, emailAddresses, and phoneNumbers, then append each contact as a row to a spreadsheet with gws sheets +append. This recipe chains both steps together.

How to list Google Workspace directory contacts from the command line?▼

Run gws people people listDirectoryPeople with a readMask parameter specifying names, emailAddresses, and phoneNumbers, and set sources to DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE. The output is returned as JSON with pageSize controlling results per request.

What tools are required to sync Google Contacts to Sheets?▼

This recipe requires the gws command-line binary and two prerequisite skills: gws-people for the People API and gws-sheets for the Sheets API. Both skills must be loaded before executing the recipe steps.

Does this export personal contacts or only directory contacts?▼

The recipe exports domain directory contacts only, using DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE as the source. Personal contacts stored in a user's own Google Contacts are not covered by the listDirectoryPeople call.

Why are only 100 contacts exported from the directory?▼

The listDirectoryPeople call sets pageSize to 100, so only the first page of results is retrieved. Directories with more contacts require pagination using the nextPageToken returned in the JSON response.