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

Function newConfigGetCommand

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

Source from the content-addressed store, hash-verified

402}
403
404func newConfigGetCommand(deps commandDeps) *cobra.Command {
405 var workspaceRoot string
406 cmd := &cobra.Command{
407 Use: "get <path>",
408 Short: "Get one redacted effective config value",
409 Args: exactOneNonBlankArg(),
410 RunE: func(cmd *cobra.Command, args []string) error {
411 cfg, _, err := loadConfigForDisplay(deps, workspaceRoot)
412 if err != nil {
413 return err
414 }
415 path := strings.TrimSpace(args[0])
416 for _, entry := range flattenConfigEntries(redactedConfigMap(&cfg)) {
417 if entry.Path == path {
418 return writeCommandOutput(cmd, configValueBundle(configValueRecord(entry)))
419 }
420 }
421 return fmt.Errorf("cli: config path %q not found", path)
422 },
423 }
424 cmd.Flags().StringVar(&workspaceRoot, "workspace", "", "Workspace root whose overlay should be included")
425 return cmd
426}
427
428func newConfigSetCommand(deps commandDeps) *cobra.Command {
429 var (

Callers 1

newConfigCommandFunction · 0.85

Calls 7

exactOneNonBlankArgFunction · 0.85
loadConfigForDisplayFunction · 0.85
flattenConfigEntriesFunction · 0.85
redactedConfigMapFunction · 0.85
writeCommandOutputFunction · 0.85
configValueBundleFunction · 0.85
configValueRecordStruct · 0.85

Tested by

no test coverage detected