AutoSDK
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

OptionTypeDefaultDescription
--outputstringGeneratedOutput directory for generated files
--namespacestringFrom projectC# namespace for all generated types
--clientClassNamestringApiName of the generated HTTP client class
--targetFrameworkstringFrom projectTarget framework (e.g., net10.0, netstandard2.0)
--single-fileboolfalseGenerate all code in a single file

Security Options

OptionTypeDefaultDescription
--security-schemestringAuth scheme (repeatable). Format: Type:Location:Name
--base-urlstringInject server URL into the spec

Security Scheme Format

Type:Location:Name where:

  • Type: ApiKey or Http
  • Location: Header, Query, or Cookie
  • 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 auth

Naming Options

OptionTypeDefaultDescription
--methodNamingConventionenumSimpleOperationIdMethod naming strategy
--methodNamingConventionFallbackenumMethodAndPathFallback when operationId missing
--useExtensionNamingboolfalseUse x-fern-sdk-group-name/x-fern-sdk-method-name

Method naming conventions: SimpleOperationId, MethodAndPath, OperationIdWithDots

Filtering Options

OptionTypeDefaultDescription
--exclude-deprecated-operationsboolfalseSkip deprecated operations
--includeOperationIdsstringOnly generate these operations (semicolon-separated)
--excludeOperationIdsstringSkip these operations (semicolon-separated)
--includeTagsstringOnly generate operations with these tags
--excludeTagsstringSkip operations with these tags
--includeModelsstringOnly generate these models
--excludeModelsstringSkip these models

Model Options

OptionTypeDefaultDescription
--modelStyleenumClassModel code style: Class, Record, ReadonlyRecordStruct
--validationboolfalseGenerate validation methods on models
--compute-discriminatorsboolfalseAuto-detect oneOf/anyOf discriminators

JSON Options

OptionTypeDefaultDescription
--json-serializer-typeenumSystemTextJsonSerializer: SystemTextJson or NewtonsoftJson
--json-serializer-contextstringReference existing JsonSerializerContext

AsyncAPI / WebSocket Options

OptionTypeDefaultDescription
--websocket-class-namestringAutoOverride WebSocket client class name
--types-namespacestringReference types from another namespace
--generate-modelsbooltrueWhether to generate model classes

Code Generation Options

OptionTypeDefaultDescription
--generate-polyfillsbooltrueGenerate framework compatibility shims
--generate-exceptionsbooltrueGenerate exception types
--generate-cliboolfalseGenerate CLI wrapper for the SDK
--group-by-tagsboolfalseGroup operations by OpenAPI tags

Error Handling

OptionTypeDefaultDescription
--ignore-openapi-errorsbooltrueContinue on spec parse errors
--ignore-openapi-warningsbooltrueSuppress spec warnings
Edit on GitHub

Last updated on

On this page