Skip to content

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

Open
jgwesterlund wants to merge 2 commits intosteipete:mainfrom
jgwesterlund:feat/keep-create-delete
Open

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

Conversation

@jgwesterlund
Copy link

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>
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.

1 participant