$npx -y skills add samber/cc-skills-golang --skill golang-pkg-go-devGolang package and module documentation and exploration via godig, a pkg.go.dev API client (CLI + MCP server) — package docs, API references, symbols, code examples, available versions, importers (who imports a package), licenses, and known vulnerabilities. Read-only, no auth.
| 1 | # golang-pkg-go-dev |
| 2 | |
| 3 | **Dependencies:** `godig` — `go install github.com/samber/godig/cmd/godig@latest` (or use a registered godig MCP server / the hosted instance instead). |
| 4 | |
| 5 | `godig` queries the [pkg.go.dev](https://pkg.go.dev) API. Use it to answer questions about Go packages and modules: docs, symbols, versions, importers and vulnerabilities. It works as a CLI and as an MCP server. All operations are **read-only** and need no authentication. |
| 6 | |
| 7 | ## When to use this skill |
| 8 | |
| 9 | Trigger on questions like: |
| 10 | |
| 11 | - "What versions of github.com/samber/lo are available?" |
| 12 | - "Does golang.org/x/text have known vulnerabilities?" |
| 13 | - "Show me the docs / symbols for package X." |
| 14 | - "Which packages import X?" |
| 15 | - "Search Go packages for Y." |
| 16 | |
| 17 | ## Choosing between `godig`, gopls, Context7, and govulncheck |
| 18 | |
| 19 | In short: `godig` answers questions about the **published ecosystem** (works even for packages not yet in your `go.mod`); `gopls` reasons about **your locally resolved build** (`go.sum`, including `replace`d forks); Context7 is a fallback for non-Go or unindexed docs; `govulncheck` is the whole-tree vulnerability audit (→ `samber/cc-skills-golang@golang-security`). See the `samber/cc-skills-golang@golang-gopls` skill for wiring `gopls` (MCP server, native `LSP` tool, and CLI) with Claude Code, and the `samber/cc-skills-golang@golang-how-to` skill's "`godig` vs gopls vs Context7 vs govulncheck" section for the full task-to-tool matrix. |
| 20 | |
| 21 | ## Setup |
| 22 | |
| 23 | ### Install |
| 24 | |
| 25 | ```bash |
| 26 | go install github.com/samber/godig/cmd/godig@latest |
| 27 | ``` |
| 28 | |
| 29 | ### Register the MCP server (optional) |
| 30 | |
| 31 | `godig mcp` runs over **stdio** by default, or **streamable HTTP** with `--transport http`. |
| 32 | |
| 33 | stdio (the client launches godig on demand): |
| 34 | |
| 35 | ```bash |
| 36 | claude mcp add pkg-go-dev -- godig mcp |
| 37 | ``` |
| 38 | |
| 39 | streamable HTTP (shared server at `/mcp`, default `:8080`): |
| 40 | |
| 41 | ```bash |
| 42 | godig mcp --transport http --addr :8080 |
| 43 | claude mcp add --transport http pkg-go-dev http://localhost:8080/mcp |
| 44 | ``` |
| 45 | |
| 46 | Hosted instance (no install needed) — a public server runs at `https://godig.samber.dev/mcp`: |
| 47 | |
| 48 | ```bash |
| 49 | claude mcp add --transport http pkg-go-dev https://godig.samber.dev/mcp |
| 50 | ``` |
| 51 | |
| 52 | The CLI and the MCP server expose the **same** operations under matching names. Prefer the CLI when `godig` is installed; the hosted instance is a fallback when it is not. |
| 53 | |
| 54 | ## Commands |
| 55 | |
| 56 | **Global flags (all commands):** `-o/--output table|json|raw|md` (default `table` — pass `-o md` for chat), `--base-url` (pkg.go.dev API), `--vuln-base-url` (Go vulnerability database, consulted by `vulns` and `overview`), `--timeout`, `--log-level debug|info|warn|error|off`. All are also settable via `GODIG_*` env vars. |
| 57 | |
| 58 | | Command | Args | Specific flags | Purpose | |
| 59 | | --- | --- | --- | --- | |
| 60 | | `overview` | `<path>` | `--version` | Compact summary (metadata, versions, licenses, vulns) — start here | |
| 61 | | `search` | `<query>` | `--symbol --limit --filter` | Find packages (optionally exporting a symbol) | |
| 62 | | `package info` | `<path>` | `--module --version` | Package metadata | |
| 63 | | `package imports` | `<path>` | `--module --version` | Packages this package imports (plain list) | |
| 64 | | `package doc` | `<path>` | `--module --version --goos --goarch --format md\|text\|html\|markdown` | Full package doc (LARGE) | |
| 65 | | `package examples` | `<path>` | `--module --version --goos --goarch -- |