All import paths updated to git.wntrmute.dev/mc/. Bumps mcdsl to v1.2.0, mc-proxy to v1.1.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
52 lines
959 B
Go
52 lines
959 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
|
|
"git.wntrmute.dev/mc/mcp/internal/agent"
|
|
"git.wntrmute.dev/mc/mcp/internal/config"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
version = "dev"
|
|
cfgPath string
|
|
)
|
|
|
|
func main() {
|
|
root := &cobra.Command{
|
|
Use: "mcp-agent",
|
|
Short: "Metacircular Control Plane agent",
|
|
}
|
|
root.PersistentFlags().StringVarP(&cfgPath, "config", "c", "", "config file path")
|
|
|
|
root.AddCommand(&cobra.Command{
|
|
Use: "version",
|
|
Short: "Print version",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println(version)
|
|
},
|
|
})
|
|
|
|
root.AddCommand(&cobra.Command{
|
|
Use: "server",
|
|
Short: "Start the agent server",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
cfg, err := config.LoadAgentConfig(cfgPath)
|
|
if err != nil {
|
|
return fmt.Errorf("load config: %w", err)
|
|
}
|
|
return agent.Run(cfg)
|
|
},
|
|
})
|
|
|
|
root.AddCommand(snapshotCmd())
|
|
|
|
if err := root.Execute(); err != nil {
|
|
log.Fatal(err)
|
|
os.Exit(1)
|
|
}
|
|
}
|