Usage

Gradle

After configuration, generation runs automatically during the build.

Run explicitly:

Code
./gradlew generateSuiCodegen

Generated 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 generate

Or with custom config:

Code
./sui-kotlin-codegen generate --config ./sui-codegen.json

Generated 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 privateFunctions setting.
  • Injects well-known objects (Clock, etc.).
  • Produces overloads that work with PtbDsl from 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.