orchestrate-multi-target-sdks
1
总安装量
1
周安装量
#45195
全站排名
安装命令
npx skills add https://github.com/speakeasy-api/agent-skills --skill orchestrate-multi-target-sdks
Agent 安装分布
claude-code
1
Skill 文档
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.yaml:
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/azure
Repository 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.json
Per-Target gen.yaml
Each variant has its own configuration:
# packages/azure/.speakeasy/gen.yaml
configVersion: 2.0.0
generation:
sdkClassName: MySDKAzure
typescript:
version: 1.0.0
packageName: '@myorg/mysdk-azure'
envVarPrefix: MYSDK_AZURE
Naming Conventions
| Variant | Package Name | Class Name |
|---|---|---|
| Main | @myorg/mysdk |
MySDK |
| Azure | @myorg/mysdk-azure |
MySDKAzure |
| GCP | @myorg/mysdk-gcp |
MySDKGCP |
CI Workflow Per Target
Create separate workflows for independent regeneration:
# .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).
# Independent versioning
# Main: version: 2.1.0
# Azure: version: 1.8.0
# GCP: version: 1.3.0
Sharing Code Across Variants
Option 1: Duplicate hooks in each variant (simpler)
Option 2: Create shared package:
shared/
âââ package.json # @myorg/mysdk-shared
âââ src/
âââ hooks.ts
Troubleshooting
| Issue | Solution |
|---|---|
| Wrong target generated | Specify -t target-name in speakeasy run |
| Config not found | Ensure .speakeasy/gen.yaml exists in output dir |
| Circular dependencies | Use workspace protocols in package.json |
Related Skills
start-new-sdk-project– Initial SDK setupconfigure-sdk-options– Language-specific configurationmanage-openapi-overlays– Per-source overlaysorchestrate-multi-repo-sdks– Single repo per language