feat: add Go SDK and CLI generation from OpenAPI spec - #107
Merged
Conversation
markturansky
force-pushed
the
add-hypershell-cli
branch
7 times, most recently
from
August 13, 2026 23:32
0009ccb to
c4851b3
Compare
Port openapi-ir library and cli-generator from rh-trex-ai, upgrade sdk-generator to use openapi-ir instead of raw YAML parsing, and generate typed Go SDK (components/sdk-go) and cobra CLI (components/cli) for all 6 HyperShell Kinds. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Rename binary from hypershell to hsctl to match kubectl/acpctl patterns. Implement all missing CRUD operations for complete CLI coverage. Changes: - Rename binary: hypershell → hsctl - Add delete commands for all 8 resource types (Fleet, Gateway, GatewayNetwork, GatewayRelease, ManagedCluster, ManagedDatabase, Role, RoleBinding) - Add apply command with -f flag for declarative resource management - Update all import paths: cmd/hypershell → cmd/hsctl - Update Makefile build-cli target - Update e2e test to use hsctl throughout - Update all command examples in help text CLI Coverage: - create: ✅ All 8 resource types - delete: ✅ All 8 resource types (NEW) - get: ✅ All 8 resource types - list: ✅ All 8 resource types - apply: ✅ -f file/directory support (NEW) - login/logout/config/version: ✅ E2E tested against hypershell-stage cluster - all CLI commands verified. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
markturansky
force-pushed
the
add-hypershell-cli
branch
from
August 13, 2026 23:36
1538142 to
36c043d
Compare
Replace em dash (U+2014) with regular hyphens in markdown files to comply with repository policy. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openapi-irlibrary from rh-trex-ai intoscripts/openapi-ir/— canonical intermediate representation for OpenAPI specs with bounded preflight scanning, normalization, graph building, and safety validationcli-generatorfrom rh-trex-ai intoscripts/cli-generator/— generates a complete cobra CLI project from OpenAPI specs (23 templates covering login/logout/version/config/completion + per-resource list/get/create commands)sdk-generatorto useopenapi-irinstead of rawgopkg.in/yaml.v3parsing, aligning with the upstream rh-trex-ai implementationcomponents/sdk-go/with client and types packages for all 6 Kindscomponents/cli/with full cobra command tree for all 6 Kinds (Fleet, Gateway, GatewayNetwork, GatewayRelease, ManagedCluster, ManagedDatabase)generate-sdk-go,generate-clistrings.Containswhich caused prefix collisions (e.g.GatewaymatchingGatewayNetwork); replaced with direct resource pointer associationObjectReferencefrom both generators (it's a base type, not a Kind)Test plan
scripts/openapi-ir/builds:cd scripts/openapi-ir && GOWORK=off go build ./...scripts/sdk-generator/builds:cd scripts/sdk-generator && GOWORK=off go build ./...scripts/cli-generator/builds:cd scripts/cli-generator && GOWORK=off go build ./...make generate-sdk-goproduces 6 resources (no ObjectReference)make generate-cliproduces 6 resources (no ObjectReference)components/sdk-go/builds:cd components/sdk-go && GOWORK=off go build ./...components/cli/builds:cd components/cli && GOWORK=off go build ./...--helpshows all commands: login, logout, version, config, completion, list, get, createlist --helpshows all 6 resource subcommandscreate gateway --helpshows all 16 writable field flags🤖 Generated with Claude Code