chore: missing filter arg on serve (#1583)

Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
This commit is contained in:
Alex Jones
2025-10-16 08:27:39 +01:00
committed by GitHub
parent 83c5d67084
commit f1d2e306f3
2 changed files with 7 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ var (
enableMCP bool
mcpPort string
mcpHTTP bool
// filters can be injected into the server (repeatable flag)
filters []string
)
var ServeCmd = &cobra.Command{
@@ -208,6 +210,7 @@ var ServeCmd = &cobra.Command{
EnableHttp: enableHttp,
Token: aiProvider.Password,
Logger: logger,
Filters: filters,
}
go func() {
if err := server.ServeMetrics(); err != nil {
@@ -237,4 +240,6 @@ func init() {
ServeCmd.Flags().BoolVarP(&enableMCP, "mcp", "", false, "Enable Mission Control Protocol server")
ServeCmd.Flags().StringVarP(&mcpPort, "mcp-port", "", "8089", "Port to run the MCP server on")
ServeCmd.Flags().BoolVarP(&mcpHTTP, "mcp-http", "", false, "Enable HTTP mode for MCP server")
// allow injecting filters into the running server (repeatable)
ServeCmd.Flags().StringSliceVar(&filters, "filter", []string{}, "Filter to apply (can be specified multiple times)")
}

View File

@@ -54,6 +54,8 @@ type Config struct {
AnalyzeHandler *analyze.Handler
QueryHandler *query.Handler
Logger *zap.Logger
// Filters can be injected into the server to limit analysis to specific analyzers
Filters []string
metricsServer *http.Server
listener net.Listener
EnableHttp bool