orchestrate-multi-target-sdks
Original:🇺🇸 English
Translated
Use when generating multiple SDK variants from one repository. Covers workflow.yaml multi-target configuration, per-target gen.yaml, monorepo structure, versioning strategies. Triggers on "multi-target SDK", "multiple SDK variants", "Azure SDK variant", "GCP SDK", "cloud-specific SDK", "SDK monorepo".
1installs
Added on
NPX Install
npx skill4agent add speakeasy-api/agent-skills orchestrate-multi-target-sdksTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Orchestrate Multi-Target SDKs
Generate multiple SDK variants (e.g., core, Azure, GCP) from different OpenAPI sources in a single repository.
When to Use
- Generating cloud-specific SDK variants (Azure, GCP, AWS)
- Creating regional API variants (US, EU, APAC)
- Building partner-branded/white-label SDKs
- Managing multiple OpenAPI sources in one repo
- User says: "multi-target SDK", "Azure variant", "SDK monorepo"
Quick Start
Configure multiple sources and targets in :
workflow.yamlyaml
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
main-source:
inputs:
- location: registry.speakeasyapi.dev/org/repo/main-openapi:main
azure-source:
inputs:
- location: registry.speakeasyapi.dev/org/repo/azure-openapi:main
targets:
main-sdk:
target: typescript
source: main-source
output: ./
azure-sdk:
target: typescript
source: azure-source
output: ./packages/azureRepository Structure
my-multi-sdk/
├── .speakeasy/
│ ├── workflow.yaml # Multi-target config
│ └── gen.yaml # Main SDK config
├── src/ # Main SDK source
├── packages/
│ ├── azure/
│ │ ├── .speakeasy/
│ │ │ └── gen.yaml # Azure-specific config
│ │ └── src/
│ └── gcp/
│ ├── .speakeasy/
│ │ └── gen.yaml # GCP-specific config
│ └── src/
├── .github/workflows/
│ ├── sdk_generation_main.yaml
│ ├── sdk_generation_azure.yaml
│ └── sdk_generation_gcp.yaml
└── package.jsonPer-Target gen.yaml
Each variant has its own configuration:
yaml
# packages/azure/.speakeasy/gen.yaml
configVersion: 2.0.0
generation:
sdkClassName: MySDKAzure
typescript:
version: 1.0.0
packageName: '@myorg/mysdk-azure'
envVarPrefix: MYSDK_AZURENaming Conventions
| Variant | Package Name | Class Name |
|---|---|---|
| Main | | |
| Azure | | |
| GCP | | |
CI Workflow Per Target
Create separate workflows for independent regeneration:
yaml
# .github/workflows/sdk_generation_azure.yaml
name: Generate Azure SDK
on:
workflow_dispatch:
inputs:
force:
type: boolean
default: false
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with:
target: azure-sdk
mode: pr
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}Versioning Strategies
Lockstep: All variants share the same version (simpler).
Independent: Each variant has its own version (more flexible).
yaml
# Independent versioning
# Main: version: 2.1.0
# Azure: version: 1.8.0
# GCP: version: 1.3.0Sharing Code Across Variants
Option 1: Duplicate hooks in each variant (simpler)
Option 2: Create shared package:
shared/
├── package.json # @myorg/mysdk-shared
└── src/
└── hooks.tsTroubleshooting
| Issue | Solution |
|---|---|
| Wrong target generated | Specify |
| Config not found | Ensure |
| Circular dependencies | Use workspace protocols in package.json |
Related Skills
- - Initial SDK setup
start-new-sdk-project - - Language-specific configuration
configure-sdk-options - - Per-source overlays
manage-openapi-overlays - - Single repo per language
orchestrate-multi-repo-sdks