cli/cmd/core/config/cmd_get.go
Snider b541ce7657 fix: migrate module paths from forge.lthn.ai to dappco.re
- Update all Go source imports: forge.lthn.ai/core/* → dappco.re/go/core/*
- Update go.mod module declaration and require paths
- Regenerate go.sum (top-level pkg/cli module)
- cmd/core go.sum pending: dappco.re/go/core/devops needs republish
  without forge.lthn.ai/core/go-container source imports

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-07 12:05:47 +01:00

29 lines
587 B
Go

package config
import (
"dappco.re/go/core/cli/pkg/cli"
)
func addGetCommand(parent *cli.Command) {
cmd := cli.NewCommand("get", "Get a configuration value", "", func(cmd *cli.Command, args []string) error {
key := args[0]
configuration, err := loadConfig()
if err != nil {
return err
}
var value any
if err := configuration.Get(key, &value); err != nil {
return cli.Err("key not found: %s", key)
}
cli.Println("%v", value)
return nil
})
cli.WithArgs(cmd, cli.ExactArgs(1))
cli.WithExample(cmd, "core config get dev.editor")
parent.AddCommand(cmd)
}