Usage
Gradle
After configuration, generation runs automatically during the build.
Run explicitly:
Code
./gradlew generateSuiCodegenGenerated sources are written to the configured output directory (defaults to the standard Gradle generated sources location for the target source set).
They are added to the source set automatically.
CLI
Code
./sui-kotlin-codegen generateOr with custom config:
Code
./sui-kotlin-codegen generate --config ./sui-codegen.jsonGenerated Code Shape
For a module named counter, you get something like:
Code
public object CounterModule {
public object Types {
// typed Move structs / enums
}
public object Functions {
// constants, etc.
}
public fun create(
dsl: PtbDsl,
packageId: String = DEFAULT_PACKAGE,
): Argument.Result { ... }
public fun increment(
dsl: PtbDsl,
counter: MoveInput<String>,
packageId: String = DEFAULT_PACKAGE,
): Argument.Result { ... }
}The generator:
- Filters private functions based on your
privateFunctionssetting. - Injects well-known objects (Clock, etc.).
- Produces overloads that work with
PtbDslfrom ksui-core. - Emits one file per Move module under your
basePackage.
See the generated/ directory in the repository or run the generator against the test fixtures for concrete examples.