cmd/gog/: CLI entrypoint.internal/: implementation (cmd/, Google API/OAuth, config/secrets, output/UI).- Tests:
*_test.gonext to code; opt-in integration suite ininternal/integration/(build-tagged). bin/: build outputs;docs/: specs/releasing;scripts/: release helpers +scripts/gog.mjs.
make/make build: buildbin/gog.make tools: install pinned dev tools into.tools/.make fmt/make lint/make test/make ci: format, lint, test, full local gate.- Optional:
pnpm gog …: build + run in one step. - Hooks:
lefthook installenables pre-commit/pre-push checks.
- Formatting:
make fmt(goimportslocal prefixgithub.com/steipete/gogcli+gofumpt). - Output: keep stdout parseable (
--json/--plain); send human hints/progress to stderr. - Gmail labels: treat label IDs as case-sensitive opaque tokens; only case-fold label names for name lookup.
- Unit tests: stdlib
testing(andhttptestwhere needed). - Integration tests (local only):
GOG_IT_ACCOUNT=you@gmail.com go test -tags=integration ./internal/integration- Requires OAuth client credentials + a stored refresh token in your keyring.
- Create commits with
committer "<msg>" <file...>; avoid manual staging. - Follow Conventional Commits + action-oriented subjects (e.g.
feat(cli): add --verbose to send). - Group related changes; avoid bundling unrelated refactors.
- PRs should summarize scope, note testing performed, and mention any user-facing changes or new flags.
- PR review flow: when given a PR link, review via
gh pr view/gh pr diffand do not change branches.
- Review mode (PR link only): read
gh pr view/diff; do not switch branches; do not change code. - Landing mode: temp branch from
main; bring in PR (squash default; rebase/merge when needed); fix; updateCHANGELOG.md(PR #/issue + thanks); runmake ci; final commit; merge tomain; delete temp; end onmain. - If we squash, add
Co-authored-by:for the PR author when appropriate; leave a PR comment with what landed + SHAs. - New contributor: thank in
CHANGELOG.md(and update README contributors list if present).
- Never commit OAuth client credential JSON files or tokens.
- Prefer OS keychain backends; use
GOG_KEYRING_BACKEND=file+GOG_KEYRING_PASSWORDonly for headless environments.