Files
wehub-resource-sync a06f331eb8
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:33:42 +08:00

51 lines
1.5 KiB
Go

package main
import (
"fmt"
"strings"
"github.com/spf13/cobra"
"github.com/zzet/gortex/internal/mcp"
)
// guideCmd prints the Gortex reference guide — the same content served by the
// `gortex://guide` MCP resource, for harnesses without MCP-resource support or
// for shell use. The installed CLAUDE.md carries only the mandatory policy
// core and points here for everything else.
var guideCmd = &cobra.Command{
Use: "guide [topic]",
Short: "Print the Gortex reference guide (providers, capabilities, tokens, analyze, search_ast, resources, workflow)",
Long: `Prints the Gortex reference guide — the on-demand home for detail that is
not pre-paid in the installed CLAUDE.md: the LLM-provider matrix, the
non-obvious capabilities catalog, the token-economy deep-dive, the MCP
resources list, and the analyze / search_ast catalogs.
With no argument the full guide is printed with a topic index. Pass a topic
to print just that section:
gortex guide providers
gortex guide capabilities
gortex guide tokens
gortex guide analyze
gortex guide search_ast
gortex guide resources
gortex guide workflow
The same content is served by the ` + "`gortex://guide`" + ` MCP resource
(section-addressable at ` + "`gortex://guide/{topic}`" + `).`,
Args: cobra.MaximumNArgs(1),
ValidArgs: mcp.GuideTopics(),
Run: func(cmd *cobra.Command, args []string) {
topic := ""
if len(args) == 1 {
topic = args[0]
}
fmt.Fprint(cmd.OutOrStdout(), strings.TrimRight(mcp.GuideText(topic), "\n")+"\n")
},
}
func init() {
rootCmd.AddCommand(guideCmd)
}