⛵ Sails CLI
sails-cli is the command-line interface for working with Sails projects.
It provides commands to scaffold a new Sails workspace, generate clients from
IDL, extract IDL from Rust crates, and produce Solidity bindings.
The binary is exposed as the Cargo subcommand cargo sails.
Usage
Install the CLI:
Or install a prebuilt binary with cargo-binstall:
Show available commands:
Create a new Sails project:
Create a project without network access and use a local sails-rs path:
Generate Rust client code from IDL:
Generate TypeScript client code from IDL:
Generate IDL from a Cargo manifest:
Embed IDL into a WASM binary as a custom section:
Extract IDL from a WASM binary:
Generate Solidity artifacts from IDL:
Generated Sails Project Parts
The cargo sails new command creates a workspace with a few distinct parts:
- Root crate: the workspace entry point that wires dependencies together and contains the build logic for the final WASM and IDL artifacts.
appcrate: the package that contains the program business logic and service implementation.clientcrate: the package that builds the generated Rust client interface for interacting with the program.testsdirectory: integration tests based ongtest/gclient.
Typical generated-project workflow:
If you need Ethereum-compatible contracts for Vara.ETH, create the workspace
with --eth.