Syntax
suprsend generate-types <language> [flags]
| Argument | Description |
|---|---|
<language> | Target language: typescript, go, python, java, kotlin, swift, dart |
Common Flags
| Flag | Description | Default |
|---|---|---|
-h, --help | Show help for the command | – |
--output-file string | Output file path for generated types | Language-specific default |
--mode string | Version mode (draft or live) | live |
--workspace string | Workspace to get schemas from | staging |
Language-Specific Flags
- TypeScript
- Python
- Go
- Java
- Kotlin
- Swift
- Dart
Generate TypeScript type definitions from trigger payload schemas. Fetches linked schemas and generates types in a single output file. Supports Zod schema generation with
--zod.| Flag | Description | Default |
|---|---|---|
--output-file string | Output file path | suprsend-types.ts |
--zod | Generate Zod schemas instead of plain TypeScript types | false |
Generate Python type definitions from trigger payload schemas. Fetches linked schemas from the workspace and generates a single Python file with type classes. Supports Pydantic models (enabled by default).
| Flag | Description | Default |
|---|---|---|
--output-file string | Output file path | suprsend_types.py |
--pydantic | Generate Pydantic BaseModel classes instead of plain dataclasses | true |
Generate Go type definitions from trigger payload schemas. Produces struct definitions in a single output file with the specified package name.
| Flag | Description | Default |
|---|---|---|
--output-file string | Output file path | suprsend_types.go |
--package string | Go package name for generated structs | suprsend |
Generate Java type definitions from trigger payload schemas. Creates one Java file per linked schema in a package directory structure. Supports Lombok annotations with
--lombok.| Flag | Description | Default |
|---|---|---|
--output-file string | Output file path | SuprsendTypes.java |
--package string | Java package name for generated classes | suprsend.types |
--lombok | Add Lombok annotations to generated classes | false |
Generate Kotlin type definitions from trigger payload schemas. Produces data classes in a single output file with the specified package name.
| Flag | Description | Default |
|---|---|---|
--output-file string | Output file path | SuprsendTypes.kt |
--package string | Kotlin package name for generated data classes | suprsend |
Generate Swift type definitions from trigger payload schemas. Produces Codable structs in a single output file.
| Flag | Description | Default |
|---|---|---|
--output-file string | Output file path | SuprsendTypes.swift |
Generate Dart type definitions from trigger payload schemas. Produces null-safe classes in a single output file.
| Flag | Description | Default |
|---|---|---|
--output-file string | Output file path | suprsend_types.dart |
Example
# Generate TypeScript types
suprsend generate-types typescript
# Generate TypeScript types with Zod schemas
suprsend generate-types typescript --zod --workspace production
# Custom output file
suprsend generate-types typescript --output-file src/types/notifications.ts
# Generate Python types (Pydantic by default)
suprsend generate-types python
# Generate plain dataclasses
suprsend generate-types python --pydantic=false
# Generate from production workspace
suprsend generate-types python --workspace production
# Generate Go types
suprsend generate-types go
# Custom package name
suprsend generate-types go --package notifications --output-file notifications/types.go
# Generate Java types
suprsend generate-types java
# Generate with Lombok annotations
suprsend generate-types java --lombok --package com.myapp.notifications
# Generate Kotlin data classes
suprsend generate-types kotlin
# Custom package
suprsend generate-types kotlin --package com.myapp.notifications
# Generate Swift Codable structs
suprsend generate-types swift
# Generate null-safe Dart classes
suprsend generate-types dart