summaryrefslogtreecommitdiff
path: root/internal/version/version.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-05 17:41:52 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-05 17:41:52 +0000
commitf7c6de4f99649dfa19c6b20b5a3fb344c4f8e82c (patch)
treeeee4a4a1e33f07194412f84fde17f7464b6430e2 /internal/version/version.go
parentddfb922584dd990481f44aad1a989e5bdf188823 (diff)
cli: add start command and version package
Adds `claudomator start <task-id>` to queue a task via the running API server. Adds internal/version for embedding VCS commit hash in the server banner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/version/version.go')
-rw-r--r--internal/version/version.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/version/version.go b/internal/version/version.go
new file mode 100644
index 0000000..35136d4
--- /dev/null
+++ b/internal/version/version.go
@@ -0,0 +1,20 @@
+package version
+
+import "runtime/debug"
+
+// Version returns the VCS commit hash embedded by `go build`, or "dev" if unavailable.
+func Version() string {
+ info, ok := debug.ReadBuildInfo()
+ if !ok {
+ return "dev"
+ }
+ for _, s := range info.Settings {
+ if s.Key == "vcs.revision" {
+ if len(s.Value) > 8 {
+ return s.Value[:8]
+ }
+ return s.Value
+ }
+ }
+ return "dev"
+}