55// Command pkgsite-cli queries the pkg.go.dev API for information about
66// Go packages and modules.
77//
8- // Usage:
8+ // For more information, see https://go.dev/blog/pkgsite-api.
99//
10- // pkgsite-cli package <package>[@version] [flags] package information
11- // pkgsite-cli module <module>[@version] [flags] module information
12- // pkgsite-cli search <query> [flags] search for packages
10+ // Usage:
1311//
14- // See doc/pkgsite-cli.md for the full design document.
12+ // pkgsite-cli package <package>[@version] [flags] Show package details.
13+ // pkgsite-cli module <module>[@version] [flags] Show module details.
14+ // pkgsite-cli search <query> [flags] Search for packages.
1515package main
1616
1717import (
@@ -57,7 +57,10 @@ func commands() []*command {
5757
5858 pkgRun := func (fs * flag.FlagSet , stdout , stderr io.Writer ) int { return runPackage (fs , & pf , stdout , stderr ) }
5959
60- const packageDoc = `
60+ const packageDoc = `Queries information about a specific Go package from pkg.go.dev.
61+ By default, this prints basic metadata. Use flags to request additional
62+ information such as exported symbols, reverse dependencies, or rendered documentation.
63+
6164When using -json, the output is a JSON object with the following structure:
6265
6366 type packageResult struct {
@@ -88,7 +91,10 @@ When using -json, the output is a JSON object with the following structure:
8891 }
8992`
9093
91- const moduleDoc = `
94+ const moduleDoc = `Queries information about a specific Go module from pkg.go.dev.
95+ By default, this prints basic metadata. Use flags to request additional
96+ information such as versions, vulnerabilities, or packages contained in the module.
97+
9298When using -json, the output is a JSON object with the following structure:
9399
94100 type moduleResult struct {
@@ -113,7 +119,9 @@ When using -json, the output is a JSON object with the following structure:
113119 }
114120`
115121
116- const searchDoc = `
122+ const searchDoc = `Searches for Go packages on pkg.go.dev matching the given query.
123+ By default, this prints a list of matching packages with their synopsis.
124+
117125When using -json, the output is a JSON object with the following structure:
118126
119127 type PaginatedResponse[SearchResult] struct {
@@ -135,35 +143,35 @@ When using -json, the output is a JSON object with the following structure:
135143 {
136144 name : "package" ,
137145 args : "<package>[@version]" ,
138- summary : "package information " ,
146+ summary : "Show package details " ,
139147 description : strings .TrimSpace (packageDoc ),
140148 flags : pkgFS ,
141149 run : pkgRun ,
142150 },
143151 {
144152 name : "module" ,
145153 args : "<module>[@version]" ,
146- summary : "module information " ,
154+ summary : "Show module details " ,
147155 description : strings .TrimSpace (moduleDoc ),
148156 flags : modFS ,
149157 run : func (fs * flag.FlagSet , stdout , stderr io.Writer ) int { return runModule (fs , & mf , stdout , stderr ) },
150158 },
151159 {
152160 name : "search" ,
153161 args : "<query>" ,
154- summary : "search for packages" ,
162+ summary : "Search for packages" ,
155163 description : strings .TrimSpace (searchDoc ),
156164 flags : searchFS ,
157165 run : func (fs * flag.FlagSet , stdout , stderr io.Writer ) int { return runSearch (fs , & sf , stdout , stderr ) },
158166 },
159167 {
160168 name : "help" ,
161- summary : "show this help message" ,
169+ summary : "Show this help message" ,
162170 run : func (_ * flag.FlagSet , stdout , _ io.Writer ) int { printUsage (stdout , cmds ); return 0 },
163171 },
164172 {
165173 name : "version" ,
166- summary : "print version information" ,
174+ summary : "Print version information" ,
167175 run : func (_ * flag.FlagSet , stdout , _ io.Writer ) int { fmt .Fprintln (stdout , versionInfo ()); return 0 },
168176 },
169177 }
0 commit comments