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

Method metadataRefreshCommand

internal/cli/metadata.go:25–51  ·  view source on GitHub ↗
(state *globalState)

Source from the content-addressed store, hash-verified

23}
24
25func (a *App) metadataRefreshCommand(state *globalState) *cobra.Command {
26 return &cobra.Command{
27 Use: "refresh",
28 Short: "Refresh metadata index from configured repositories",
29 Args: cobra.NoArgs,
30 RunE: func(cmd *cobra.Command, args []string) error {
31 out := cmd.OutOrStdout()
32 store := metadata.NewStore(state.storePath)
33 svc := metadata.NewService(store)
34
35 summary, err := svc.RefreshAll(context.Background())
36 if err != nil {
37 return fmt.Errorf("refresh failed: %w", err)
38 }
39 fmt.Fprintf(out, "✓ Refreshed metadata\n")
40 fmt.Fprintf(out, " Sources scanned: %d\n", summary.SourcesScanned)
41 fmt.Fprintf(out, " Items indexed: %d\n", summary.ItemsAdded)
42 if len(summary.FailedSources) > 0 {
43 fmt.Fprintf(out, " Failed sources: %d\n", len(summary.FailedSources))
44 for _, f := range summary.FailedSources {
45 fmt.Fprintf(out, " - %s\n", f)
46 }
47 }
48 return nil
49 },
50 }
51}
52
53func (a *App) metadataSearchCommand(state *globalState) *cobra.Command {
54 var kindFilter string

Callers 1

metadataCommandMethod · 0.95

Calls 3

RefreshAllMethod · 0.95
NewStoreFunction · 0.92
NewServiceFunction · 0.92

Tested by

no test coverage detected