MCPcopy Create free account
hub / github.com/compozy/agh / newConfigShowCommand

Function newConfigShowCommand

internal/cli/config.go:354–378  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

352}
353
354func newConfigShowCommand(deps commandDeps) *cobra.Command {
355 var workspaceRoot string
356 cmd := &cobra.Command{
357 Use: configShowKey,
358 Short: "Show the redacted effective config",
359 Args: cobra.NoArgs,
360 RunE: func(cmd *cobra.Command, _ []string) error {
361 cfg, resolvedWorkspace, err := loadConfigForDisplay(deps, workspaceRoot)
362 if err != nil {
363 return err
364 }
365 configMap := redactedConfigMap(&cfg)
366 entries := flattenConfigEntries(configMap)
367 record := configShowRecord{
368 Scope: scopeForWorkspace(resolvedWorkspace),
369 WorkspaceRoot: resolvedWorkspace,
370 Redacted: true,
371 Config: configMap,
372 }
373 return writeCommandOutput(cmd, configShowBundle(record, entries))
374 },
375 }
376 cmd.Flags().StringVar(&workspaceRoot, "workspace", "", "Workspace root whose overlay should be included")
377 return cmd
378}
379
380func newConfigListCommand(deps commandDeps) *cobra.Command {
381 var workspaceRoot string

Callers 1

newConfigCommandFunction · 0.85

Calls 6

loadConfigForDisplayFunction · 0.85
redactedConfigMapFunction · 0.85
flattenConfigEntriesFunction · 0.85
scopeForWorkspaceFunction · 0.85
writeCommandOutputFunction · 0.85
configShowBundleFunction · 0.85

Tested by

no test coverage detected