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.
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.- Run from source:
make gog -- …builds and runs in one step. - Tracking worker:
pnpm -C internal/tracking/worker install --frozen-lockfile, thenmake worker-ci. - Remote checks: after
crabbox warmup --keep --timing-json, hydrate this repository withcrabbox actions hydrate --id <id> --github-runner; its workflow uses Actions cache semantics that the local adapter does not support. Runcrabbox run --id <id> --timing-json --shell -- "make ci", reuse the lease across checks, and stop it when finished withcrabbox stop <id>. - Hooks:
lefthook installenables pre-commit/pre-push checks.
- Formatting:
make fmt(goimportslocal prefixgithub.com/openclaw/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.
- Stage only the files you changed (
git add <file...>, nevergit add -A) and commit withgit commit. - 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. - Maintain
CHANGELOG.md: add user-visible changes toUnreleasedas fixes and features land, with PR/issue references and contributor thanks. Finalize that section at release; do not put later work under an already published version. The release-time-only changelog exception foropenclaw/openclawdoes not apply to this repository.
- 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 landing contributor work, always add
Co-authored-by:trailers for PR authors, even when we partially rewrite, group, or manually apply their changes; 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.