MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / configShowCommand

Method configShowCommand

internal/cli/config_cmd.go:101–130  ·  view source on GitHub ↗
(state *globalState)

Source from the content-addressed store, hash-verified

99}
100
101func (a *App) configShowCommand(state *globalState) *cobra.Command {
102 var app string
103 var scope string
104 cmd := &cobra.Command{
105 Use: "show [KEY]",
106 Short: "Show configuration",
107 Args: cobra.MaximumNArgs(1),
108 RunE: func(cmd *cobra.Command, args []string) error {
109 out := cmd.OutOrStdout()
110 // Editor mode wins when --app is explicit.
111 if app != "" {
112 return showEditorConfig(out, app, scope, args)
113 }
114 // Legacy CAM-config mode: dump the contents of --config.
115 if state.configPath != "" {
116 data, err := os.ReadFile(state.configPath)
117 if err != nil {
118 return err
119 }
120 _, err = out.Write(data)
121 return err
122 }
123 // Default to editor mode with claude as in Python.
124 return showEditorConfig(out, "claude", scope, args)
125 },
126 }
127 cmd.Flags().StringVarP(&app, "app", "a", "", "Editor to show configuration for")
128 cmd.Flags().StringVarP(&scope, "scope", "s", "", "Filter by scope (user|project)")
129 return cmd
130}
131
132func showEditorConfig(out interface{ Write(p []byte) (int, error) }, app string, scope string, args []string) error {
133 tool, ok := editorconfig.DefaultRegistry().Get(app)

Callers 1

configCommandMethod · 0.95

Calls 3

showEditorConfigFunction · 0.85
ReadFileMethod · 0.80
WriteMethod · 0.80

Tested by

no test coverage detected