Skip to content
Agent Orchestration
Command

/trex.openapi.generate

Regenerate the Go client code from OpenAPI specifications. Run this after modifying any `openapi/*.yaml` files.

BOOST
From plugin
platform
13111 skills6 agents11 commands3 MCP
Install
$ npx -y skills add ambient-code/platform --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/trex.openapi.generate

Context preview

What this command does when you run it.

Regenerate the Go client code from OpenAPI specifications. Run this after modifying any `openapi/*.yaml` files.

Command definition

trex.openapi.generate.md

Regenerate OpenAPI Client Code

Regenerate the Go client code from OpenAPI specifications. Run this after modifying any `openapi/*.yaml` files.

Instructions

Step 1: Verify Docker/Podman is Running

The generator uses a container to run the OpenAPI code generator:

podman info --format '{{.Host.RemoteSocket.Exists}}' 2>/dev/null || docker info --format '{{.ID}}' 2>/dev/null

If neither is running, inform the user that Docker or Podman is required.

Step 2: Run the Generator

make generate

This takes 2-3 minutes. It: 1. Builds a container image from `Dockerfile.openapi` 2. Runs the OpenAPI Generator inside the container 3. Copies generated Go files back into `pkg/api/openapi/`

Step 3: Verify Generated Files

ls -la pkg/api/openapi/model_*.go | head -20

Check for the expected model files for each Kind defined in the OpenAPI specs.

Step 4: Build to Confirm

make binary

When to Run This

  • After creating a new Kind (part of `/trex.kind.new` workflow)
  • After adding fields to an existing Kind's OpenAPI spec
  • After modifying `openapi/openapi.yaml` or any `openapi/openapi.*.yaml` file
  • After resolving merge conflicts in OpenAPI specs

Troubleshooting

  • **"Cannot connect to Docker daemon"**: Start Docker/Podman first
  • **Build fails after generation**: Check for type mismatches between your OpenAPI schema types and the presenter code
  • **Missing model files**: Verify the schema name in `openapi.yaml` matches the `$ref` target exactly
Read more
Ships withplatform

Kubernetes-native AI automation platform for intelligent agentic sessions

Get the whole plugin

Other commands on platform.