| 35 | } |
| 36 | |
| 37 | func rootCmd() *cobra.Command { |
| 38 | var cfgPath string |
| 39 | root := &cobra.Command{ |
| 40 | Use: "infercore", |
| 41 | Short: "InferCore AI request control plane", |
| 42 | Long: `InferCore is an open-source AI inference control plane (routing, policy, RAG orchestration, reliability). |
| 43 | |
| 44 | Project website: https://infercore.dev`, |
| 45 | } |
| 46 | root.PersistentFlags().StringVar(&cfgPath, "config", envOr("INFERCORE_CONFIG", "configs/infercore.example.yaml"), "path to YAML config") |
| 47 | |
| 48 | root.AddCommand(serveCmd(&cfgPath)) |
| 49 | root.AddCommand(traceCmd(&cfgPath)) |
| 50 | root.AddCommand(replayCmd(&cfgPath)) |
| 51 | root.AddCommand(ledgerCmd(&cfgPath)) |
| 52 | root.AddCommand(evalCmd()) |
| 53 | return root |
| 54 | } |
| 55 | |
| 56 | func envOr(key, def string) string { |
| 57 | if v := strings.TrimSpace(os.Getenv(key)); v != "" { |