KosmoKrator

productivity

Google Contacts CLI for AI Agents

Use the Google Contacts CLI from KosmoKrator to call Google Contacts tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write OAuth browser flow auth

Google Contacts CLI Setup

Google Contacts can be configured headlessly with `kosmokrator integrations:configure google_contacts`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure google_contacts --set access_token="$GOOGLE_CONTACTS_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor google_contacts --json
kosmokrator integrations:status --json

Credentials

Authentication type: OAuth browser flow oauth2_authorization_code. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token GOOGLE_CONTACTS_ACCESS_TOKEN Secret secret yes Access Token
url GOOGLE_CONTACTS_URL URL url no API Base URL

Call Google Contacts Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call google_contacts.google_contacts_list_connections '{
  "pageSize": 1,
  "pageToken": "example_pageToken",
  "sortOrder": "example_sortOrder",
  "syncToken": "example_syncToken"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:google_contacts google_contacts_list_connections '{
  "pageSize": 1,
  "pageToken": "example_pageToken",
  "sortOrder": "example_sortOrder",
  "syncToken": "example_syncToken"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs google_contacts --json
kosmo integrations:docs google_contacts.google_contacts_list_connections --json
kosmo integrations:schema google_contacts.google_contacts_list_connections --json
kosmo integrations:search "Google Contacts" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Google Contacts.

google_contacts.google_contacts_list_connections

Read read

List contacts (connections) from the authenticated user's Google Contacts. Returns names, emails, phone numbers, biographies, organizations, and photos. Supports pagination and incremental sync.

Parameters
pageSize, pageToken, sortOrder, syncToken

Generic CLI call

kosmo integrations:call google_contacts.google_contacts_list_connections '{"pageSize":1,"pageToken":"example_pageToken","sortOrder":"example_sortOrder","syncToken":"example_syncToken"}' --json

Provider shortcut

kosmo integrations:google_contacts google_contacts_list_connections '{"pageSize":1,"pageToken":"example_pageToken","sortOrder":"example_sortOrder","syncToken":"example_syncToken"}' --json

google_contacts.google_contacts_get_connection

Read read

Get detailed information about a specific contact by resource name (e.g., "people/c123456789"). Returns names, emails, phone numbers, biographies, organizations, and photos.

Parameters
resourceName, personFields

Generic CLI call

kosmo integrations:call google_contacts.google_contacts_get_connection '{"resourceName":"example_resourceName","personFields":"example_personFields"}' --json

Provider shortcut

kosmo integrations:google_contacts google_contacts_get_connection '{"resourceName":"example_resourceName","personFields":"example_personFields"}' --json

google_contacts.google_contacts_create_contact

Write write

Create a new contact in Google Contacts. Provide at least a name. You can also add email addresses, phone numbers, and a biography (notes).

Parameters
givenName, familyName, emailAddresses, phoneNumbers, biography

Generic CLI call

kosmo integrations:call google_contacts.google_contacts_create_contact '{"givenName":"example_givenName","familyName":"example_familyName","emailAddresses":"example_emailAddresses","phoneNumbers":"example_phoneNumbers","biography":"example_biography"}' --json

Provider shortcut

kosmo integrations:google_contacts google_contacts_create_contact '{"givenName":"example_givenName","familyName":"example_familyName","emailAddresses":"example_emailAddresses","phoneNumbers":"example_phoneNumbers","biography":"example_biography"}' --json

google_contacts.google_contacts_list_contact_groups

Read read

List all contact groups in the user's Google Contacts. Includes system groups (e.g., "My Contacts", "Starred") and user-created groups. Returns group name, type, and member count.

Parameters
pageSize, pageToken, syncToken

Generic CLI call

kosmo integrations:call google_contacts.google_contacts_list_contact_groups '{"pageSize":1,"pageToken":"example_pageToken","syncToken":"example_syncToken"}' --json

Provider shortcut

kosmo integrations:google_contacts google_contacts_list_contact_groups '{"pageSize":1,"pageToken":"example_pageToken","syncToken":"example_syncToken"}' --json

google_contacts.google_contacts_get_contact_group

Read read

Get details of a specific contact group by resource name (e.g., "contactGroups/myContacts"). Returns the group name, type, member count, and member resource names.

Parameters
resourceName

Generic CLI call

kosmo integrations:call google_contacts.google_contacts_get_contact_group '{"resourceName":"example_resourceName"}' --json

Provider shortcut

kosmo integrations:google_contacts google_contacts_get_contact_group '{"resourceName":"example_resourceName"}' --json

