Export the Workspace Directory to Sheets with Claude Code (gws recipe)
Has your assistant export your Workspace company directory (names, emails, phones) to a Google Sheet, using the gws command line.
- Installs
- 31K
- on skills.sh
- Stars
- 32K
- on GitHub
- Updated
- Oct 2026
- last repo commit
This is a three-step recipe from the googleworkspace/cli repo. It lists people from the domain directory with their names, email addresses and phone numbers, then appends them to a Google Sheet.
It loads gws-people and gws-sheets first and runs the gws program for every step. The sheet ID and the sample row in the recipe are placeholders.
This reads the company directory, not your personal contacts. gws-people describes listDirectoryPeople as the domain profiles and domain contacts in the user's domain directory, and personal contacts sit under a separate connections resource that the recipe does not use. Step 2 is labelled Create a sheet but only appends a header row, so create the spreadsheet first. Step 3 passes a JSON array to --values, while gws-sheets-append documents --values as comma-separated values and --json-values for JSON rows.
Good for
- Admins and assistants who want the company directory in a spreadsheet
- People whose AI assistant can already run terminal commands and who use the gws command line
Install recipe-sync-contacts-to-sheet
Claude Code
- 1
Copy this prompt.
Install the recipe-sync-contacts-to-sheet skill in Claude Code. Run this command: npx skills add https://github.com/googleworkspace/cli --skill recipe-sync-contacts-to-sheet --skill gws-people --skill gws-sheets --skill gws-shared Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
This installs 4 skills: the recipe, the gws skills it loads (gws-people, gws-sheets) and gws-shared, which those skills tell the agent to read for sign-in and safety rules. The skills only wrap the gws program, so install gws first and sign in once with gws auth login. The README says an unverified Google app limits consent to about 25 scopes, so choose only the services you need when you sign in.
From the vendor's docs. Source.
What's in the skill
When it loads
Export Google Contacts directory to a Google Sheets spreadsheet.
Sections in SKILL.md
- Steps
Key facts
- License
- Apache-2.0
- Installs on skills.sh
- 30,984 (Nov 2, 2026)
- GitHub stars
- 32,038 for the whole repo (Nov 2, 2026)
- Last commit
- Oct 30, 2026 (repo)
What it includes
Reads names, emails and phones from the domain directory
Calls listDirectoryPeople with a read mask for names, email addresses and phone numbers, page size 100, and returns JSON.
Try: “List the people in our company directory with their emails and phone numbers.”
Network ·
List contactsAppends Name, Email, Phone to your sheet
The recipe labels this step Create a sheet, but the command shown appends a header row to the sheet ID you give, in a Contacts range.
Try: “Add a Name, Email, Phone header row to my Contacts sheet.”
Write ·
Add a header rowAppends one row per contact to the sheet
Appends a values row for each contact. The recipe passes a JSON array to --values, while gws-sheets-append documents --values as comma-separated values and --json-values for JSON rows.
Try: “Append every contact to the Contacts sheet.”
Write ·
Append each contact row
From the official docs
Permissions
Medium risk
The assistant can read your contacts directory and copy it into a Google Sheet. Use a private sheet and check your rules on staff data.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
Contact names, emails and phones go into a spreadsheet
Step 1 reads the contacts directory and steps 2 and 3 append them to a sheet. Use a sheet only the right people can open. github.com
Contact details pass through your assistant's provider
The assistant reads the listed contacts to write each row. Check your company's rules on sharing staff contact data. github.com
Needs the gws program and a Google sign-in first
The skill only wraps the gws command line. Install gws and run its sign-in before the first use, as the README describes. github.com
Technical details
| Turning on read-only | The skill has no read-only switch. gws-shared tells the agent to confirm write and delete commands with you and to prefer --dry-run for destructive operations. You can also sign in with only the services you need. |
|---|---|
| Talks to | Google Workspace APIs, through the gws program |
| Sign-in and keys | gws keeps your Google sign-in encrypted on your machine, with the key in your operating system keyring, per the README. |
Questions
What does the recipe-sync-contacts-to-sheet skill do?
It tells your assistant how to list contacts from the Google directory and append them to a Google Sheet. All steps run through the gws command line.
How do I install it?
Use the install box above. It installs this recipe, the gws skills it loads and gws-shared. The gws program itself is a separate install, and you sign in to Google once before the first run.
Do I need an API key?
No key is named in the skill. You need the gws program and a Google account with access to Google Workspace. The README says gws needs a Google Cloud project for OAuth sign-in credentials. gws auth setup creates one but requires the gcloud CLI, so without gcloud you set up OAuth by hand in the Cloud Console.
Does it work in the Claude app or ChatGPT?
The repo documents no route for them. The skill's steps are gws shell commands, so you need an assistant that can run commands on your computer, such as a coding agent.
Does it export my personal contacts?
No. The recipe asks for the domain profile source, which gws-people describes as the domain profiles and domain contacts in your domain directory. Personal contacts sit under a separate connections resource that the recipe does not use.
Is it a sync?
No. Despite the name it is a one-time export. The recipe appends rows and has no step that compares, updates or removes existing rows, so running it again appends the people again.
How many contacts does it fetch?
The example asks for a page size of 100. For a bigger directory the assistant has to fetch more pages, which the recipe does not spell out.
Is it safe?
It reads staff contact details and writes them to a spreadsheet, so keep that sheet private. The skill bundles no scripts of its own.
Is this an official Google skill?
No. The README says gws is not an officially supported Google product, although the repo sits under the googleworkspace GitHub organization.
How is it different from the other Sheets recipes?
It is the only recipe in the repo that reads the people directory. The other Sheets recipes read from a sheet instead: recipe-generate-report-from-sheet turns a range into a Doc, recipe-create-events-from-sheet creates calendar events from rows, and recipe-backup-sheet-as-csv exports a sheet as CSV.
Information
updated Nov 2, 2026
- Repository
- googleworkspace/cli
- Folder
skills/recipe-sync-contacts-to-sheet
Sources
Docs, issue trackers and discussions this page is built from.
Show all 12Hide
- googleworkspace/cli README · github.com
- recipe-sync-contacts-to-sheet SKILL.md · github.com
- gws-drive SKILL.md · github.com
- skills CLI commands · github.com
- gws-people SKILL.md · github.com
- gws-sheets-append SKILL.md · github.com
- recipe-generate-report-from-sheet SKILL.md · github.com
- recipe-create-events-from-sheet SKILL.md · github.com
- recipe-backup-sheet-as-csv SKILL.md · github.com
- googleworkspace/cli LICENSE · github.com
- recipe-sync-contacts-to-sheet on skills.sh · skills.sh
- gws-shared SKILL.md · github.com