Reference
CLI Options Reference
Complete reference for every autosdk generate flag and option.
Complete reference for all autosdk generate command options.
Usage
autosdk generate <input> [options]<input> — Path or URL to an OpenAPI 3.0/3.1 or AsyncAPI 2.x specification (JSON or YAML).
Core Options
| Option | Type | Default | Description |
|---|---|---|---|
--output | string | Generated | Output directory for generated files |
--namespace | string | From project | C# namespace for all generated types |
--clientClassName | string | Api | Name of the generated HTTP client class |
--targetFramework | string | From project | Target framework (e.g., net10.0, netstandard2.0) |
--single-file | bool | false | Generate all code in a single file |
Security Options
| Option | Type | Default | Description |
|---|---|---|---|
--security-scheme | string | — | Auth scheme (repeatable). Format: Type:Location:Name |
--base-url | string | — | Inject server URL into the spec |
Security Scheme Format
Type:Location:Name where:
- Type:
ApiKeyorHttp - Location:
Header,Query, orCookie - Name: Parameter name or auth scheme (
Bearer,Basic)
Examples:
--security-scheme Http:Header:Bearer # Bearer token
--security-scheme ApiKey:Header:x-api-key # API key in header
--security-scheme ApiKey:Query:api_key # API key in query string
--security-scheme Http:Header:Basic # Basic authNaming Options
| Option | Type | Default | Description |
|---|---|---|---|
--methodNamingConvention | enum | SimpleOperationId | Method naming strategy |
--methodNamingConventionFallback | enum | MethodAndPath | Fallback when operationId missing |
--useExtensionNaming | bool | false | Use x-fern-sdk-group-name/x-fern-sdk-method-name |
Method naming conventions: SimpleOperationId, MethodAndPath, OperationIdWithDots
Filtering Options
| Option | Type | Default | Description |
|---|---|---|---|
--exclude-deprecated-operations | bool | false | Skip deprecated operations |
--include-models | string[] | — | Only generate these component schema IDs. Repeatable or pass multiple values |
--exclude-models | string[] | — | Skip these component schema IDs. Repeatable or pass multiple values |
When model filtering is enabled, AutoSDK matches the raw component IDs from the specification. For example, if your schema is named PetStore.Pet, use --include-models PetStore.Pet or --exclude-models PetStore.Pet.
Model Options
| Option | Type | Default | Description |
|---|---|---|---|
--modelStyle | enum | Class | Model code style: Class, Record, ReadonlyRecordStruct |
--validation | bool | false | Generate validation methods on models |
--compute-discriminators | bool | false | Auto-detect oneOf/anyOf discriminators |
--namespace-delimiter | string | "" | Optional single-character delimiter for splitting dotted component schema IDs into namespaces |
--excluded-model-namespace-mode | enum | External | How excluded dotted models are referenced when --namespace-delimiter is enabled: External or SdkRoot |
Dotted Schema Namespace Example
autosdk generate openapi.yaml \
--namespace G \
--namespace-delimiter .With the delimiter enabled:
PetStore.Petgeneratesnamespace G.PetStorewith classPetSystem.Text.Json.Nodes.JsonObjectgeneratesnamespace G.System.Text.Json.Nodeswith classJsonObject--exclude-models PetStore.Petstill matches the raw schema ID exactly
If you also exclude a dotted model, --excluded-model-namespace-mode controls the reference target:
External->global::PetStore.PetSdkRoot->global::G.PetStore.Pet
JSON Options
| Option | Type | Default | Description |
|---|---|---|---|
--json-serializer-type | enum | SystemTextJson | Serializer: SystemTextJson or NewtonsoftJson |
--json-serializer-context | string | — | Reference existing JsonSerializerContext |
AsyncAPI / WebSocket Options
| Option | Type | Default | Description |
|---|---|---|---|
--websocket-class-name | string | Auto | Override WebSocket client class name |
--types-namespace | string | — | Reference types from another namespace |
--generate-models | bool | true | Whether to generate model classes |
--json-serializer-context | string | SourceGenerationContext | Override the generated JsonSerializerContext class name |
Code Generation Options
| Option | Type | Default | Description |
|---|---|---|---|
--generate-polyfills | bool | true | Generate framework compatibility shims |
--generate-exceptions | bool | true | Generate exception types |
--generate-cli | bool | false | Generate CLI wrapper for the SDK |
--group-by-tags | bool | false | Group operations by OpenAPI tags |
Error Handling
| Option | Type | Default | Description |
|---|---|---|---|
--ignore-openapi-errors | bool | true | Continue on spec parse errors |
--ignore-openapi-warnings | bool | true | Suppress spec warnings |
Edit on GitHub
Last updated on