AutoSDK
Guides

CLI Commands

Complete reference for all autosdk CLI commands and their options.

The AutoSDK CLI provides commands for generating SDKs, scaffolding projects, and creating test files.

autosdk generate

The primary command — generates a .NET SDK from an OpenAPI or AsyncAPI specification.

autosdk generate <input> [options]

Input can be a local file path or URL to an OpenAPI/AsyncAPI spec (JSON or YAML).

Common Options

OptionDescriptionDefault
--outputOutput directory for generated filesGenerated
--namespaceC# namespace for generated codeDerived from project
--clientClassNameName of the generated client classApi
--targetFrameworkTarget framework (e.g., net10.0)From project
--single-fileGenerate all code in a single filefalse
--exclude-deprecated-operationsSkip deprecated API operationsfalse

Security Options

OptionDescription
--security-schemeAuth scheme in Type:Location:Name format (repeatable)
--base-urlInject a base URL into the spec

Naming Options

OptionDescriptionDefault
--methodNamingConventionHow method names are generatedSimpleOperationId

Available conventions:

  • SimpleOperationId — Uses the operationId directly: listPets becomes ListPets
  • MethodAndPath — Combines HTTP method and path: GET /pets/{id} becomes GetPetById
  • OperationIdWithDots — Preserves dots as namespace separators

AsyncAPI Options

OptionDescription
--websocket-class-nameOverride WebSocket client class name
--types-namespaceReference types from another namespace (cross-namespace refs)
--generate-modelsWhether to generate model classes (true/false)
--json-serializer-contextReference existing JsonSerializerContext

See CLI Options Reference for every flag.

autosdk init

Scaffolds a complete SDK project with solution, tests, CI workflows, and docs.

autosdk init <solution-name> <client-name> <openapi-spec> <company> [options]

Options

OptionDescription
--add-mkdocsInclude MkDocs Material documentation site
--add-testsInclude MSTest integration test project

Example

autosdk init MyApi MyApiClient \
  "https://api.example.com/openapi.json" \
  MyCompany \
  --add-mkdocs --add-tests

autosdk http

Generates .http test files from an OpenAPI spec for use with VS Code REST Client or JetBrains HTTP Client.

autosdk http <input> [options]

autosdk ai spec-from-docs

Uses AI to generate an OpenAPI spec from API documentation pages (experimental).

autosdk ai spec-from-docs <url>
Edit on GitHub

Last updated on

On this page