Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
345 changes: 0 additions & 345 deletions .codex/audits/gogcli-audit-latest.md

This file was deleted.

23 changes: 1 addition & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,6 @@ jobs:
- name: Test
run: go test ./...

worker:
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Enable Corepack (pnpm)
run: |
corepack enable
corepack prepare pnpm@10.27.0 --activate
- name: Install dependencies
run: pnpm -C internal/tracking/worker install --frozen-lockfile
- name: Lint
run: pnpm -C internal/tracking/worker lint
- name: Build
run: pnpm -C internal/tracking/worker build
- name: Test
run: pnpm -C internal/tracking/worker test

darwin-cgo-build:
runs-on: macos-latest
timeout-minutes: 15
Expand All @@ -68,7 +47,7 @@ jobs:
- name: Test
run: go test ./...
- name: Build (Keychain / cgo)
run: CGO_ENABLED=1 go build ./cmd/gog
run: CGO_ENABLED=1 go build ./cmd/gog-mcp

mcp-container:
runs-on: blacksmith-2vcpu-ubuntu-2404
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,4 @@ go.work.sum

# Local build output
bin/
/gog

# Node (optional dev scripts)
node_modules/
/gog-mcp
26 changes: 0 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ linters:
rules:
json: snake
yaml: snake
overrides:
- pkg: github.com/steipete/gogcli/internal/cmd
ignore: true
- pkg: github.com/steipete/gogcli/internal/googleauth
ignore: true
wsl_v5:
allow-first-in-block: true
allow-whole-block: false
Expand All @@ -122,16 +117,6 @@ linters:
- goconst
- tagliatelle
- paralleltest
- path: internal/cmd/.*\.go
linters:
- err113
- wrapcheck
- dupl
- wsl_v5
- tagliatelle
- path: internal/googleauth/.*\.go
linters:
- tagliatelle
- path: cmd/.*\.go
linters:
- wsl_v5
Expand All @@ -144,17 +129,6 @@ linters:
- linters:
- staticcheck
text: "QF1001"
# The generated completion script intentionally loads and invokes the
# zsh bashcompinit compatibility function.
- path: internal/cmd/completion_scripts\.go
linters:
- dupword
# The yes literal is intentionally ignored globally as table vocabulary.
# Keep this legacy directive out of unused-directive failures until the
# file is otherwise touched.
- path: internal/cmd/confirm\.go
linters:
- nolintlint

formatters:
enable:
Expand Down
30 changes: 11 additions & 19 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
version: 2

project_name: gogcli
project_name: google-mcp

changelog:
disable: true

builds:
- id: gog
main: ./cmd/gog
binary: gog
ldflags: >-
-s -w
-X github.com/steipete/gogcli/internal/cmd.version={{ .Tag }}
-X github.com/steipete/gogcli/internal/cmd.commit={{ .ShortCommit }}
-X github.com/steipete/gogcli/internal/cmd.date={{ .Date }}
- id: gog_mcp
main: ./cmd/gog-mcp
binary: gog-mcp
ldflags: -s -w -X main.defaultVersion={{ .Version }}
env:
- CGO_ENABLED=0
targets:
- linux_amd64
- linux_arm64
- windows_amd64
- windows_arm64
- id: gog_darwin
main: ./cmd/gog
binary: gog
ldflags: >-
-s -w
-X github.com/steipete/gogcli/internal/cmd.version={{ .Tag }}
-X github.com/steipete/gogcli/internal/cmd.commit={{ .ShortCommit }}
-X github.com/steipete/gogcli/internal/cmd.date={{ .Date }}
- id: gog_mcp_darwin
main: ./cmd/gog-mcp
binary: gog-mcp
ldflags: -s -w -X main.defaultVersion={{ .Version }}
env:
- CGO_ENABLED=1
targets:
Expand All @@ -37,8 +29,8 @@ builds:

archives:
- builds:
- gog
- gog_darwin
- gog_mcp
- gog_mcp_darwin
format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
Expand Down
34 changes: 20 additions & 14 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,39 @@

## Project Structure

- `cmd/gog/`: CLI entrypoint.
- `internal/`: implementation (`cmd/`, Google API/OAuth, config/secrets, output/UI).
- Tests: `*_test.go` next to code; opt-in integration suite in `internal/integration/` (build-tagged).
- `bin/`: build outputs; `docs/`: specs/releasing; `scripts/`: release helpers + `scripts/gog.mjs`.
- `cmd/gog-mcp/`: MCP server entrypoint (flags, grants loading, connect page wiring).
- `internal/mcpserver/`: MCP runtime — tools, resources, transports, limits.
- `internal/mcpcontract/`: public tool catalog, action/scope bindings, typed error contract.
- `internal/googleapi/`, `internal/googlecatalog/`: native Google API clients, retry/budget guards, pinned discovery catalog.
- `internal/googleops/`: operation implementations (curated reads, catalog executors, media, authoring, workflows).
- `internal/accountconnect/`: browser OAuth onboarding, account registry, token stores.
- `internal/access/`, `internal/secrets/`, `internal/config/`: grants/policies enforcement and credential storage.
- `bin/`: build outputs. `docs/`: specs and agent guidance. `deploy/google-mcp/`: deployment package.
- Tests: `*_test.go` next to the code they cover.

## Build, Test, and Development Commands

- `make` / `make build`: build `bin/gog`.
- `make` / `make build`: build `bin/gog-mcp`.
- `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 install` enables pre-commit/pre-push checks.

## Coding Style & Naming Conventions

- Formatting: `make fmt` (`goimports` local prefix `github.com/steipete/gogcli` + `gofumpt`).
- Output: keep stdout parseable (`--json` / `--plain`); send human hints/progress to stderr.
- Keep MCP frames on stdout; send logs and human hints to stderr.
- Use domain vocabulary from `CONTEXT.md` (capabilities, grants, write gates, artifacts) consistently in code, issues, and docs.

## Testing Guidelines

- Unit tests: stdlib `testing` (and `httptest` where 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.
- Unit tests: stdlib `testing` (and `httptest` for transport/OAuth fixtures).
- Contract tests in `internal/mcpcontract` and `internal/mcpserver` pin tool schemas and error categories; update them together with behavior changes.
- Container smoke checks live in `deploy/google-mcp/smoke.py`; they do not prove live Google API outcomes.
- Never run against user-owned live state without an explicit request.

## Commit & Pull Request Guidelines

- Create commits with `committer "<msg>" <file...>`; avoid manual staging.
- Follow Conventional Commits + action-oriented subjects (e.g. `feat(cli): add --verbose to send`).
- Follow Conventional Commits + action-oriented subjects (e.g. `feat(mcp): add --verbose logging`).
- 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 diff` and do not change branches.
Expand All @@ -44,8 +48,10 @@

## Security & Configuration Tips

- Never commit OAuth client credential JSON files or tokens.
- Never commit OAuth client credential JSON files, bearer tokens, keyring files, or account registries.
- Server state (registry, tokens) is user-owned live data; do not modify or delete it while a process owns it.
- Prefer OS keychain backends; use `GOG_KEYRING_BACKEND=file` + `GOG_KEYRING_PASSWORD` only for headless environments.
- Writes stay disabled unless explicitly enabled and granted; never grant write access casually in examples or fixtures.

## Agent skills

Expand Down
Loading
Loading