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

Function newConfigReloadCommand

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

Source from the content-addressed store, hash-verified

765}
766
767func newConfigReloadCommand(deps commandDeps) *cobra.Command {
768 cmd := &cobra.Command{
769 Use: configReloadCommandName,
770 Short: "Reconcile config.toml with the daemon active generation",
771 Args: cobra.NoArgs,
772 RunE: func(cmd *cobra.Command, _ []string) error {
773 client, err := clientFromDeps(deps)
774 if err != nil {
775 return fmt.Errorf("cli: create daemon client for config reload: %w", err)
776 }
777 result, err := client.ReloadSettings(cmd.Context())
778 if err != nil {
779 return fmt.Errorf("cli: reload config via daemon settings surface: %w", err)
780 }
781 return writeCommandOutput(cmd, configSetBundle(configSetRecord{
782 Path: "config.toml",
783 Value: configReloadCommandName,
784 Scope: string(aghconfig.WriteScopeGlobal),
785 Target: "daemon",
786 Lifecycle: string(result.Lifecycle),
787 ApplyRecordID: result.ApplyRecordID,
788 Applied: result.Applied,
789 ActiveGeneration: result.ActiveGeneration,
790 ActiveConfigHash: result.ActiveConfigHash,
791 NextAction: string(result.NextAction),
792 RestartRequired: result.RestartRequired,
793 RestartScope: result.RestartScope,
794 }))
795 },
796 }
797 return cmd
798}
799
800func newConfigApplyHistoryCommand(deps commandDeps) *cobra.Command {
801 var status string

Callers 1

newConfigCommandFunction · 0.85

Calls 4

clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
configSetBundleFunction · 0.85
ReloadSettingsMethod · 0.65

Tested by

no test coverage detected