Some checks are pending
Security Scan / security (push) Waiting to run
- Remove banned imports (fmt, log, errors, os, strings, path/filepath, encoding/json) from all cmd/ packages; replace with core.* primitives and cli.* wrappers - Rename abbreviated variables (cfg→configuration, reg→registry, cmd→proc, c→toolCheck/checkBuilder, sb→builder, out→output, r→repo/reason, b→branchName) across config, doctor, pkgcmd, help - Add usage-example comments to all exported functions in pkg/cli (strings.go, log.go, i18n.go) - Add complete Good/Bad/Ugly test triads to all pkg/cli test files: new files for command, errors, frame_components, i18n, log, render, runtime, strings, utils; updated existing check, daemon, glyph, layout, output, ansi, commands, frame, prompt, stream, styles, tracker, tree Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
639 B
Go
27 lines
639 B
Go
package config
|
|
|
|
import (
|
|
"forge.lthn.ai/core/cli/pkg/cli"
|
|
"forge.lthn.ai/core/config"
|
|
)
|
|
|
|
// AddConfigCommands registers the 'config' command group and all subcommands.
|
|
//
|
|
// config.AddConfigCommands(rootCmd)
|
|
func AddConfigCommands(root *cli.Command) {
|
|
configCmd := cli.NewGroup("config", "Manage configuration", "")
|
|
root.AddCommand(configCmd)
|
|
|
|
addGetCommand(configCmd)
|
|
addSetCommand(configCmd)
|
|
addListCommand(configCmd)
|
|
addPathCommand(configCmd)
|
|
}
|
|
|
|
func loadConfig() (*config.Config, error) {
|
|
configuration, err := config.New()
|
|
if err != nil {
|
|
return nil, cli.Wrap(err, "failed to load config")
|
|
}
|
|
return configuration, nil
|
|
}
|