From 071715a53bfb937825a165d5fce54ee73e8a8a83 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 2 Apr 2026 00:47:15 -0400 Subject: [PATCH 1/2] feat(cli): add Info schema for info command response Add Info schema to the OpenAPI specification with version, agents, and runtimes fields. Regenerate Go types. Signed-off-by: Brian Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Brian --- cli/go/api.go | 41 +++++++++++++++++++++++++++++++++++++++++ cli/openapi.yaml | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 cli/go/api.go diff --git a/cli/go/api.go b/cli/go/api.go new file mode 100644 index 0000000..b786828 --- /dev/null +++ b/cli/go/api.go @@ -0,0 +1,41 @@ +// Package api provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. +package api + +// Error defines model for Error. +type Error struct { + Error string `json:"error"` +} + +// Info defines model for Info. +type Info struct { + Agents []string `json:"agents"` + Runtimes []string `json:"runtimes"` + Version string `json:"version"` +} + +// Workspace defines model for Workspace. +type Workspace struct { + Agent *string `json:"agent,omitempty"` + Id string `json:"id"` + Name string `json:"name"` + Paths WorkspacePaths `json:"paths"` + Project *string `json:"project,omitempty"` +} + +// WorkspaceId defines model for WorkspaceId. +type WorkspaceId struct { + Id string `json:"id"` +} + +// WorkspacePaths defines model for WorkspacePaths. +type WorkspacePaths struct { + Configuration string `json:"configuration"` + Source string `json:"source"` +} + +// WorkspacesList defines model for WorkspacesList. +type WorkspacesList struct { + Items []Workspace `json:"items"` +} diff --git a/cli/openapi.yaml b/cli/openapi.yaml index 6592110..7eee7e1 100644 --- a/cli/openapi.yaml +++ b/cli/openapi.yaml @@ -78,6 +78,31 @@ paths: paths: source: /home/user/workspace2 configuration: /home/user/.kortex-cli/workspaces/workspace2 + /info: + get: + summary: Display information about kortex-cli + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/Info' + example: + version: 0.3.0 + agents: + - claude + - goose + runtimes: + - podman + '400': + description: Error response + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "Error: failed to list agents" /remove: get: summary: Remove a workspace @@ -197,6 +222,24 @@ components: - agent - state - paths + Info: + type: object + additionalProperties: false + properties: + version: + type: string + agents: + type: array + items: + type: string + runtimes: + type: array + items: + type: string + required: + - version + - agents + - runtimes WorkspacesList: type: object additionalProperties: false From eddc4f7cb4ba5036e8f6a4708409fb31e7a3324f Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Fri, 3 Apr 2026 10:35:06 +0200 Subject: [PATCH 2/2] fix: remove generated go code Signed-off-by: Philippe Martin --- cli/go/api.go | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 cli/go/api.go diff --git a/cli/go/api.go b/cli/go/api.go deleted file mode 100644 index b786828..0000000 --- a/cli/go/api.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package api provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT. -package api - -// Error defines model for Error. -type Error struct { - Error string `json:"error"` -} - -// Info defines model for Info. -type Info struct { - Agents []string `json:"agents"` - Runtimes []string `json:"runtimes"` - Version string `json:"version"` -} - -// Workspace defines model for Workspace. -type Workspace struct { - Agent *string `json:"agent,omitempty"` - Id string `json:"id"` - Name string `json:"name"` - Paths WorkspacePaths `json:"paths"` - Project *string `json:"project,omitempty"` -} - -// WorkspaceId defines model for WorkspaceId. -type WorkspaceId struct { - Id string `json:"id"` -} - -// WorkspacePaths defines model for WorkspacePaths. -type WorkspacePaths struct { - Configuration string `json:"configuration"` - Source string `json:"source"` -} - -// WorkspacesList defines model for WorkspacesList. -type WorkspacesList struct { - Items []Workspace `json:"items"` -}