Add initial Go CLI skeleton
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package orch
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
type rootOptions struct {
|
||||
dbPath string
|
||||
json bool
|
||||
}
|
||||
|
||||
func NewRootCmd() *cobra.Command {
|
||||
opts := &rootOptions{}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "orch",
|
||||
Short: "Leader-facing scheduler and control plane",
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().StringVar(&opts.dbPath, "db", ".agents/coord.db", "SQLite database path")
|
||||
cmd.PersistentFlags().BoolVar(&opts.json, "json", false, "Emit machine-readable JSON")
|
||||
|
||||
cmd.AddCommand(newRunCmd())
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package orch
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func newRunCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "run",
|
||||
Short: "Run management commands",
|
||||
}
|
||||
|
||||
cmd.AddCommand(&cobra.Command{
|
||||
Use: "init",
|
||||
Short: "Stub for future run initialization",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return cmd.Help()
|
||||
},
|
||||
})
|
||||
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user