* fix(paths): expand ~ in user-provided file paths
When users specify paths with ~ (e.g., --out ~/Downloads/file.pdf) and
the path is quoted in the shell command, the tilde is not expanded by
the shell. This caused files to be written to a literal ~/Downloads
directory instead of the user's home directory.
Add config.ExpandPath() function that expands ~ at the beginning of
paths to the user's home directory. Apply this fix to all user-provided
file paths across:
- gmail attachment download (--out)
- drive download/export (--out)
- drive upload (localPath argument)
- auth token export (--out)
- auth credentials/import/keep (input paths)
- gmail thread attachments (--out-dir)
- gmail send/drafts (--attach)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(lint): address wrapcheck and wsl issues
* fix(calendar): support ISO 8601 time format and add 'list' alias
- Add parsing for ISO 8601 datetime with numeric timezone without colon
(e.g., 2026-01-09T16:38:41-0800), which is the format produced by
macOS `date +%Y-%m-%dT%H:%M:%S%z`
- Add 'list' as an alias for 'events' subcommand for more intuitive CLI
usage (gog calendar list instead of gog calendar events)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore(changelog): note PR #56
* chore(lint): dedupe file string
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Body extraction compared exact MIME types; parts often include params like
"text/plain; charset=utf-8", so multipart/alternative returned empty body
(null in JSON). Normalize MIME types (lowercase/trim/strip params) so
plain/html parts are found, preferring plain text. Also accept padded
base64url defensively.
* feat(gmail): add thread attachments command
Adds `gog gmail thread attachments <threadId>` command that lists all
attachments in an email thread with human-readable sizes.
Features:
- Lists attachments across all messages in a thread
- Shows filename, size (human-readable), and MIME type
- Optional --download flag to download all attachments
- Optional --out-dir to specify download directory
- Supports both JSON and text output formats
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(auth): check keychain before token import
Add pre-flight keychain accessibility check to AuthTokensImportCmd.Run
to fail early if the keychain is locked, rather than after the user has
already completed the import process.
Also adds the EnsureKeychainAccess function to the secrets package which
performs a write/delete test to verify keychain accessibility on macOS.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* style: group const declarations for gofumpt
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address lint issues in store.go
- Wrap keychain access error for wrapcheck linter
- Add blank lines before returns for wsl linter
- Define static error for err113 linter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(cli): add mail and email aliases for gmail command
Enables `gog mail` and `gog email` as shortcuts for `gog gmail`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(gmail): add flattened headers to gmail get JSON output
Add a headers map with common email headers (from, to, cc, bcc, subject,
date) to the JSON output of `gog gmail get`. This makes header extraction
much simpler:
# Before (error-prone due to jq operator precedence)
jq '.message.payload.headers[] | select(.name == "To") | .value'
# After
jq '.headers.to'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(gmail): include inline attachments
* fix(secrets): dedupe keychain helpers
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
- Add message count header ("Thread contains N message(s)") so users
know upfront how many messages to expect
- Add clear message separators with position (=== Message 1/8: id ===)
- Strip HTML <script> and <style> blocks before removing tags
- Use rune-based truncation to avoid breaking multi-byte UTF-8 chars
- Truncate long message bodies to 500 chars for cleaner output
- Add comprehensive unit tests for stripHTMLTags function
Fixes issue where threads with many messages or HTML content would
produce overwhelming output that could get truncated.
This adds a new `gmail thread modify` subcommand that uses the Gmail API's
Threads.Modify endpoint to apply label changes to all messages in a thread
at once.
Usage:
gog gmail thread modify <threadId> --add "Label1,Label2" --remove "Label3"
Features:
- Resolves label names to IDs automatically
- Supports both adding and removing labels in a single operation
- JSON output mode for programmatic use
BREAKING CHANGE: The `gmail thread` command is now a parent command with
subcommands. Use `gmail thread get <id>` instead of `gmail thread <id>`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>