Files
orca/internal/cli/job.go
T
Jon Chery aa3cccead5 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---
2026-06-03 12:23:37 +00:00

75 lines
1.9 KiB
Go

package cli
import (
"fmt"
"github.com/spf13/cobra"
)
var jobCmd = &cobra.Command{
Use: "job",
Short: "Manage orca jobs",
Long: "Run, list, stop, and inspect orca jobs.",
}
var jobRunCmd = &cobra.Command{
Use: "run <spec.hcl>",
Short: "Run a job from an HCL spec file",
Long: "Submit a job spec and execute it. Implemented in Phase 3.",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return notImplemented("orca job run " + args[0])
},
}
var jobListCmd = &cobra.Command{
Use: "list",
Short: "List all jobs",
Long: "Display all jobs and their status. Implemented in Phase 3.",
RunE: func(cmd *cobra.Command, args []string) error {
return notImplemented("orca job list")
},
}
var jobStopCmd = &cobra.Command{
Use: "stop <job-id>",
Short: "Stop a running job",
Long: "Stop a job by ID. Implemented in Phase 3.",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return notImplemented("orca job stop " + args[0])
},
}
var jobLogsCmd = &cobra.Command{
Use: "logs <job-id>",
Short: "Show logs for a job",
Long: "Display the logs for a job by ID. Implemented in Phase 3.",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return notImplemented("orca job logs " + args[0])
},
}
func init() {
jobCmd.AddCommand(jobRunCmd)
jobCmd.AddCommand(jobListCmd)
jobCmd.AddCommand(jobStopCmd)
jobCmd.AddCommand(jobLogsCmd)
rootCmd.AddCommand(jobCmd)
}
func notImplemented(cmd string) error {
if jsonOutput {
return printJSON(map[string]any{
"command": cmd,
"status": "not_implemented",
"phase": "1-cli-skeleton",
"next": "Phase 2-6 will implement this",
})
}
fmt.Fprintf(rootCmd.ErrOrStderr(), "✗ %s: not yet implemented (Phase 1: CLI skeleton only)\n", cmd)
fmt.Fprintf(rootCmd.ErrOrStderr(), " see .ciagent/ROADMAP.md for the full 6-phase plan\n")
return fmt.Errorf("not implemented: %s", cmd)
}