google_contacts.google_contacts_list_other_contacts

Read read

List "Other Contacts" — people the user has interacted with (e.g., via email) but hasn't added to their contacts. Returns names, email addresses, and phone numbers.

Parameters
pageSize, pageToken, syncToken

Generic CLI call

kosmo integrations:call google_contacts.google_contacts_list_other_contacts '{"pageSize":1,"pageToken":"example_pageToken","syncToken":"example_syncToken"}' --json

Provider shortcut

kosmo integrations:google_contacts google_contacts_list_other_contacts '{"pageSize":1,"pageToken":"example_pageToken","syncToken":"example_syncToken"}' --json

google_contacts.google_contacts_get_current_user

Read read

Get the authenticated user's own Google profile information — display name, email addresses, and profile photo.

Parameters
none

Generic CLI call

kosmo integrations:call google_contacts.google_contacts_get_current_user '{}' --json

Provider shortcut

kosmo integrations:google_contacts google_contacts_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

google_contacts.google_contacts_list_connections

List contacts (connections) from the authenticated user's Google Contacts. Returns names, emails, phone numbers, biographies, organizations, and photos. Supports pagination and incremental sync.

Operation
Read read
Schema command
kosmo integrations:schema google_contacts.google_contacts_list_connections --json
ParameterTypeRequiredDescription
pageSize integer no Number of connections to return per page (1–2000, default 200).
pageToken string no Token from a previous response to retrieve the next page of results.
sortOrder string no Sort order for results: "LAST_NAME_ASCENDING" or "LAST_NAME_DESCENDING".
syncToken string no Sync token from a previous list response to return only contacts that changed since then.

google_contacts.google_contacts_get_connection

Get detailed information about a specific contact by resource name (e.g., "people/c123456789"). Returns names, emails, phone numbers, biographies, organizations, and photos.

Operation
Read read
Schema command
kosmo integrations:schema google_contacts.google_contacts_get_connection --json
ParameterTypeRequiredDescription
resourceName string yes The resource name of the person to retrieve (e.g., "people/c123456789").
personFields string no Comma-separated person fields to include (default: "names,emailAddresses,phoneNumbers,biographies,organizations,photos").

google_contacts.google_contacts_create_contact

Create a new contact in Google Contacts. Provide at least a name. You can also add email addresses, phone numbers, and a biography (notes).

Operation
Write write
Schema command
kosmo integrations:schema google_contacts.google_contacts_create_contact --json
ParameterTypeRequiredDescription
givenName string no Given (first) name of the contact.
familyName string no Family (last) name of the contact.
emailAddresses array no Email addresses. Each entry is a string (e.g., ["[email protected]"]).
phoneNumbers array no Phone numbers. Each entry is a string (e.g., ["+1234567890"]).
biography string no Notes or biography text for the contact.

google_contacts.google_contacts_list_contact_groups

List all contact groups in the user's Google Contacts. Includes system groups (e.g., "My Contacts", "Starred") and user-created groups. Returns group name, type, and member count.

Operation
Read read
Schema command
kosmo integrations:schema google_contacts.google_contacts_list_contact_groups --json
ParameterTypeRequiredDescription
pageSize integer no Number of groups to return per page (1–2000, default 200).
pageToken string no Token from a previous response to retrieve the next page.
syncToken string no Sync token from a previous list response to return only groups that changed.

google_contacts.google_contacts_get_contact_group

Get details of a specific contact group by resource name (e.g., "contactGroups/myContacts"). Returns the group name, type, member count, and member resource names.

Operation
Read read
Schema command
kosmo integrations:schema google_contacts.google_contacts_get_contact_group --json
ParameterTypeRequiredDescription
resourceName string yes The resource name of the contact group (e.g., "contactGroups/myContacts" or "contactGroups/123").

google_contacts.google_contacts_list_other_contacts

List "Other Contacts" — people the user has interacted with (e.g., via email) but hasn't added to their contacts. Returns names, email addresses, and phone numbers.

Operation
Read read
Schema command
kosmo integrations:schema google_contacts.google_contacts_list_other_contacts --json
ParameterTypeRequiredDescription
pageSize integer no Number of contacts to return per page (1–1000, default 200).
pageToken string no Token from a previous response to retrieve the next page.
syncToken string no Sync token from a previous list response to return only changed contacts.

google_contacts.google_contacts_get_current_user

Get the authenticated user's own Google profile information — display name, email addresses, and profile photo.

Operation
Read read
Schema command
kosmo integrations:schema google_contacts.google_contacts_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.