GitHub
Getting Started

Installation

Clarigen is a command-line tool that you can install globally.

To install Clarigen, run:

npm install -g @clarigen/cli

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:

# change "my-project" to your project's name
clarinet new my-project
# then install Clarigen:
# cd my-project
# npm install @clarigen/cli

Clarigen.toml

Your Clarigen-specfic configuration goes in Clarigen.toml at the root of your project. To generate a basic configuration file, run:

clarigen init

In your newly-generated Clarigen.toml file, you can specify if (and where) to generate code.

For TypeScript types, use the types.output field:

Clarigen.toml
[types]
output = "src/clarigen-types.ts"

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:

npx clarigen