From 0f334f7bc2967883e72da651e3da037b6cb08464 Mon Sep 17 00:00:00 2001 From: Jonathan Fishner Date: Mon, 18 May 2026 22:15:40 +0300 Subject: [PATCH 1/3] fix: use canonical onecli.sh domain without www prefix (#55) --- cmd/onecli/skill_gateway_fallback.md | 2 +- scripts/install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/onecli/skill_gateway_fallback.md b/cmd/onecli/skill_gateway_fallback.md index 7040e79..581cc11 100644 --- a/cmd/onecli/skill_gateway_fallback.md +++ b/cmd/onecli/skill_gateway_fallback.md @@ -50,7 +50,7 @@ values are managed by OneCLI — do NOT modify or delete them. If an MCP server won't start due to missing credentials, create stubs **before** starting it. Use `"onecli-managed"` as the placeholder for all secret values, with file permissions `0600`. See the guide at: -https://www.onecli.sh/docs/guides/credential-stubs/general-app +https://onecli.sh/docs/guides/credential-stubs/general-app ## When a Request Fails diff --git a/scripts/install.sh b/scripts/install.sh index 42d7304..735d636 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -40,7 +40,7 @@ main() { # Fetch latest release info from server (avoids GitHub API rate limits) echo "Fetching latest release..." - RELEASE_INFO=$(curl -fsSL "https://www.onecli.sh/cli/version?os=${OS}&arch=${ARCH}") + RELEASE_INFO=$(curl -fsSL "https://onecli.sh/cli/version?os=${OS}&arch=${ARCH}") LATEST=$(echo "$RELEASE_INFO" | sed -n '1p') if [ -z "$LATEST" ]; then From e13fa7e1502a7386d0d6fb9e3a0756ce0d9cfb93 Mon Sep 17 00:00:00 2001 From: Jonathan Fishner Date: Mon, 18 May 2026 23:35:04 +0300 Subject: [PATCH 2/3] fix: show server version and status in version command (#31) --- cmd/onecli/version.go | 35 +++++++++++++++++++++++++++++----- internal/api/health.go | 18 +++++++++++++++++ internal/config/config_test.go | 2 ++ 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 internal/api/health.go diff --git a/cmd/onecli/version.go b/cmd/onecli/version.go index 8db0ef1..834a111 100644 --- a/cmd/onecli/version.go +++ b/cmd/onecli/version.go @@ -1,17 +1,42 @@ package main -import "github.com/onecli/onecli-cli/pkg/output" +import ( + "context" + "time" + + "github.com/onecli/onecli-cli/pkg/output" +) // VersionCmd prints version information as JSON. type VersionCmd struct{} // VersionResponse is the JSON output of the version command. type VersionResponse struct { - Version string `json:"version"` + Version string `json:"version"` + ServerVersion string `json:"server_version"` + ServerStatus string `json:"server_status"` } func (cmd *VersionCmd) Run(out *output.Writer) error { - return out.Write(VersionResponse{ - Version: version, - }) + resp := VersionResponse{Version: version} + + client, err := newClient() + if err != nil { + resp.ServerVersion = "unknown" + resp.ServerStatus = "not_configured" + return out.Write(resp) + } + + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + health, err := client.GetHealth(ctx) + if err != nil { + resp.ServerVersion = "unknown" + resp.ServerStatus = "unreachable" + return out.Write(resp) + } + + resp.ServerVersion = health.Version + resp.ServerStatus = health.Status + return out.Write(resp) } diff --git a/internal/api/health.go b/internal/api/health.go new file mode 100644 index 0000000..8abfa40 --- /dev/null +++ b/internal/api/health.go @@ -0,0 +1,18 @@ +package api + +import "context" + +// HealthResponse is the response from /api/health. +type HealthResponse struct { + Status string `json:"status"` + Version string `json:"version"` +} + +// GetHealth calls the /api/health endpoint. +func (c *Client) GetHealth(ctx context.Context) (*HealthResponse, error) { + var resp HealthResponse + if err := c.do(ctx, "GET", "/api/health", nil, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 7834c5f..2296e64 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -29,6 +29,8 @@ func TestEnvUnknownValueDefaultsToProduction(t *testing.T) { } func TestAPIHostDefault(t *testing.T) { + t.Setenv("HOME", t.TempDir()) + t.Setenv("ONECLI_ENV", "") t.Setenv("ONECLI_API_HOST", "") // Env var not set and no config file → default got := APIHost() From 543f456b2b18ba7e0fa6d6cf8c3384220bc5586a Mon Sep 17 00:00:00 2001 From: Guy Ben-Aharon Date: Mon, 18 May 2026 23:43:14 +0300 Subject: [PATCH 3/3] chore(main): release 1.7.2 (#56) --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index caf0032..889cf94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.7.2](https://github.com/onecli/onecli-cli/compare/v1.7.1...v1.7.2) (2026-05-18) + + +### Bug Fixes + +* show server version and status in version command ([#31](https://github.com/onecli/onecli-cli/issues/31)) ([e13fa7e](https://github.com/onecli/onecli-cli/commit/e13fa7e1502a7386d0d6fb9e3a0756ce0d9cfb93)) +* use canonical onecli.sh domain without www prefix ([#55](https://github.com/onecli/onecli-cli/issues/55)) ([0f334f7](https://github.com/onecli/onecli-cli/commit/0f334f7bc2967883e72da651e3da037b6cb08464)) + ## [1.7.1](https://github.com/onecli/onecli-cli/compare/v1.7.0...v1.7.1) (2026-05-17)