Skip to content

Commit 75373de

Browse files
committed
Fix config subcommand
Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
1 parent d87a71b commit 75373de

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

cmd/thv/config.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/spf13/cobra"
77

88
"github.com/stacklok/toolhive/pkg/config"
9-
"github.com/stacklok/toolhive/pkg/logger"
109
"github.com/stacklok/toolhive/pkg/secrets"
1110
)
1211

@@ -102,7 +101,7 @@ func secretsProviderCmdFunc(_ *cobra.Command, args []string) error {
102101
return fmt.Errorf("failed to save configuration: %w", err)
103102
}
104103

105-
logger.Log.Info(fmt.Sprintf("Secrets provider type updated to: %s", provider))
104+
fmt.Printf("Secrets provider type updated to: %s\n", provider)
106105
return nil
107106
}
108107

@@ -131,7 +130,7 @@ func autoDiscoveryCmdFunc(_ *cobra.Command, args []string) error {
131130
return fmt.Errorf("failed to save configuration: %w", err)
132131
}
133132

134-
logger.Log.Info(fmt.Sprintf("Auto-discovery of MCP clients %s", map[bool]string{true: "enabled", false: "disabled"}[enabled]))
133+
fmt.Printf("Auto-discovery of MCP clients %s\n", map[bool]string{true: "enabled", false: "disabled"}[enabled])
135134
return nil
136135
}
137136

@@ -164,7 +163,7 @@ func registerClientCmdFunc(_ *cobra.Command, args []string) error {
164163
return fmt.Errorf("failed to save configuration: %w", err)
165164
}
166165

167-
logger.Log.Info(fmt.Sprintf("Successfully registered client: %s", client))
166+
fmt.Printf("Successfully registered client: %s\n", client)
168167
return nil
169168
}
170169

@@ -202,7 +201,7 @@ func removeClientCmdFunc(_ *cobra.Command, args []string) error {
202201
return fmt.Errorf("failed to save configuration: %w", err)
203202
}
204203

205-
logger.Log.Info(fmt.Sprintf("Successfully removed client: %s", client))
204+
fmt.Printf("Successfully removed client: %s\n", client)
206205
return nil
207206
}
208207

@@ -212,14 +211,14 @@ func listRegisteredClientsCmdFunc(_ *cobra.Command, _ []string) error {
212211

213212
// Check if there are any registered clients
214213
if len(cfg.Clients.RegisteredClients) == 0 {
215-
logger.Log.Info("No clients are currently registered.")
214+
fmt.Println("No clients are currently registered.")
216215
return nil
217216
}
218217

219218
// Print the list of registered clients
220-
logger.Log.Info("Registered clients:")
219+
fmt.Println("Registered clients:")
221220
for _, client := range cfg.Clients.RegisteredClients {
222-
logger.Log.Info(fmt.Sprintf(" - %s", client))
221+
fmt.Printf(" - %s\n", client)
223222
}
224223

225224
return nil

0 commit comments

Comments
 (0)