Skip to content

feat(contacts): add address support to create/update commands#148

Merged
steipete merged 1 commit intoopenclaw:mainfrom
beezly:feat/contacts-address-support
Mar 8, 2026
Merged

feat(contacts): add address support to create/update commands#148
steipete merged 1 commit intoopenclaw:mainfrom
beezly:feat/contacts-address-support

Conversation

@beezly
Copy link
Copy Markdown

@beezly beezly commented Jan 31, 2026

Summary

Add --address flag to gog contacts create and gog contacts update commands, allowing users to set street addresses on contacts.

Changes

  • Add addresses to contactsReadMask for API requests
  • Add Address field to ContactsCreateCmd and ContactsUpdateCmd
  • Add primaryAddress() helper to extract formatted address
  • Display address in gog contacts get output

Usage

# Create contact with address
gog contacts create --given John --family Doe --address "123 Main St, London"

# Update existing contact's address
gog contacts update people/c123456 --address "456 New St, Manchester"

# Clear address
gog contacts update people/c123456 --address ""

# View contact (now shows address)
gog contacts get people/c123456

Testing

  • make test passes
  • make fmt applied
  • Manually tested create/update/get with real Google Contacts

Notes

The --address flag sets the StreetAddress field. Google automatically generates the FormattedValue from this. For display, we prefer FormattedValue if available, falling back to StreetAddress.

This follows the existing pattern for phone/email handling in the codebase.

@beezly beezly force-pushed the feat/contacts-address-support branch from 2c82857 to 3ab0b0c Compare January 31, 2026 12:37
@beezly
Copy link
Copy Markdown
Author

beezly commented Jan 31, 2026

Updated PR

I've expanded this PR to include support for more Google People API fields:

New Flags (create & update)

Flag Description
--address Street address
--birthday Birthday (YYYY-MM-DD or MM-DD)
--company Company/organization name
--title Job title
--nickname Nickname
--url Website URL
--notes Notes/biography

All fields display in gog contacts get output. Empty values clear fields on update.

Example

gog contacts create --given John --family Doe \
  --birthday "1990-05-15" \
  --company "Acme Corp" --title "Engineer" \
  --nickname "Johnny"

gog contacts update people/c123 --notes "Met at conference"

@beezly beezly force-pushed the feat/contacts-address-support branch from 3ab0b0c to 830cff7 Compare February 19, 2026 18:17
@beezly beezly marked this pull request as draft February 19, 2026 18:17
@beezly beezly force-pushed the feat/contacts-address-support branch from cb30c94 to d04b188 Compare February 19, 2026 22:51
@beezly beezly marked this pull request as ready for review February 19, 2026 22:53
- Add --address flag to 'contacts create' and 'contacts update'
  (repeatable, like --url; empty value clears all addresses on update)
- Display addresses in 'contacts get' text output
- Add 'addresses' to contactsUpdateReadMask so existing addresses are
  fetched before patching
- Add contactsAddresses() helper and formatAddress()/allAddresses()
  display helpers
- Also fix pre-existing compile error: contactsApplyPersonName and
  contactsApplyPersonOrganization had incorrect Go parameter-grouping
  syntax (given,familySet bool / org,titleSet bool) which made the
  string params typed as bool — corrected to explicit string types
@steipete steipete force-pushed the feat/contacts-address-support branch from d04b188 to 4f2f72f Compare March 8, 2026 04:17
@steipete steipete merged commit f164591 into openclaw:main Mar 8, 2026
1 check passed
@steipete
Copy link
Copy Markdown
Collaborator

steipete commented Mar 8, 2026

Landed via temp rebase onto main.

Thanks @beezly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants