feat: Add JSON input support for contacts update#200
Draft
jrossi wants to merge 2 commits intosteipete:mainfrom
Draft
feat: Add JSON input support for contacts update#200jrossi wants to merge 2 commits intosteipete:mainfrom
jrossi wants to merge 2 commits intosteipete:mainfrom
Conversation
Adds --from-file flag to 'gog contacts update' command, enabling updates
from JSON files or stdin. This provides full access to Google People API
fields (URLs, notes, addresses, birthdays, etc.) without requiring
individual CLI flags for each field.
Usage:
gog contacts get people/c123 --json > contact.json
# Edit contact.json to add/modify fields
gog contacts update people/c123 --from-file=contact.json
# Or pipe directly:
gog contacts get people/c123 --json | \
jq '.contact.urls += [{"value": "https://example.com"}]' | \
gog contacts update people/c123 --from-file=-
Benefits:
- Supports all Google People API fields
- Future-proof (new fields work automatically)
- Scriptable with jq and other JSON tools
- Enables complex nested structure updates
---
🤖 This PR was generated with AI assistance (Claude Code).
The implementation was reviewed and tested by the contributor.
The read mask for 'contacts get' now includes additional fields that can be updated via JSON input: urls, biographies, addresses, organizations. This ensures fields written via --from-file are visible when reading the contact back. Tested: - Added Obsidian URI via JSON file - verified in contact - Added biography via stdin pipe - verified in contact
Author
|
I completely understand that many of the pull requests are AI-generated. If you want me to pull this and remove it, no problem. It serves my purpose. It will lead to confirmed work and the outcomes I want. I don't want to flood you if you don't want this. No problem. I completely understand. Thank you. Great PR, great tool. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--from-fileflag togog contacts updatecommand, enabling contact updates from JSON files or stdin. This provides full access to all Google People API fields without requiring individual CLI flags.Motivation
Currently,
gog contacts updateonly supports a limited set of fields via CLI flags (--given,--family,--email,--phone). Many useful fields like URLs, notes/biographies, addresses, and birthdays are not accessible.Instead of adding individual flags for every possible field, this PR implements a more flexible JSON-based approach.
Testing
✅ Fully tested with real Google Contacts:
See full PR description at: #200
🤖 AI-Generated: Implemented with Claude Code, fully tested by contributor