feat(P01): CLI skeleton with Cobra, subcommand stubs, pre-push hook
Implements Phase 1 of v0.1 Foundation:
- go.mod with Go 1.25
- cmd/orca/main.go entry point
- internal/cli/root.go with global --json flag
- internal/cli/version.go (orca version)
- internal/cli/init.go (orca init - creates ~/.orca/)
- internal/cli/status.go (orca status - shows daemon info)
- internal/cli/node.go (orca node {join,leave,list} - stubs)
- internal/cli/job.go (orca job {run,list,stop,logs} - stubs)
- Makefile (build, test, lint, fmt, release)
- LICENSE (MIT)
- README.md with quickstart
- .gitignore
- .githooks/pre-push + scripts/trigger_coreci.sh (CoreCI trigger)
- Smoke tests in internal/cli/root_test.go
Verified: go build, go test, go vet, gofmt all pass.
---ci---
project: orca
phase: 1
milestone: v0.1
status: execute
req_covered:
- REQ-001
- REQ-002
- REQ-013
- REQ-015
- REQ-016
- REQ-019
- REQ-024
---/ci---
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var nodeCmd = &cobra.Command{
|
||||
Use: "node",
|
||||
Short: "Manage orca nodes",
|
||||
Long: "Join, leave, or list orca nodes in the cluster.",
|
||||
}
|
||||
|
||||
var nodeJoinCmd = &cobra.Command{
|
||||
Use: "join",
|
||||
Short: "Join a node to the orca cluster",
|
||||
Long: "Register the local node with the orca cluster. Implemented in Phase 2.",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return notImplemented("orca node join")
|
||||
},
|
||||
}
|
||||
|
||||
var nodeLeaveCmd = &cobra.Command{
|
||||
Use: "leave",
|
||||
Short: "Remove a node from the orca cluster",
|
||||
Long: "Deregister a node from the orca cluster. Implemented in Phase 2.",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return notImplemented("orca node leave")
|
||||
},
|
||||
}
|
||||
|
||||
var nodeListCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List all nodes in the orca cluster",
|
||||
Long: "Display all registered nodes. Implemented in Phase 2.",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return notImplemented("orca node list")
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
nodeCmd.AddCommand(nodeJoinCmd)
|
||||
nodeCmd.AddCommand(nodeLeaveCmd)
|
||||
nodeCmd.AddCommand(nodeListCmd)
|
||||
rootCmd.AddCommand(nodeCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user