Files
orca/internal/cli/version.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

30 lines
621 B
Go

package cli
import (
"github.com/spf13/cobra"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print version information",
Long: "Print the orca version, git commit, and build time.",
RunE: func(cmd *cobra.Command, args []string) error {
info := map[string]string{
"version": version,
"git_commit": gitCommit,
"build_time": buildTime,
}
if jsonOutput {
return printJSON(info)
}
printText("orca version %s\n", version)
printText(" git commit: %s\n", gitCommit)
printText(" build time: %s\n", buildTime)
return nil
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}