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

Method configListCommand

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

Source from the content-addressed store, hash-verified

38}
39
40func (a *App) configListCommand(state *globalState) *cobra.Command {
41 return &cobra.Command{
42 Use: "list",
43 Short: "List configuration files",
44 Args: cobra.NoArgs,
45 RunE: func(cmd *cobra.Command, args []string) error {
46 out := cmd.OutOrStdout()
47 fmt.Fprintln(out, "CAM configuration:")
48 for _, p := range []string{
49 filepath.Join(pathutil.ConfigDir(), "cam.db"),
50 filepath.Join(pathutil.ConfigDir(), "config.yaml"),
51 filepath.Join(pathutil.Home(), ".env"),
52 } {
53 marker := " "
54 if pathutil.Exists(p) {
55 marker = "✓"
56 }
57 fmt.Fprintf(out, " %s %s\n", marker, p)
58 }
59 fmt.Fprintln(out, "\nEditor configurations:")
60 registry := editorconfig.DefaultRegistry()
61 for _, name := range registry.Names() {
62 tool, _ := registry.Get(name)
63 fmt.Fprintf(out, "\n %s (%s):\n", tool.Description(), tool.Name())
64 for _, p := range tool.UserPaths() {
65 marker := " "
66 if pathutil.Exists(p) {
67 marker = "✓"
68 }
69 fmt.Fprintf(out, " %s %s\n", marker, p)
70 }
71 if pp := tool.ProjectPath(); pp != "" {
72 marker := " "
73 if pathutil.Exists(pp) {
74 marker = "✓"
75 }
76 fmt.Fprintf(out, " %s %s\n", marker, pp)
77 }
78 }
79 return nil
80 },
81 }
82}
83
84func (a *App) configValidateCommand(state *globalState) *cobra.Command {
85 return &cobra.Command{

Callers 1

configCommandMethod · 0.95

Calls 10

ConfigDirFunction · 0.92
HomeFunction · 0.92
ExistsFunction · 0.92
DefaultRegistryFunction · 0.92
DescriptionMethod · 0.65
NameMethod · 0.65
UserPathsMethod · 0.65
ProjectPathMethod · 0.65
NamesMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected