pina_cli
CLI and library for generating Codama IDLs from Pina programs.
The binary name is pina.
Installation
Or run from source in this repository:
Commands
pina idl
Generate a Codama rootNode JSON from a Pina program crate.
# Write to stdout.
# Write to a file.
# Override program name in generated output.
pina init
Scaffold a new Pina program project.
pina codama generate
Generate Codama IDLs and Rust/JS clients from one or more example program crates.
Library API
pina_cli can also be embedded directly:
use Path;
let root = generate_idl?;
println!;
# Ok::
Codama Workflow
- Generate IDL with
pina idl. - Feed the JSON into Codama renderers.
JavaScript clients in another project
import from "@codama/renderers-js";
import from "codama";
const codama = await ;
await codama.;
Pina-style Rust clients
This repository includes crates/pina_codama_renderer, which renders discriminator-first/bytemuck Rust client models from Codama JSON.
Parser Expectations
For best IDL extraction fidelity, follow the rules documented in crates/pina_cli/rules.md.