Run a search against pkg.go.dev via pkgsite-cli search and present the results.
Prerequisite
Confirm pkgsite-cli is on PATH:
command -v pkgsite-cli >/dev/null 2>&1 && echo OK || echo MISSING
If MISSING, use the Skill tool with skill="gpd-discovery" — it owns the install-on-first-use bootstrap flow. Do not auto-install without confirmation.
Process
Parse
$ARGUMENTS:- Treat as pass-through CLI args. The user's input maps directly onto
pkgsite-cli searchflags. - If the user supplied natural language without flags, the entire input is the query string.
- Common flags:
-symbol <name>,-limit <n>,-json,-x(print URL).
- Treat as pass-through CLI args. The user's input maps directly onto
Run the search:
pkgsite-cli search $ARGUMENTSFor the
-jsoncase, capture stdout and parse thePaginatedResponse[SearchResult]shape:Items[].PackagePath,ModulePath,Version,SynopsisTotal,NextPageToken
Present results:
- Show the raw CLI output verbatim (one search hit per line is already readable).
- Add a brief synthesis below: top 3-5 most relevant results with one-line rationale, plus a note if
Total > shown countsuggesting-limitto widen. - For
-symbolsearches, highlight which packages actually re-export the symbol vs. transitive matches.
Error handling:
- Non-zero exit → surface the CLI's error message verbatim, then suggest the most likely fix (e.g., network, typo in symbol name).
- Empty results → suggest alternative spellings or related symbols before giving up.
Example Usage
| Invocation | Translated to |
|---|---|
/gpd-search uuid |
pkgsite-cli search uuid |
/gpd-search -symbol Marshal json |
pkgsite-cli search -symbol Marshal json |
/gpd-search -limit 50 grpc gateway |
pkgsite-cli search -limit 50 grpc gateway |
Related
gpd-packagefor inspecting a specific result in depthgpd-modulefor module-level metadata of a result's owning modulegpd-discoveryfor the broader decision tree on which subcommand to use