Skip to content

Commit b4b0dd2

Browse files
taskbotclaude
andcommitted
Fix lint issues and regenerate CLI docs
- Rename pkg/llm types to drop LLM prefix (revive stutter: LLMConfig → Config, LLMOIDCConfig → OIDCConfig, etc.) - Fix unused cmd parameter in config show RunE (revive) - Use FormatJSON constant instead of raw "json" string (goconst) - Fix gci import ordering in pkg/config/config.go - Regenerate docs/cli/ for the new thv llm command group Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 020220c commit b4b0dd2

14 files changed

Lines changed: 446 additions & 73 deletions

cmd/thv/app/llm.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ authentication transparently. Two modes are supported:
3434
Run "thv llm setup" to get started.`,
3535
}
3636

37-
cmd.AddCommand(newLLMConfigCommand())
37+
cmd.AddCommand(newConfigCommand())
3838
cmd.AddCommand(newLLMSetupCommand())
3939
cmd.AddCommand(newLLMTeardownCommand())
4040
cmd.AddCommand(newLLMProxyCommand())
@@ -45,21 +45,21 @@ Run "thv llm setup" to get started.`,
4545

4646
// ── config subcommand group ───────────────────────────────────────────────────
4747

48-
func newLLMConfigCommand() *cobra.Command {
48+
func newConfigCommand() *cobra.Command {
4949
cmd := &cobra.Command{
5050
Use: "config",
5151
Short: "Manage LLM gateway configuration",
5252
Long: "The config command provides subcommands to manage LLM gateway connection settings.",
5353
}
5454

55-
cmd.AddCommand(newLLMConfigSetCommand())
56-
cmd.AddCommand(newLLMConfigShowCommand())
57-
cmd.AddCommand(newLLMConfigResetCommand())
55+
cmd.AddCommand(newConfigSetCommand())
56+
cmd.AddCommand(newConfigShowCommand())
57+
cmd.AddCommand(newConfigResetCommand())
5858

5959
return cmd
6060
}
6161

62-
func newLLMConfigSetCommand() *cobra.Command {
62+
func newConfigSetCommand() *cobra.Command {
6363
var (
6464
gatewayURL string
6565
issuer string
@@ -115,18 +115,18 @@ Example:
115115
return cmd
116116
}
117117

118-
func newLLMConfigShowCommand() *cobra.Command {
118+
func newConfigShowCommand() *cobra.Command {
119119
var outputFormat string
120120

121121
cmd := &cobra.Command{
122122
Use: "show",
123123
Short: "Display current LLM gateway configuration",
124124
Args: cobra.NoArgs,
125-
RunE: func(cmd *cobra.Command, _ []string) error {
125+
RunE: func(_ *cobra.Command, _ []string) error {
126126
provider := config.NewDefaultProvider()
127127
llmCfg := provider.GetConfig().LLM
128128

129-
if outputFormat == "json" {
129+
if outputFormat == FormatJSON {
130130
enc, err := json.MarshalIndent(llmCfg, "", " ")
131131
if err != nil {
132132
return fmt.Errorf("failed to encode config as JSON: %w", err)
@@ -164,7 +164,7 @@ func newLLMConfigShowCommand() *cobra.Command {
164164
return cmd
165165
}
166166

167-
func newLLMConfigResetCommand() *cobra.Command {
167+
func newConfigResetCommand() *cobra.Command {
168168
return &cobra.Command{
169169
Use: "reset",
170170
Short: "Clear all LLM gateway configuration and cached tokens",
@@ -179,7 +179,7 @@ tokens from the secrets provider.`,
179179
}
180180

181181
return config.UpdateConfig(func(c *config.Config) error {
182-
c.LLM = llm.LLMConfig{}
182+
c.LLM = llm.Config{}
183183
return nil
184184
})
185185
},

docs/cli/thv.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_llm.md

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_llm_config.md

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_llm_config_reset.md

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_llm_config_set.md

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_llm_config_show.md

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_llm_proxy.md

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_llm_proxy_start.md

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)