Installation
Clarigen is a command-line tool that you can install globally.
To install Clarigen, run:
Clarinet dependency
At the moment, using Clarigen requires that you have a basic Clarinet project setup. This allows Clarigen to re-use common configuration (like contracts, deployments, and requirements). If you don't have this yet, the easiest way to start is to install Clarinet and run:
Clarigen.toml
Your Clarigen-specfic configuration goes in Clarigen.toml
at the root of your project. To generate a basic configuration file, run:
In your newly-generated Clarigen.toml
file, you can specify if (and where) to generate code.
For TypeScript types, use the types.output
field:
If you don't want to generate code for either environment, just comment out that section's output
(or the section entirely).
Learn more about configuration
Generate some code!
Now you have everything you need for Clarigen to start generating type-safe boilerplate for you. In your terminal, simply run: