diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-05 17:41:52 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-05 17:41:52 +0000 |
| commit | f7c6de4f99649dfa19c6b20b5a3fb344c4f8e82c (patch) | |
| tree | eee4a4a1e33f07194412f84fde17f7464b6430e2 /internal/version/version.go | |
| parent | ddfb922584dd990481f44aad1a989e5bdf188823 (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.go | 20 |
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" +} |
