Skip to content

feat(keep): add create and delete commands#413

Closed
jgwesterlund wants to merge 2 commits intoopenclaw:mainfrom
jgwesterlund:feat/keep-create-delete
Closed

feat(keep): add create and delete commands#413
jgwesterlund wants to merge 2 commits intoopenclaw:mainfrom
jgwesterlund:feat/keep-create-delete

Conversation

@jgwesterlund
Copy link
Copy Markdown
Contributor

Summary

Adds two missing subcommands that the Google Keep API supports but gog keep didn't expose:

  • keep create --title T --text body — create a plain-text note
  • keep create --title T --item x --item y — create a checklist note (repeatable --item flag)
  • keep delete <noteId> — delete a note with interactive confirmation (or --force to skip)

All commands follow the existing patterns in the codebase:

  • --dry-run support (create logs intent; delete goes through confirmDestructive)
  • --json / --plain output modes
  • notes/ prefix normalization for delete (accepts bare ID or full resource name)
  • Full --service-account / --impersonate flow

Test plan

  • 8 new unit tests in keep_test.go covering happy paths, JSON output, input validation, and notes/ prefix normalization
  • All 19 keep tests pass (go test ./internal/cmd/ -run TestKeep -v)
  • go build ./... clean
  • gog keep --help shows new subcommands
  • --dry-run produces correct JSON for both commands

🤖 Generated with Claude Code

jgwesterlund and others added 2 commits March 4, 2026 11:04
Adds two new subcommands to `gog keep`:

- `keep create --title <t> --text <body>` – create a text note
- `keep create --title <t> --item <x> --item <y>` – create a checklist note
- `keep delete <noteId>` – delete a note (requires --force or interactive confirmation)

Both commands support --dry-run, --json/--plain output, and the full
--service-account / --impersonate flow used by the rest of the Keep
command group. Eight unit tests cover the happy paths, JSON output,
input validation, and the notes/ prefix normalization for delete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The keep.readonly scope only allows reads. Now that we have create and
delete commands, the service must request the full keep scope so that
domain-wide delegation grants write access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
steipete added a commit that referenced this pull request Mar 8, 2026
- add keep create/delete commands for text and checklist notes
- validate checklist items and switch Keep service-account scope to writable access
- refresh README and changelog for Keep write support

Co-authored-by: John Westerlund <john.westerlund@cygnisec.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@steipete
Copy link
Copy Markdown
Collaborator

steipete commented Mar 8, 2026

Landed manually on main in e323f69.

Included fixups while landing:

  • reject blank keep create --item values
  • switch Keep service-account scope/docs to writable keep
  • refresh README + changelog entries for the new Keep write flow

Thanks @jgwesterlund.

@steipete steipete closed this Mar 8, 2026
klodr pushed a commit to klodr/gogcli that referenced this pull request Apr 22, 2026
- add keep create/delete commands for text and checklist notes
- validate checklist items and switch Keep service-account scope to writable access
- refresh README and changelog for Keep write support

Co-authored-by: John Westerlund <john.westerlund@cygnisec.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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