regenerate-sdk
regenerate-sdk
Use speakeasy run to execute the workflow and regenerate SDKs.
When to Use
- OpenAPI spec has been updated
- Workflow or overlay configuration changed
- Regenerating with latest Speakeasy version
- User says: "regenerate SDK", "run speakeasy", "spec changed"
Inputs
| Input | Required | Description |
|---|---|---|
| workflow.yaml | Yes | Must exist at .speakeasy/workflow.yaml |
| OpenAPI spec | Yes | As configured in workflow |
| Authentication | Yes | Via speakeasy auth login or SPEAKEASY_API_KEY env var |
Outputs
| Output | Description |
|---|---|
| Generated SDK | Updated SDK code in output directory |
| Generation logs | Success/failure details |
Prerequisites
For non-interactive environments (CI/CD, AI agents), set:
export SPEAKEASY_API_KEY="<your-api-key>"
See configure-authentication skill for details.
Command
# Run all configured targets
speakeasy run
# Run specific target only
speakeasy run -t <target-name>
# Run with specific source
speakeasy run -s <source-name>
# AI-friendly output mode
speakeasy run --output console
When to Use
- After updating the OpenAPI spec
- After modifying workflow.yaml
- After changing overlays
- To regenerate with latest Speakeasy version
Example Workflow
# .speakeasy/workflow.yaml
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-api:
inputs:
- location: ./openapi.yaml
targets:
typescript-sdk:
target: typescript
source: my-api
output: ./sdk/typescript
AI-Friendly Output
For commands with large outputs, pipe to grep or tail to reduce context:
speakeasy run --output console 2>&1 | tail -50
What NOT to Do
- Do NOT run without checking spec validity first if there were recent changes
- Do NOT ignore generation warnings - they may indicate SDK quality issues
- Do NOT delete
.speakeasy/directory without understanding its purpose
Troubleshooting
If speakeasy run fails, check:
- Is the OpenAPI spec valid? Run
speakeasy lint openapi --non-interactive -s <spec> - Does the source path exist? Check
inputs.locationin workflow.yaml - Are there blocking validation errors? See
diagnose-generation-failureskill
Related Skills
start-new-sdk-project- Initial setup if no workflow.yaml existsvalidate-openapi-spec- Check spec before regeneratingdiagnose-generation-failure- When generation failscheck-workspace-status- See configured targets and sources
More from speakeasy-api/agent-skills
writing-openapi-specs
Reference guide for OpenAPI specification best practices, naming conventions, and expressing complex REST API patterns like polymorphism, enums, file uploads, and server-sent events. Use when writing or improving OpenAPI specs to ensure they follow established conventions and generate quality SDKs.
16diagnose-generation-failure
Use when SDK generation failed or seeing errors. Triggers on "generation failed", "speakeasy run failed", "SDK build error", "workflow failed", "Step Failed", "why did generation fail
14start-new-sdk-project
>-
14manage-openapi-overlays
Use when creating, applying, or validating overlay files including x-speakeasy extensions. Covers overlay syntax, JSONPath targeting, retries, pagination, naming, grouping, open enums, global headers, custom security. Triggers on "create overlay", "apply overlay", "overlay file", "x-speakeasy", "add extension", "configure retries", "add pagination", "overlay for retries".
13extract-openapi-from-code
Use when extracting or generating an OpenAPI spec from existing API code. Triggers on "extract OpenAPI", "code first", "generate spec from code", "FastAPI OpenAPI", "Spring Boot OpenAPI", "NestJS swagger", "Django OpenAPI", "Flask OpenAPI", "Rails swagger", "Laravel OpenAPI", "existing API code
10speakeasy-context
Speakeasy workflow: run 'agent context' FIRST, do task, run 'agent feedback' LAST. Triggers on speakeasy, SDK, OpenAPI.
10