From a0fc17dbcba97382cafcdab4363dfd8737e24aaf Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Tue, 14 Apr 2026 04:34:10 +0900 Subject: [PATCH] chore: include user-agent for future tracking of deployed client's versions --- internal/api/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/api/client.go b/internal/api/client.go index 514ad03..9da03e1 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -3,9 +3,11 @@ package api import ( "context" + "fmt" "net/http" "strings" + "github.com/ctrlplanedev/cli/cmd/ctrlc/root/version" "github.com/google/uuid" ) @@ -15,6 +17,7 @@ func NewAPIKeyClientWithResponses(server string, apiKey string) (*ClientWithResp return NewClientWithResponses(server+"/api", WithRequestEditorFn(func(ctx context.Context, req *http.Request) error { req.Header.Set("X-API-Key", apiKey) + req.Header.Set("User-Agent", fmt.Sprintf("ctrlc/%s", version.Version)) return nil }), )