C
Emits package directories containing types.h and functions.c.
Use thru abi codegen when you already have ABI YAML and want generated client-side or runtime-facing code, not an on-chain ABI account.
Choose another ABI command when:
thru abi codegen \ --files <FILE>... \ --language c|rust|typescript \ [--include-dir <DIR>...] \ [--output <DIR>] \ [--verbose]| Input | What it does |
|---|---|
—files <FILE>… | One or more root ABI YAML files to load. |
| `—language c | rust |
—include-dir <DIR>… | Adds search roots for imported ABI files. |
—output <DIR> | Output directory for generated code. Defaults to generated. |
The generator resolves imports, groups types by package, and writes package directories underneath the output directory.
C
Emits package directories containing types.h and functions.c.
Rust
Emits package directories with types.rs, helper modules, and mod.rs scaffolding.
TypeScript
Emits package directories with types.ts.
| Language | Typical output |
|---|---|
c | Package directories with types.h and functions.c. |
rust | Package directories with types.rs, helper modules, and mod.rs scaffolding. |
typescript | Package directories with types.ts. |
thru abi codegen \ --files ./program.abi.yaml \ --language c \ --output ./generated/cthru abi codegen \ --files ./program.abi.yaml \ --include-dir ./abi \ --language rust \ --output ./generated/rustthru abi codegen \ --files ./program.abi.yaml ./shared.abi.yaml \ --include-dir ./abi \ --language typescript \ --output ./generated/ts--files can be repeated so one run can generate code for multiple root packages.--verbose is useful when import resolution is the risky part of the task because it prints loaded files, packages, and output locations.