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
| Option | Description | Default |
|---|---|---|
--output | Output directory for generated files | Generated |
--namespace | C# namespace for generated code | Derived from project |
--clientClassName | Name of the generated client class | Api |
--targetFramework | Target framework (e.g., net10.0) | From project |
--single-file | Generate all code in a single file | false |
--exclude-deprecated-operations | Skip deprecated API operations | false |
Security Options
| Option | Description |
|---|---|
--security-scheme | Auth scheme in Type:Location:Name format (repeatable) |
--base-url | Inject a base URL into the spec |
Naming Options
| Option | Description | Default |
|---|---|---|
--methodNamingConvention | How method names are generated | SimpleOperationId |
Available conventions:
- SimpleOperationId — Uses the
operationIddirectly:listPetsbecomesListPets - MethodAndPath — Combines HTTP method and path:
GET /pets/{id}becomesGetPetById - OperationIdWithDots — Preserves dots as namespace separators
AsyncAPI Options
| Option | Description |
|---|---|
--websocket-class-name | Override WebSocket client class name |
--types-namespace | Reference types from another namespace (cross-namespace refs) |
--generate-models | Whether to generate model classes (true/false) |
--json-serializer-context | Reference 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
| Option | Description |
|---|---|
--add-mkdocs | Include MkDocs Material documentation site |
--add-tests | Include MSTest integration test project |
Example
autosdk init MyApi MyApiClient \
"https://api.example.com/openapi.json" \
MyCompany \
--add-mkdocs --add-testsautosdk 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